Commit c6c1b2e1 authored by Dom Walden's avatar Dom Walden
Browse files

Script to generate wikitext of phonos template combinations

parent f6647cc7
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# http://www.gnu.org/copyleft/gpl.html
from itertools import product
ipa = [None, "ipa=hɛˈloʊ", "ipa="]
text = [None, "text=hello", "text="]
filep = [None, "file=Omoni_oboli.ogg", "file=Ta-ஆகுகதம்.ogg", "file=does-not-exist.ogg"]
lang = [None, "lang=fr", "lang="]
combinations = product(ipa, text, filep, lang)
for combination in combinations:
template_params = "|".join([i for i in combination if i is not None])
wikitext = "{{{{#phonos:{}}}}}".format(template_params)
header = "<code><nowiki>{}</nowiki></code>".format(wikitext)
print(header)
print("")
print(wikitext)
print("")
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# http://www.gnu.org/copyleft/gpl.html
import random
n = 5
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment