diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/cjk/utils/pyhyphen')
5 files changed, 881 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.c b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.c new file mode 100644 index 00000000000..5273fbbc03f --- /dev/null +++ b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.c @@ -0,0 +1,480 @@ +/* + + This is the file pinyin.c of the CJK macro package ver. 4.8.0 + (22-May-2008). + + Use this file to generate a hyphenation input file for patgen. + + Usage: + + pinyin > pinyin.dic + + */ + +/* + Copyright (C) 1994-2008 Werner Lemberg <wl@gnu.org> + + 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 in doc/COPYING; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + */ + +#include <stdio.h> + + +/* A list of all Chinese syllables. We use latin-1 encoding for the + `umlaut u' character. */ + +char *py[] = +{ + "a", + "ai", + "an", + "ang", + "ao", + "ba", + "bai", + "ban", + "bang", + "bao", + "bei", + "ben", + "beng", + "bi", + "bian", + "biao", + "bie", + "bin", + "bing", + "bo", + "bu", + "ca", + "cai", + "can", + "cang", + "cao", + "ce", + "cen", + "ceng", + "cha", + "chai", + "chan", + "chang", + "chao", + "che", + "chen", + "cheng", + "chi", + "chong", + "chou", + "chu", + "chuai", + "chuan", + "chuang", + "chui", + "chun", + "chuo", + "ci", + "cong", + "cou", + "cu", + "cuan", + "cui", + "cun", + "cuo", + "da", + "dai", + "dan", + "dang", + "dao", + "de", + "dei", + "deng", + "di", + "dian", + "diao", + "die", + "ding", + "diu", + "dong", + "dou", + "du", + "duan", + "dui", + "dun", + "duo", + "e", + "ei", + "en", + "eng", + "er", + "fa", + "fan", + "fang", + "fei", + "fen", + "feng", + "fiao", + "fo", + "fou", + "fu", + "ga", + "gai", + "gan", + "gang", + "gao", + "ge", + "gei", + "gen", + "geng", + "gong", + "gou", + "gu", + "gua", + "guai", + "guan", + "guang", + "gui", + "gun", + "guo", + "ha", + "hai", + "han", + "hang", + "hao", + "he", + "hei", + "hen", + "heng", + "hong", + "hou", + "hu", + "hua", + "huai", + "huan", + "huang", + "hui", + "hun", + "huo", + "ji", + "jia", + "jian", + "jiang", + "jiao", + "jie", + "jin", + "jing", + "jiong", + "jiu", + "ju", + "juan", + "jue", + "jun", + "ka", + "kai", + "kan", + "kang", + "kao", + "ke", + "kei", + "ken", + "keng", + "kong", + "kou", + "ku", + "kua", + "kuai", + "kuan", + "kuang", + "kui", + "kun", + "kuo", + "la", + "lai", + "lan", + "lang", + "lao", + "le", + "lei", + "leng", + "li", + "lia", + "lian", + "liang", + "liao", + "lie", + "lin", + "ling", + "liu", + "long", + "lou", + "lu", + "luan", + "lun", + "luo", + "lü", + "lüe", + "ma", + "mai", + "man", + "mang", + "mao", + "me", + "mei", + "men", + "meng", + "mi", + "mian", + "miao", + "mie", + "min", + "ming", + "miu", + "mo", + "mou", + "mu", + "na", + "nai", + "nan", + "nang", + "nao", + "ne", + "nei", + "nen", + "neng", + "ni", + "nian", + "niang", + "niao", + "nie", + "nin", + "ning", + "niu", + "nong", + "nou", + "nu", + "nuan", + "nuo", + "nü", + "nüe", + "o", + "ou", + "pa", + "pai", + "pan", + "pang", + "pao", + "pei", + "pen", + "peng", + "pi", + "pian", + "piao", + "pie", + "pin", + "ping", + "po", + "pou", + "pu", + "qi", + "qia", + "qian", + "qiang", + "qiao", + "qie", + "qin", + "qing", + "qiong", + "qiu", + "qu", + "quan", + "que", + "qun", + "ran", + "rang", + "rao", + "re", + "ren", + "reng", + "ri", + "rong", + "rou", + "ru", + "ruan", + "rui", + "run", + "ruo", + "sa", + "sai", + "san", + "sang", + "sao", + "se", + "sen", + "seng", + "sha", + "shai", + "shan", + "shang", + "shao", + "she", + "shei", + "shen", + "sheng", + "shi", + "shou", + "shu", + "shua", + "shuai", + "shuan", + "shuang", + "shui", + "shun", + "shuo", + "si", + "song", + "sou", + "su", + "suan", + "sui", + "sun", + "suo", + "ta", + "tai", + "tan", + "tang", + "tao", + "te", + "tei", + "teng", + "ti", + "tian", + "tiao", + "tie", + "ting", + "tong", + "tou", + "tu", + "tuan", + "tui", + "tun", + "tuo", + "wa", + "wai", + "wan", + "wang", + "wei", + "wen", + "weng", + "wo", + "wu", + "xi", + "xia", + "xian", + "xiang", + "xiao", + "xie", + "xin", + "xing", + "xiong", + "xiu", + "xu", + "xuan", + "xue", + "xun", + "ya", + "yan", + "yang", + "yao", + "ye", + "yi", + "yin", + "ying", + "yo", + "yong", + "you", + "yu", + "yuan", + "yue", + "yun", + "za", + "zai", + "zan", + "zang", + "zao", + "ze", + "zei", + "zen", + "zeng", + "zha", + "zhai", + "zhan", + "zhang", + "zhao", + "zhe", + "zhei", + "zhen", + "zheng", + "zhi", + "zhong", + "zhou", + "zhu", + "zhua", + "zhuai", + "zhuan", + "zhuang", + "zhui", + "zhun", + "zhuo", + "zi", + "zong", + "zou", + "zu", + "zuan", + "zui", + "zun", + "zuo" +}; + + +int main(void) +{ + int i, j, off; + size_t size = sizeof (py) / sizeof (char*); + char s[20]; + + /* Now we loop through all possible syllable combinations. */ + + for (i = 0; i < size; i++) + for (j = 0; j < size; j++) + { + /* The seldom used `%n' construct yields the number of processed + characters so far. */ + + sprintf(s, "%s%n%s", py[i], &off, py[j]); + + /* We check the first character of the second syllable. If it is + a vowel, a quote will be inserted. Example: Tian'anmen. */ + + if (s[off] == 'a' || s[off] == 'e' || s[off] == 'o') + printf("%s'-%s\n", py[i], py[j]); + + /* No special case. */ + + else + printf("%s-%s\n", py[i], py[j]); + } + + return 0; +} diff --git a/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.ldf b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.ldf new file mode 100644 index 00000000000..023ccefc1b8 --- /dev/null +++ b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.ldf @@ -0,0 +1,62 @@ +% This is the file pinyin.ldf of the CJK package +% for hyphenating Chinese pinyin syllables. +% +% We use the latin-1 character code for `umlaut u' (0xfc). Additionally, +% the quote character "'" is used in its standard sense (resolving syllabic +% ambiguities). +% +% created by Werner Lemberg <wl@gnu.org> +% +% Version 4.8.0 (22-May-2008) + +% Copyright (C) 1994-2008 Werner Lemberg <wl@gnu.org> +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +\ProvidesLanguage{pinyin} + [CJK 4.8.0 pinyin support for the babel system] + +\LdfInit{pinyin}{captionspinyin} + +\ifx\l@pinyin\@undefined + \@nopatterns{pinyin} + \adddialect\l@pinyin0 +\fi + +\def\pinyinhyphenmins{11} +\def\captionspinyin{} +\def\datepinyin{} + +\initiate@active@char{"} + +\addto\extraspinyin{\languageshorthands{pinyin}} +\addto\extraspinyin{\bbl@activate{"}} +\addto\extraspinyin{\babel@save\"\umlautlow} +\addto\extraspinyin{% + \babel@savevariable{\lccode"27}% + \lccode"27 "27} + +\addto\noextraspinyin{\umlauthigh} + +\declare@shorthand{pinyin}{"u}{\textormath{\"{u}}{\ddot u}} +\declare@shorthand{pinyin}{"U}{\textormath{\"{U}}{\ddot U}} + +\def\mdqon{\shorthandon{"}} +\def\mdqoff{\shorthandoff{"}} + +\ldf@finish{pinyin} + +\endinput diff --git a/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.tr b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.tr new file mode 100644 index 00000000000..ea89adb4fc6 --- /dev/null +++ b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pinyin.tr @@ -0,0 +1,52 @@ + 1 1 +%% This is the file pinyin.tr of the CJK package +%% defining the letters used for generating pinyin hyphenation patterns +%% with patgen. +% +%% created by Werner Lemberg <wl@gnu.org> +%% +%% Version 4.8.0 (22-May-2008) +%% +%% Copyright (C) 1994-2008 Werner Lemberg <wl@gnu.org> +%% +%% 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 in doc/COPYING; if not, write to the Free +%% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +%% MA 02110-1301 USA + a A + b B + c C + d D + e E + f F + g G + h H + i I + j J + k K + l L + m M + n N + o O + p P + q Q + r R + s S + t T + u U + ü Ü + w W + x X + y Y + z Z + ' diff --git a/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pyhyph.tex b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pyhyph.tex new file mode 100644 index 00000000000..93dab277d64 --- /dev/null +++ b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pyhyph.tex @@ -0,0 +1,236 @@ +% This is the file pyhyph.tex of the CJK package +% for hyphenating Chinese pinyin syllables. +% +% We use the latin-1 character code for `umlaut u' (0xfc). Additionally, +% the quote character "'" is used in its standard sense (resolving syllabic +% ambiguities). +% +% created by Werner Lemberg <wl@gnu.org> +% +% Version 4.8.0 (22-May-2008) + +% Copyright (C) 1994-2008 Werner Lemberg <wl@gnu.org> +% +% 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 in doc/COPYING; if not, write to the Free +% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +% MA 02110-1301 USA + +\message{Hyphenation patterns for unaccented pinyin syllables (CJK 4.8.0)} + +\begingroup + +\catcode"0FC = 11 % umlaut u +\catcode"027 = 11 % quote (') +\lccode"0FC = "0FC +\lccode"027 = "027 + +\patterns{ +a1b +a1c +a1d +a1f +a1g +a1h +a1j +a1k +a1l +a1m +a1p +a1q +a1r +a1s +a1t +a1w +a1x +a1y +a1z +e1b +e1c +e1d +e1f +e1g +e1h +e1j +e1k +e1l +e1m +e1p +e1q +e1s +e1t +e1w +e1x +e1y +e1z +1ga +g1b +g1c +g1d +1ge +g1f +g1g +g1h +g1j +g1k +g1l +g1m +g1n +1go +g1p +g1q +g1r +g1s +g1t +1gu +g1w +g1x +g1y +g1z +i1b +i1c +i1d +i1f +i1g +i1h +i1j +i1k +i1l +i1m +i1p +i1q +i1r +i1s +i1t +i1w +i1x +i1y +i1z +1na +n1b +n1c +n1d +1ne +n1f +n1h +1ni +n1j +n1k +n1l +n1m +n1n +1no +n1p +n1q +n1r +n1s +n1t +1nu +1n^^fc +n1w +n1x +n1y +n1z +o1b +o1c +o1d +o1f +o1g +o1h +o1j +o1k +o1l +o1m +o1p +o1q +o1r +o1s +o1t +o1w +o1x +o1y +o1z +1ra +r1b +r1c +r1d +1re +r1f +r1g +r1h +1ri +r1j +r1k +r1l +r1m +r1n +1ro +r1p +r1q +r1r +r1s +r1t +1ru +r1w +r1x +r1y +r1z +u1b +u1c +u1d +u1f +u1g +u1h +u1j +u1k +u1l +u1m +u1p +u1q +u1r +u1s +u1t +u1w +u1x +u1y +u1z +^^fc1b +^^fc1c +^^fc1d +^^fc1f +^^fc1g +^^fc1h +^^fc1j +^^fc1k +^^fc1l +^^fc1m +^^fc1n +^^fc1p +^^fc1q +^^fc1r +^^fc1s +^^fc1t +^^fc1w +^^fc1x +^^fc1y +^^fc1z +'1a +'1e +'1o +} +\endgroup + +\lefthyphenmin 1 +\righthyphenmin 1 + +\endinput diff --git a/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pytest.tex b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pytest.tex new file mode 100644 index 00000000000..3b862fcb6b2 --- /dev/null +++ b/Master/texmf-dist/source/latex/cjk/utils/pyhyphen/pytest.tex @@ -0,0 +1,51 @@ +% This is the file pytest.tex of the CJK package +% for testing Chinese pinyin hyphenation. +% +% created by Werner Lemberg <wl@gnu.org> +% +% Version 4.8.0 (22-May-2008) +% +%% +%% Attention! This will work only if you have created a new format file +%% with `pyhyph.tex' as additional hyphenation patterns for the language +%% `pinyin'. Otherwise no hyphenation will be used. +%% +% Note that the Babel package searches for `pinyin.ldf', not pinyin.sty -- +% the latter is for typesetting accented pinyin syllables. + +\documentclass[12pt,b5paper]{article} + +\usepackage[10pt]{type1ec} % use only 10pt fonts +\usepackage[T1]{fontenc} +\usepackage[pinyin]{babel} + + +\begin{document} + +% Taken from the TeXbook (p. 451) to force frequent insertion of hyphens. +\hyphenpenalty -1000 +\pretolerance -1 +\tolerance 1000 +\doublehyphendemerits -100000 +\finalhyphendemerits -100000 + +\selectlanguage{pinyin} + +Women hen xihuan l"uxing. Zai Beijing women hen xiang kan Tian'anmen. +Mingtian women xiang yao dao Xi'an qu. Xiage libai zai hui jia. +Women hen xihuan l"uxing. Zai Beijing women hen xiang kan Tian'anmen. +Mingtian women xiang yao dao Xi'an qu. Xiage libai zai hui jia. +Women hen xihuan l"uxing. Zai Beijing women hen xiang kan Tian'anmen. +Mingtian women xiang yao dao Xi'an qu. Xiage libai zai hui jia. +Women hen xihuan l"uxing. Zai Beijing women hen xiang kan Tian'anmen. +Mingtian women xiang yao dao Xi'an qu. Xiage libai zai hui jia. +Women hen xihuan l"uxing. Zai Beijing women hen xiang kan Tian'anmen. +Mingtian women xiang yao dao Xi'an qu. Xiage libai zai hui jia. +Women hen xihuan l"uxing. Zai Beijing women hen xiang kan Tian'anmen. +Mingtian women xiang yao dao Xi'an qu. Xiage libai zai hui jia. +Women hen xihuan l"uxing. Zai Beijing women hen xiang kan Tian'anmen. +Mingtian women xiang yao dao Xi'an qu. Xiage libai zai hui jia. +Women hen xihuan l"uxing. Zai Beijing women hen xiang kan Tian'anmen. +Mingtian women xiang yao dao Xi'an qu. Xiage libai zai hui jia. + +\end{document} |