Module:rad-pronunciation: Difference between revisions

Jump to navigation Jump to search
m
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
mNo edit summary
Line 6: Line 6:
local m_links = require("Module:links")
local m_links = require("Module:links")
local m_languages = require("Module:languages")
local m_languages = require("Module:languages")
 
local m_table = require("Module:table")
function table.contains(table, element)
  for _, value in pairs(table) do
    if value == element then
      return true
    end
  end
  return false
end


function export.show(frame)
function export.show(frame)
Line 71: Line 63:
local function insert_rhyme(input, pos)
local function insert_rhyme(input, pos)
local new_rhyme = m_rad_IPA.get_rhyme(input)
local new_rhyme = m_rad_IPA.get_rhyme(input)
if not (new_rhyme == nil or table.contains(rhymes, new_rhyme)) and show_rhymes then
if not (new_rhyme == nil or m_table.contains(rhymes, new_rhyme)) and show_rhymes then
if pos == nil then
if pos == nil then
table.insert(rhymes, new_rhyme)
table.insert(rhymes, new_rhyme)

Navigation menu