跳去內容

模傾偈:Yue-rom

頁面內容唔支援其他語言。
加主題
來自維基辭典
最新留言:5 年前由PQ77wd喺主題我建議修改個模,分清楚係邊度音。度留言

I created this as many people may not be familiar with New-French or easily type superscript numbers and the old template formatting seemed a bit cumbersome. If it is seen as unnecessary I do not object to its deletion. (@Cedric tsan cantonais) Suzukaze-c (talk) 08:11, 25 June 2016 (UTC)

@Suzukaze-c: I'd like to ask you to take me step-by-step through how this gadget works, since I'm not an expert in programming. Thanks. 【粵語文學大使殘陽孤侠粵維辭典起錨! 22:12, 28 June 2016 (UTC)
Asking for clarification: Do you want me to explain usage or explain its inner workings? Suzukaze-c (talk) 02:38, 29 June 2016 (UTC)
Both, please, if you would. 【粵語文學大使殘陽孤侠粵維辭典起錨! 15:17, 21 July 2016 (UTC)
  • (note: i am not good at explaining things, please excuse me)
  • The template accepts Jyutping (either with or without spaces; currently in the pages I have used yue-rom on, it has spaces), for example in 蘇州屎. The template is powered by Module:Yue-rom.
  • with spaces: {{Wt/yue/Yue-rom|sou1 zau1 si2}}
  • without spaces: {{Wt/yue/Yue-rom|sou1zau1si2}}
  • In Module:Yue-rom,
  • the function jp_to_nf() uses a series of regexes (fancy find-and-replace) to convert Jyutping to New-French Latinisation.
  • The line text = replace(text, '[1-6]', cantonese_tone_values) converts 1,2,3,4,5,6 to ꜒꜒,꜖꜒,꜔꜔,꜖꜖,꜖꜔,꜕꜕ per the Wikipedia page for NFR.
  • The line text = replace(text, '[꜒-꜖]', chao_tone_letters_to_numbers) converts ꜖,꜕,꜔,꜓,꜒ to 1,2,3,4,5 per the existing pages here.
  • The function index_link() generates the final wikitext ("廣州音", linking to 粵拼索引, etc.) In a most basic explanation, it
  • adds Jyutping/NFR index links using regexes (for example, converts jyut6 to [[:Category:Wt/yue/粵拼索引/jyut|jyut6]])
  • converts 1,2,3,4,5,6 to ¹,²,³,⁴,⁵,⁶ per the existing pages here, using more regexes (→[[:Category:Wt/yue/粵拼索引/jyut|jyut]])
  • finally adds all of this up together with the fixed text ("廣州音", etc.) to produce the final output

我建議修改個模,分清楚係邊度音。

[編輯]

因為粵語除咗係廣州、香港、澳門三地嘅音之外,最近發現咗一堆詞係出自粵西、惠州、開平、甚至連廣西嗰帶(例如北海、鬱林一帶)嘅都有。我建議將“廣州音”三字可以用開關調節,變成有類似“東莞音”、“中山音”、“開平音”、“湛江音”嗰啲。--PQ77wd (傾偈) 2019年5月3號 (五) 11:57 (UTC)回覆