diff options
author | Peng Huang <shawn.p.huang@gmail.com> | 2009-09-23 13:30:02 +0800 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2009-09-23 13:30:02 +0800 |
commit | 998c9299f04a4756ff8a08ab3448b3f7860b9fe0 (patch) | |
tree | 89a3ccd529632944e1659d7b2b01a1d5595d30c2 /data | |
parent | 9911013dd7e4edc7c295dad24121309b1fda5718 (diff) | |
download | ibus-libpinyin-998c9299f04a4756ff8a08ab3448b3f7860b9fe0.tar.gz ibus-libpinyin-998c9299f04a4756ff8a08ab3448b3f7860b9fe0.tar.xz ibus-libpinyin-998c9299f04a4756ff8a08ab3448b3f7860b9fe0.zip |
Import c version pinyin engine
Diffstat (limited to 'data')
-rw-r--r-- | data/Makefile.am | 60 | ||||
-rw-r--r-- | data/icons/Makefile.am | 37 | ||||
-rw-r--r-- | data/icons/chinese.svg | 205 | ||||
-rw-r--r-- | data/icons/english.svg | 231 | ||||
-rw-r--r-- | data/icons/full-punct.svg | 247 | ||||
-rw-r--r-- | data/icons/full.svg | 205 | ||||
-rw-r--r-- | data/icons/half-punct.svg | 230 | ||||
-rw-r--r-- | data/icons/half.svg | 117 | ||||
-rw-r--r-- | data/icons/ibus-pinyin.svg | 231 | ||||
-rw-r--r-- | data/scripts/create_db.py | 94 | ||||
-rw-r--r-- | data/scripts/create_index.py | 21 | ||||
-rw-r--r-- | data/scripts/create_unique_index.py | 27 | ||||
-rw-r--r-- | data/scripts/double.py | 38 | ||||
-rw-r--r-- | data/scripts/id.py | 1 | ||||
-rw-r--r-- | data/scripts/pydict.py | 364 | ||||
-rw-r--r-- | data/scripts/pyutil.py | 148 |
16 files changed, 2256 insertions, 0 deletions
diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..bca638d --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,60 @@ +# vim:set noet ts=4: +# +# ibus-pinyin - The Chinese PinYin engine for IBus +# +# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> +# +# 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + + +SUBDIRS = \ + icons \ + $(NULL) + +main_db_DATA = \ + db/main.db \ + db/COPYING \ + db/create_index.sql \ + $(NULL) +main_dbdir = $(pkgdatadir)/db + +install-data-hook: + @( \ +if test "$(NO_INDEX)" = ""; then \ + cd $(DESTDIR)$(main_dbdir); \ + echo "Create INDEX"; \ + sqlite3 main.db ".read create_index.sql"; \ +fi) + +DBVER = 1.2.99 +DBTAR = pinyin-database-$(DBVER).tar.bz2 + +$(DBTAR): + wget http://ibus.googlecode.com/files/$(DBTAR) + +db.stamp: $(DBTAR) + tar jxvfm $(DBTAR) + touch $@ + +$(main_db_DATA): db.stamp + +CLEANFILES = \ + db.stamp \ + db/* \ + $(NULL) + +DISTCLEANFILES = \ + $(DBTAR) \ + $(NULL) diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am new file mode 100644 index 0000000..5d59077 --- /dev/null +++ b/data/icons/Makefile.am @@ -0,0 +1,37 @@ +# vim:set noet ts=4: +# +# ibus-pinyin - The Chinese PinYin engine for IBus +# +# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library 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 Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA + +icons_DATA = \ + ibus-pinyin.svg \ + chinese.svg \ + english.svg \ + full.svg \ + full-punct.svg \ + half.svg \ + half-punct.svg \ + $(NULL) + +iconsdir = $(pkgdatadir)/icons + +EXTRA_DIST = \ + $(icons_DATA) \ + $(NULL) + diff --git a/data/icons/chinese.svg b/data/icons/chinese.svg new file mode 100644 index 0000000..aa7b61d --- /dev/null +++ b/data/icons/chinese.svg @@ -0,0 +1,205 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg2383" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="chinese.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2385"> + <linearGradient + id="linearGradient3165"> + <stop + style="stop-color:#3e9ade;stop-opacity:1;" + offset="0" + id="stop3167" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop3169" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 24 : 1" + inkscape:vp_y="6.1230318e-14 : 1000 : 0" + inkscape:vp_z="48 : 24 : 1" + inkscape:persp3d-origin="24 : 16 : 1" + id="perspective2391" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3170" + x1="9.4285707" + y1="16.928572" + x2="21.285713" + y2="16.928572" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3182" + x1="4" + y1="22.214285" + x2="24.428572" + y2="22.214285" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3209" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3213" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3220" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3226" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3231" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3234" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" + gradientTransform="matrix(0.7783402,0,0,0.8510982,20.293591,5.3791756)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3236" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3189" + x1="17.28125" + y1="29.756697" + x2="47.526787" + y2="0.7566964" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.4588402,0,0,1.4048982,-9.6613971,-9.2308213)" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7" + inkscape:cx="5.6829531" + inkscape:cy="24.785714" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1024" + inkscape:window-height="693" + inkscape:window-x="0" + inkscape:window-y="26" /> + <metadata + id="metadata2388"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + style="font-size:28px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:0.57264608;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:'微软雅黑';-inkscape-font-specification:'微软雅黑 Bold'" + d="M 23.682634,2.3965916 L 23.682634,9.201567 L 8.8206981,9.201567 L 8.8206981,30.845779 L 14.701649,30.845779 L 14.701649,28.079885 L 23.682634,28.079885 L 23.682634,40.460551 L 29.745938,40.460551 L 29.745938,28.079885 L 38.726923,28.079885 L 38.726923,30.757973 L 44.607873,30.757973 L 44.607873,9.201567 L 29.745938,9.201567 L 29.745938,2.3965916 L 23.682634,2.3965916 z M 14.701649,14.513838 L 23.682634,14.513838 L 23.682634,22.811517 L 14.701649,22.811517 L 14.701649,14.513838 z M 29.745938,14.513838 L 38.726923,14.513838 L 38.726923,22.811517 L 29.745938,22.811517 L 29.745938,14.513838 z" + id="path3252" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:#6b6b6b;fill-opacity:0.22110554;stroke:none;stroke-width:0.37799999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2390" + sodipodi:cx="25.357143" + sodipodi:cy="45.357143" + sodipodi:rx="15.642858" + sodipodi:ry="2.3571429" + d="M 41.000001,45.357143 A 15.642858,2.3571429 0 1 1 9.7142859,45.357143 A 15.642858,2.3571429 0 1 1 41.000001,45.357143 z" + transform="matrix(1.2304582,0,0,1.4687983,-6.0580467,-22.40621)" /> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:bold;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="14.428571" + y="15.714286" + id="text2387"><tspan + sodipodi:role="line" + id="tspan2389" + x="14.428571" + y="15.714286" /></text> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="17" + y="16.714287" + id="text2396"><tspan + sodipodi:role="line" + id="tspan2398" + x="17" + y="16.714287" + style="font-style:normal;font-weight:bold" /></text> + <path + style="font-size:28px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient3189);fill-opacity:1;stroke:#0066f0;stroke-width:0.57264608;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:'微软雅黑';-inkscape-font-specification:'微软雅黑 Bold'" + d="M 21.658081,0.29614445 L 21.658081,7.1011198 L 6.7961448,7.1011198 L 6.7961448,28.745332 L 12.677096,28.745332 L 12.677096,25.979438 L 21.658081,25.979438 L 21.658081,38.360104 L 27.721385,38.360104 L 27.721385,25.979438 L 36.70237,25.979438 L 36.70237,28.657526 L 42.58332,28.657526 L 42.58332,7.1011198 L 27.721385,7.1011198 L 27.721385,0.29614445 L 21.658081,0.29614445 z M 12.677096,12.413391 L 21.658081,12.413391 L 21.658081,20.71107 L 12.677096,20.71107 L 12.677096,12.413391 z M 27.721385,12.413391 L 36.70237,12.413391 L 36.70237,20.71107 L 27.721385,20.71107 L 27.721385,12.413391 z" + id="text2400" /> + </g> +</svg> diff --git a/data/icons/english.svg b/data/icons/english.svg new file mode 100644 index 0000000..4369a7f --- /dev/null +++ b/data/icons/english.svg @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg2383" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="english.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2385"> + <linearGradient + id="linearGradient3165"> + <stop + style="stop-color:#3e9ade;stop-opacity:1;" + offset="0" + id="stop3167" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop3169" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 24 : 1" + inkscape:vp_y="6.1230318e-14 : 1000 : 0" + inkscape:vp_z="48 : 24 : 1" + inkscape:persp3d-origin="24 : 16 : 1" + id="perspective2391" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3170" + x1="9.4285707" + y1="16.928572" + x2="21.285713" + y2="16.928572" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3182" + x1="4" + y1="22.214285" + x2="24.428572" + y2="22.214285" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3209" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3213" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3220" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3226" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3231" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3234" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" + gradientTransform="matrix(0.7783402,0,0,0.8510982,20.293591,5.3791756)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3236" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2404" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.4588402,0,0,1.4048982,49.195745,-11.087965)" + x1="17.28125" + y1="29.756697" + x2="47.526787" + y2="0.7566964" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3183" + x1="10.56702" + y1="37.847939" + x2="55.943497" + y2="-8.0981693" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.9452362,0,0,0.9452361,1.5728255,0.5656012)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3871" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.9452362,0,0,0.9452361,21.00127,7.1711335)" + x1="10.56702" + y1="37.847939" + x2="55.943497" + y2="-8.0981693" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7" + inkscape:cx="20.122145" + inkscape:cy="24.785714" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1024" + inkscape:window-height="695" + inkscape:window-x="0" + inkscape:window-y="25" /> + <metadata + id="metadata2388"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + transform="scale(1.0073595,0.9926943)" + style="font-size:40.23707581px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:0.54162031;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;font-family:'微软雅黑';-inkscape-font-specification:'微软雅黑 Bold'" + d="M 6.4970413,5.9663941 L 15.731136,5.9663941 L 15.731136,2.6656965 L 20.839358,2.6656965 L 20.839358,5.9663941 L 30.584275,5.9663941 L 30.584275,2.6656965 L 35.692498,2.6656965 L 35.692498,5.9663941 L 44.926592,5.9663941 L 44.926592,10.799558 L 35.692498,10.799558 L 35.692498,14.53249 L 30.584275,14.53249 L 30.584275,10.799558 L 20.839358,10.799558 L 20.839358,14.53249 L 15.731136,14.53249 L 15.731136,10.799558 L 6.4970413,10.799558 L 6.4970413,5.9663941 M 6.6149234,25.141876 L 10.858677,25.141876 L 10.858677,15.868487 L 22.725471,15.868487 L 22.725471,12.724965 L 28.462398,12.724965 L 28.462398,15.868487 L 40.525662,15.868487 L 40.525662,25.141876 L 45.123062,25.141876 L 45.123062,29.97504 L 29.582278,29.97504 C 32.791262,33.223348 37.919126,35.240439 44.965886,36.026319 L 41.036484,41.252423 C 33.911141,39.877129 28.802923,37.034864 25.711817,32.725621 C 22.869532,36.93008 17.735119,39.811639 10.308561,41.370306 C 9.234521,39.955717 7.9640157,38.331566 6.4970413,36.497847 C 14.905952,34.847499 19.739112,32.673233 20.996534,29.97504 L 6.6149234,29.97504 L 6.6149234,25.141876 M 28.246281,25.141876 L 34.828029,25.141876 L 34.828029,20.505181 L 28.462398,20.505181 C 28.462375,21.972172 28.390336,23.517735 28.246281,25.141876 M 22.489707,25.141876 C 22.646866,24.028557 22.725454,22.482994 22.725471,20.505181 L 16.55631,20.505181 L 16.55631,25.141876 L 22.489707,25.141876" + id="text3867" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:#6b6b6b;fill-opacity:0.22110554;stroke:none;stroke-width:0.37799999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2390" + sodipodi:cx="25.357143" + sodipodi:cy="45.357143" + sodipodi:rx="15.642858" + sodipodi:ry="2.3571429" + d="M 41.000001,45.357143 A 15.642858,2.3571429 0 1 1 9.7142859,45.357143 A 15.642858,2.3571429 0 1 1 41.000001,45.357143 z" + transform="matrix(1.2304582,0,0,1.4687983,-6.0580467,-22.40621)" /> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:bold;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="14.428571" + y="15.714286" + id="text2387"><tspan + sodipodi:role="line" + id="tspan2389" + x="14.428571" + y="15.714286" /></text> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="17" + y="16.714287" + id="text2396"><tspan + sodipodi:role="line" + id="tspan2398" + x="17" + y="16.714287" + style="font-style:normal;font-weight:bold" /></text> + <path + style="font-size:28px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient2404);fill-opacity:1;stroke:#0066f0;stroke-width:0.57300001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:'微软雅黑';-inkscape-font-specification:'微软雅黑 Bold'" + d="M 80.515223,-1.5609984 L 80.515223,5.2439769 L 65.653287,5.2439769 L 65.653287,26.888189 L 71.534238,26.888189 L 71.534238,24.122295 L 80.515223,24.122295 L 80.515223,36.502961 L 86.578527,36.502961 L 86.578527,24.122295 L 95.559512,24.122295 L 95.559512,26.800383 L 101.44046,26.800383 L 101.44046,5.2439769 L 86.578527,5.2439769 L 86.578527,-1.5609984 L 80.515223,-1.5609984 z M 71.534238,10.556248 L 80.515223,10.556248 L 80.515223,18.853927 L 71.534238,18.853927 L 71.534238,10.556248 z M 86.578527,10.556248 L 95.559512,10.556248 L 95.559512,18.853927 L 86.578527,18.853927 L 86.578527,10.556248 z" + id="text2400" /> + <path + transform="scale(1.0073595,0.9926943)" + style="font-size:40.23707581px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient3183);fill-opacity:1;stroke:#0066f0;stroke-width:0.54162031;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;font-family:'微软雅黑';-inkscape-font-specification:'微软雅黑 Bold'" + d="M 4.5116528,3.9659325 L 13.745747,3.9659325 L 13.745747,0.66523492 L 18.85397,0.66523492 L 18.85397,3.9659325 L 28.598887,3.9659325 L 28.598887,0.66523492 L 33.707109,0.66523492 L 33.707109,3.9659325 L 42.941204,3.9659325 L 42.941204,8.7990969 L 33.707109,8.7990969 L 33.707109,12.532029 L 28.598887,12.532029 L 28.598887,8.7990969 L 18.85397,8.7990969 L 18.85397,12.532029 L 13.745747,12.532029 L 13.745747,8.7990969 L 4.5116528,8.7990969 L 4.5116528,3.9659325 M 4.6295349,23.141414 L 8.873289,23.141414 L 8.873289,13.868025 L 20.740083,13.868025 L 20.740083,10.724504 L 26.47701,10.724504 L 26.47701,13.868025 L 38.540274,13.868025 L 38.540274,23.141414 L 43.137674,23.141414 L 43.137674,27.974578 L 27.596889,27.974578 C 30.805874,31.222887 35.933738,33.239978 42.980498,34.025857 L 39.051096,39.251962 C 31.925752,37.876667 26.817535,35.034403 23.726428,30.72516 C 20.884144,34.929619 15.74973,37.811177 8.3231727,39.369844 C 7.2491325,37.955255 5.9786272,36.331104 4.5116528,34.497386 C 12.920564,32.847038 17.753723,30.672771 19.011146,27.974578 L 4.6295349,27.974578 L 4.6295349,23.141414 M 26.260893,23.141414 L 32.842641,23.141414 L 32.842641,18.50472 L 26.47701,18.50472 C 26.476987,19.97171 26.404948,21.517274 26.260893,23.141414 M 20.504319,23.141414 C 20.661478,22.028095 20.740066,20.482532 20.740083,18.50472 L 14.570922,18.50472 L 14.570922,23.141414 L 20.504319,23.141414" + id="text2398" /> + </g> +</svg> diff --git a/data/icons/full-punct.svg b/data/icons/full-punct.svg new file mode 100644 index 0000000..2a91f19 --- /dev/null +++ b/data/icons/full-punct.svg @@ -0,0 +1,247 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg2383" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="full-punct.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2385"> + <linearGradient + id="linearGradient3165"> + <stop + style="stop-color:#3e9ade;stop-opacity:1;" + offset="0" + id="stop3167" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop3169" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 24 : 1" + inkscape:vp_y="6.1230318e-14 : 1000 : 0" + inkscape:vp_z="48 : 24 : 1" + inkscape:persp3d-origin="24 : 16 : 1" + id="perspective2391" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2385" + gradientUnits="userSpaceOnUse" + x1="15.953855" + y1="39" + x2="49.33186" + y2="7.8571429" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3170" + x1="9.4285707" + y1="16.928572" + x2="21.285713" + y2="16.928572" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3182" + x1="4" + y1="22.214285" + x2="24.428572" + y2="22.214285" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3209" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3213" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3220" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3226" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3231" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2420" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" + gradientTransform="matrix(1.160821,0,0,1.186102,-3.984461,-5.8898911)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2431" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.9582484,0,0,1.1156641,22.248867,-5.0476613)" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3215" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.133342,0,0,1.1754305,-3.455809,-5.6262736)" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2508" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.9582484,0,0,1.1156641,22.248867,-5.0476613)" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2511" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.133342,0,0,1.1754305,-3.455809,-5.6262736)" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7" + inkscape:cx="32.854222" + inkscape:cy="21.737274" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1024" + inkscape:window-height="693" + inkscape:window-x="0" + inkscape:window-y="26" /> + <metadata + id="metadata2388"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + sodipodi:type="arc" + style="opacity:1;fill:#6b6b6b;fill-opacity:0.22110554;stroke:none;stroke-width:0.37799999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2390" + sodipodi:cx="25.357143" + sodipodi:cy="45.357143" + sodipodi:rx="15.642858" + sodipodi:ry="2.3571429" + d="M 41.000001,45.357143 A 15.642858,2.3571429 0 1 1 9.7142859,45.357143 A 15.642858,2.3571429 0 1 1 41.000001,45.357143 z" + transform="matrix(1.2304582,0,0,1.4687983,-6.0580467,-22.40621)" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:url(#linearGradient2385);fill-opacity:1;stroke:#0066cc;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2393" + sodipodi:cx="25.857143" + sodipodi:cy="27.428572" + sodipodi:rx="19.857143" + sodipodi:ry="19.857143" + d="M 45.714287,27.428572 A 19.857143,19.857143 0 1 1 6,27.428572 A 19.857143,19.857143 0 1 1 45.714287,27.428572 z" + transform="translate(46.714286,-7.4285714)" /> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:bold;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="14.428571" + y="15.714286" + id="text2387"><tspan + sodipodi:role="line" + id="tspan2389" + x="14.428571" + y="15.714286" /></text> + <g + id="g2403"> + <path + id="path3203" + d="M 14.705358,10.133929 C 8.3152517,10.133929 3.1116067,15.348149 3.1116077,21.790179 C 3.1116077,28.23221 8.3152517,33.477679 14.705358,33.477679 C 21.095464,33.477679 26.267857,28.232211 26.267857,21.790179 C 26.267857,15.348148 21.095464,10.133929 14.705358,10.133929 z M 14.580358,16.071429 C 17.513589,16.071429 19.892858,18.60454 19.892858,21.727679 C 19.892858,24.850819 17.513589,27.383929 14.580358,27.383929 C 11.647127,27.383929 9.2678577,24.850818 9.2678577,21.727679 C 9.2678577,18.60454 11.647127,16.071429 14.580358,16.071429 z" + style="fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:1.1538074;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + style="fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:1.03396487;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 47.418159,21.188003 C 47.989368,26.813963 43.146748,35.256737 38.567478,38.168611 C 42.993974,26.006914 37.0701,34.180624 31.137729,29.47509 C 28.57099,26.773876 27.312371,22.779111 28.041481,18.956516 C 28.778152,14.68618 31.892215,11.214299 35.53938,10.364727 C 39.103292,9.4429903 43.053925,11.009547 45.329692,14.350571 C 46.669157,16.265501 47.426792,18.716037 47.418159,21.188003 z" + id="path3205" + sodipodi:nodetypes="ccccccc" /> + <path + id="path3174" + d="M 12.668942,8.8199629 C 6.2788357,8.8199629 1.0750471,14.053184 1.0750471,20.495215 C 1.0750471,26.937246 6.2788357,32.17047 12.668942,32.170468 C 19.059049,32.170468 24.232327,26.937245 24.232327,20.495215 C 24.232327,14.053184 19.059049,8.8199632 12.668942,8.8199629 z M 12.546901,15.0447 C 15.480132,15.0447 17.855684,17.557889 17.855684,20.681028 C 17.855685,23.804167 15.480132,26.348326 12.546901,26.348326 C 9.6136702,26.348325 7.2381175,23.804168 7.2381175,20.681028 C 7.2381176,17.557889 9.6136701,15.0447 12.546901,15.0447 z" + style="fill:url(#linearGradient2511);fill-opacity:1;stroke:#0066cc;stroke-width:1.1538074;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <path + style="fill:url(#linearGradient2508);fill-opacity:1;stroke:#0066cc;stroke-width:1.03396487;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 45.657506,19.736018 C 46.228715,25.361979 41.386095,33.804752 36.806825,36.716626 C 41.233321,24.554929 35.309447,32.728639 29.377075,28.023105 C 26.810336,25.321892 25.551718,21.327127 26.280828,17.504531 C 27.017498,13.234195 30.131562,9.7623147 33.778727,8.9127421 C 37.342639,7.9910059 41.293272,9.5575622 43.569038,12.898587 C 44.908504,14.813516 45.666139,17.264052 45.657506,19.736018 z" + id="path3211" + sodipodi:nodetypes="ccccccc" /> + </g> + </g> +</svg> diff --git a/data/icons/full.svg b/data/icons/full.svg new file mode 100644 index 0000000..9653d63 --- /dev/null +++ b/data/icons/full.svg @@ -0,0 +1,205 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg2383" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="full-letter.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2385"> + <linearGradient + id="linearGradient3165"> + <stop + style="stop-color:#3e9ade;stop-opacity:1;" + offset="0" + id="stop3167" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop3169" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 24 : 1" + inkscape:vp_y="6.1230318e-14 : 1000 : 0" + inkscape:vp_z="48 : 24 : 1" + inkscape:persp3d-origin="24 : 16 : 1" + id="perspective2391" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2385" + gradientUnits="userSpaceOnUse" + x1="15.953855" + y1="39" + x2="32.046146" + y2="9.7142849" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3170" + x1="9.4285707" + y1="16.928572" + x2="21.285713" + y2="16.928572" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3182" + x1="4" + y1="22.214285" + x2="24.428572" + y2="22.214285" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3209" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3213" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3220" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3226" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3231" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3234" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" + gradientTransform="matrix(0.7783402,0,0,0.8510982,20.293591,5.3791756)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3236" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7" + inkscape:cx="13.928571" + inkscape:cy="24.785714" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1024" + inkscape:window-height="693" + inkscape:window-x="0" + inkscape:window-y="26" /> + <metadata + id="metadata2388"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + sodipodi:type="arc" + style="opacity:1;fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2396" + sodipodi:cx="25.857143" + sodipodi:cy="27.428572" + sodipodi:rx="19.857143" + sodipodi:ry="19.857143" + d="M 45.714287,27.428572 A 19.857143,19.857143 0 1 1 6,27.428572 A 19.857143,19.857143 0 1 1 45.714287,27.428572 z" + transform="matrix(0.999994,3.4601868e-3,-3.4601868e-3,0.999994,0.809348,-6.3750209)" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:#6b6b6b;fill-opacity:0.22110554;stroke:none;stroke-width:0.37799999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2390" + sodipodi:cx="25.357143" + sodipodi:cy="45.357143" + sodipodi:rx="15.642858" + sodipodi:ry="2.3571429" + d="M 41.000001,45.357143 A 15.642858,2.3571429 0 1 1 9.7142859,45.357143 A 15.642858,2.3571429 0 1 1 41.000001,45.357143 z" + transform="matrix(1.2304582,0,0,1.4687983,-6.0580467,-22.40621)" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:url(#linearGradient2385);fill-opacity:1;stroke:#0066cc;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2393" + sodipodi:cx="25.857143" + sodipodi:cy="27.428572" + sodipodi:rx="19.857143" + sodipodi:ry="19.857143" + d="M 45.714287,27.428572 A 19.857143,19.857143 0 1 1 6,27.428572 A 19.857143,19.857143 0 1 1 45.714287,27.428572 z" + transform="translate(-1.5714283,-7.4285714)" /> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:bold;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="14.428571" + y="15.714286" + id="text2387"><tspan + sodipodi:role="line" + id="tspan2389" + x="14.428571" + y="15.714286" /></text> + </g> +</svg> diff --git a/data/icons/half-punct.svg b/data/icons/half-punct.svg new file mode 100644 index 0000000..41fae25 --- /dev/null +++ b/data/icons/half-punct.svg @@ -0,0 +1,230 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg2383" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="half-punct.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2385"> + <linearGradient + id="linearGradient3165"> + <stop + style="stop-color:#3e9ade;stop-opacity:1;" + offset="0" + id="stop3167" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop3169" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 24 : 1" + inkscape:vp_y="6.1230318e-14 : 1000 : 0" + inkscape:vp_z="48 : 24 : 1" + inkscape:persp3d-origin="24 : 16 : 1" + id="perspective2391" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2385" + gradientUnits="userSpaceOnUse" + x1="15.953855" + y1="39" + x2="49.33186" + y2="7.8571429" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3170" + x1="9.4285707" + y1="16.928572" + x2="21.285713" + y2="16.928572" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3182" + x1="4" + y1="22.214285" + x2="24.428572" + y2="22.214285" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3209" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3213" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3220" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3226" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3231" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3236" + gradientUnits="userSpaceOnUse" + x1="8.0571585" + y1="29.180281" + x2="19.376543" + y2="12.757439" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2410" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.7783402,0,0,0.8510982,24.579305,3.5220328)" + x1="9.8733034" + y1="29.599701" + x2="18.188185" + y2="12.646814" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7" + inkscape:cx="43.751726" + inkscape:cy="24.785714" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1024" + inkscape:window-height="693" + inkscape:window-x="0" + inkscape:window-y="26" /> + <metadata + id="metadata2388"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + transform="matrix(0.9205606,0,0,0.8966918,3.3604648,4.5457974)" + sodipodi:type="arc" + style="fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2399" + sodipodi:cx="14.214286" + sodipodi:cy="22.214285" + sodipodi:rx="10.214286" + sodipodi:ry="9.9285717" + d="M 24.428572,22.214285 A 10.214286,9.9285717 0 1 1 4,22.214285 A 10.214286,9.9285717 0 1 1 24.428572,22.214285 z" /> + <a + id="a2401" + transform="translate(5.9455758,-0.3919766)" + style="fill:#000066;fill-opacity:1;stroke:#000066;stroke-opacity:1"> + <path + style="fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:0.81390661;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 39.307331,24.285714 C 39.771297,28.577548 35.837864,35.018223 32.118338,37.239582 C 35.713773,27.96188 30.902088,34.197297 26.083501,30.607621 C 23.998659,28.546967 22.976342,25.499511 23.568564,22.583396 C 24.166927,19.325717 26.696335,16.67715 29.658756,16.029043 C 32.553554,15.325885 35.762468,16.520952 37.610967,19.069694 C 38.698952,20.530522 39.314343,22.399944 39.307331,24.285714 z" + id="path2403" + sodipodi:nodetypes="ccccccc" /> + </a> + <path + sodipodi:type="arc" + style="opacity:1;fill:#6b6b6b;fill-opacity:0.22110554;stroke:none;stroke-width:0.37799999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2390" + sodipodi:cx="25.357143" + sodipodi:cy="45.357143" + sodipodi:rx="15.642858" + sodipodi:ry="2.3571429" + d="M 41.000001,45.357143 A 15.642858,2.3571429 0 1 1 9.7142859,45.357143 A 15.642858,2.3571429 0 1 1 41.000001,45.357143 z" + transform="matrix(1.2304582,0,0,1.4687983,-6.0580467,-22.40621)" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:url(#linearGradient2385);fill-opacity:1;stroke:#0066cc;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2393" + sodipodi:cx="25.857143" + sodipodi:cy="27.428572" + sodipodi:rx="19.857143" + sodipodi:ry="19.857143" + d="M 45.714287,27.428572 A 19.857143,19.857143 0 1 1 6,27.428572 A 19.857143,19.857143 0 1 1 45.714287,27.428572 z" + transform="translate(46.714286,-7.4285714)" /> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:bold;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="14.428571" + y="15.714286" + id="text2387"><tspan + sodipodi:role="line" + id="tspan2389" + x="14.428571" + y="15.714286" /></text> + <path + transform="matrix(0.9205606,0,0,0.8966918,1.700603,3.0806313)" + sodipodi:type="arc" + style="fill:url(#linearGradient3236);fill-opacity:1;stroke:#0066cc;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path3174" + sodipodi:cx="14.214286" + sodipodi:cy="22.214285" + sodipodi:rx="10.214286" + sodipodi:ry="9.9285717" + d="M 24.428572,22.214285 A 10.214286,9.9285717 0 1 1 4,22.214285 A 10.214286,9.9285717 0 1 1 24.428572,22.214285 z" /> + <path + sodipodi:nodetypes="ccccccc" + id="path3211" + d="M 43.593045,22.428571 C 44.057011,26.720405 40.123578,33.16108 36.404052,35.382439 C 39.999487,26.104737 35.187802,32.340154 30.369215,28.750478 C 28.284373,26.689824 27.262056,23.642368 27.854278,20.726253 C 28.452641,17.468574 30.982049,14.820007 33.94447,14.1719 C 36.839268,13.468742 40.048182,14.663809 41.896681,17.212551 C 42.984666,18.673379 43.600057,20.542801 43.593045,22.428571 z" + style="fill:url(#linearGradient2410);fill-opacity:1;stroke:#0066cc;stroke-width:0.81390660999999986;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + </g> +</svg> diff --git a/data/icons/half.svg b/data/icons/half.svg new file mode 100644 index 0000000..362793e --- /dev/null +++ b/data/icons/half.svg @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg2383" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="half-letter.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2385"> + <linearGradient + id="linearGradient3165"> + <stop + style="stop-color:#3e9ade;stop-opacity:1;" + offset="0" + id="stop3167" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop3169" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 24 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="48 : 24 : 1" + inkscape:persp3d-origin="24 : 16 : 1" + id="perspective2391" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3179" + x1="32.734177" + y1="13.687543" + x2="16.494907" + y2="44.930676" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7" + inkscape:cx="33.12666" + inkscape:cy="24" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1024" + inkscape:window-height="693" + inkscape:window-x="0" + inkscape:window-y="26" /> + <metadata + id="metadata2388"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + sodipodi:type="arc" + style="opacity:1;fill:#6b6b6b;fill-opacity:0.22110554;stroke:none;stroke-width:0.37799999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2390" + sodipodi:cx="25.357143" + sodipodi:cy="45.357143" + sodipodi:rx="15.642858" + sodipodi:ry="2.3571429" + d="M 41.000001,45.357143 A 15.642858,2.3571429 0 1 1 9.7142859,45.357143 A 15.642858,2.3571429 0 1 1 41.000001,45.357143 z" + transform="matrix(-1.2395906,0,0,1.4687983,55.558919,-22.406211)" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:0.99999994000000003;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path3236" + sodipodi:cx="25.857143" + sodipodi:cy="27.428572" + sodipodi:rx="19.857143" + sodipodi:ry="19.857143" + d="M 38.380563,42.838637 A 19.857143,19.857143 0 1 1 38.380563,12.018507 L 25.857143,27.428572 z" + transform="matrix(-0.9998878,1.4982287e-2,-1.4982287e-2,-0.9998878,50.428569,48.293688)" + sodipodi:start="0.88837259" + sodipodi:end="5.3948127" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:url(#linearGradient3179);fill-opacity:1;stroke:#0066cc;stroke-width:0.99999996000000002;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2393" + sodipodi:cx="25.857143" + sodipodi:cy="27.428572" + sodipodi:rx="19.857143" + sodipodi:ry="19.857143" + d="M 38.380563,42.838637 A 19.857143,19.857143 0 1 1 38.380563,12.018507 L 25.857143,27.428572 z" + transform="matrix(-0.9998878,1.4982287e-2,-1.4982287e-2,-0.9998878,47.219387,47.461493)" + sodipodi:start="0.88837259" + sodipodi:end="5.3948127" /> + </g> +</svg> diff --git a/data/icons/ibus-pinyin.svg b/data/icons/ibus-pinyin.svg new file mode 100644 index 0000000..1582c0d --- /dev/null +++ b/data/icons/ibus-pinyin.svg @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg2383" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="ibus-pinyin.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2385"> + <linearGradient + id="linearGradient3165"> + <stop + style="stop-color:#3e9ade;stop-opacity:1;" + offset="0" + id="stop3167" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop3169" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 24 : 1" + inkscape:vp_y="6.1230318e-14 : 1000 : 0" + inkscape:vp_z="48 : 24 : 1" + inkscape:persp3d-origin="24 : 16 : 1" + id="perspective2391" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3170" + x1="9.4285707" + y1="16.928572" + x2="21.285713" + y2="16.928572" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3182" + x1="4" + y1="22.214285" + x2="24.428572" + y2="22.214285" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3209" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3213" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3220" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3226" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3231" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3234" + gradientUnits="userSpaceOnUse" + x1="8.4049778" + y1="28.256899" + x2="23.510868" + y2="13.821767" + gradientTransform="matrix(0.7783402,0,0,0.8510982,20.293591,5.3791756)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3236" + gradientUnits="userSpaceOnUse" + x1="7.746789" + y1="27.427807" + x2="22.480242" + y2="13.872649" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient2404" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.4588402,0,0,1.4048982,38.195745,-11.087965)" + x1="17.28125" + y1="29.756697" + x2="47.526787" + y2="0.7566964" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient3183" + x1="10.56702" + y1="37.847939" + x2="55.943497" + y2="-8.0981693" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.9452362,0,0,0.9452361,1.5728255,0.5656012)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3165" + id="linearGradient5069" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.9452362,0,0,0.9452361,4.0622424,2.958493)" + x1="10.56702" + y1="37.847939" + x2="55.943497" + y2="-8.0981693" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7" + inkscape:cx="20.122145" + inkscape:cy="24.785714" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="1024" + inkscape:window-height="695" + inkscape:window-x="0" + inkscape:window-y="25" /> + <metadata + id="metadata2388"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <path + transform="scale(1.0073595,0.9926943)" + style="font-size:40.23707581px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000066;fill-opacity:1;stroke:#000066;stroke-width:0.54162031;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;font-family:'微软雅黑';-inkscape-font-specification:'微软雅黑 Bold'" + d="M 20.400329,22.783727 L 24.506554,22.783727 L 24.644083,14.924924 L 21.736326,14.924924 L 21.736326,10.052465 L 26.589137,10.052465 C 25.672257,8.6510062 24.513085,7.013757 23.111617,5.1407127 L 27.276783,2.7437775 C 28.900913,4.5513342 30.2893,6.3064654 31.441949,8.0091761 L 28.043016,10.052465 L 37.178876,10.052465 L 34.506882,8.3628223 C 35.921437,6.6077192 37.27053,4.7347062 38.554166,2.7437775 L 42.955096,5.2978888 C 41.763142,6.961365 40.53848,8.5462222 39.281106,10.052465 L 44.605445,10.052465 L 44.605445,14.924924 L 40.911807,14.924924 L 40.911807,22.783727 L 45.705678,22.783727 L 45.705678,27.656186 L 40.911807,27.656186 L 40.911807,41.566269 L 35.646409,41.566269 L 35.646409,27.656186 L 29.339719,27.656186 C 28.540718,33.393116 26.608764,38.226275 23.543851,42.155679 C 22.338818,40.898266 20.884941,39.522976 19.182215,38.029807 C 21.644624,35.187541 23.255678,31.72967 24.015379,27.656186 L 20.400329,27.656186 L 20.400329,22.783727 M 29.870188,14.924924 L 29.732659,22.783727 L 35.646409,22.783727 L 35.646409,14.924924 L 29.870188,14.924924 M 6.9617747,9.9738771 L 11.205529,9.9738771 L 11.205529,3.2153057 L 16.353045,3.2153057 L 16.353045,9.9738771 L 20.007389,9.9738771 L 20.007389,14.885629 L 16.353045,14.885629 L 16.353045,20.917261 L 19.968095,20.229616 C 19.732317,21.958567 19.562043,23.726797 19.457273,25.534309 L 16.353045,26.084425 L 16.353045,36.261576 C 16.353035,37.859531 16.012487,39.071096 15.331401,39.896273 C 14.663394,40.721443 13.681044,41.166775 12.384349,41.232269 C 11.10074,41.310853 9.6337645,41.369794 7.9834192,41.409093 C 7.7476534,39.88972 7.3809096,38.134589 6.8831866,36.143694 C 7.8786333,36.248478 8.8871788,36.30087 9.9088261,36.30087 C 10.747094,36.30087 11.179328,35.737656 11.205529,34.611227 L 11.205529,27.125717 L 7.0796567,28.049126 L 6.7653046,22.430081 C 8.2453772,22.233625 9.7254504,22.017508 11.205529,21.78173 L 11.205529,14.885629 L 6.9617747,14.885629 L 6.9617747,9.9738771" + id="text5065" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:#6b6b6b;fill-opacity:0.22110554;stroke:none;stroke-width:0.37799999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="path2390" + sodipodi:cx="25.357143" + sodipodi:cy="45.357143" + sodipodi:rx="15.642858" + sodipodi:ry="2.3571429" + d="M 41.000001,45.357143 A 15.642858,2.3571429 0 1 1 9.7142859,45.357143 A 15.642858,2.3571429 0 1 1 41.000001,45.357143 z" + transform="matrix(1.2304582,0,0,1.4687983,-6.0580467,-22.40621)" /> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:bold;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="14.428571" + y="15.714286" + id="text2387"><tspan + sodipodi:role="line" + id="tspan2389" + x="14.428571" + y="15.714286" /></text> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="17" + y="16.714287" + id="text2396"><tspan + sodipodi:role="line" + id="tspan2398" + x="17" + y="16.714287" + style="font-style:normal;font-weight:bold" /></text> + <path + style="font-size:28px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient2404);fill-opacity:1;stroke:#0066f0;stroke-width:0.57300001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:'微软雅黑';-inkscape-font-specification:'微软雅黑 Bold'" + d="M 69.515223,-1.5609984 L 69.515223,5.2439769 L 54.653287,5.2439769 L 54.653287,26.888189 L 60.534238,26.888189 L 60.534238,24.122295 L 69.515223,24.122295 L 69.515223,36.502961 L 75.578527,36.502961 L 75.578527,24.122295 L 84.559512,24.122295 L 84.559512,26.800383 L 90.440462,26.800383 L 90.440462,5.2439769 L 75.578527,5.2439769 L 75.578527,-1.5609984 L 69.515223,-1.5609984 z M 60.534238,10.556248 L 69.515223,10.556248 L 69.515223,18.853927 L 60.534238,18.853927 L 60.534238,10.556248 z M 75.578527,10.556248 L 84.559512,10.556248 L 84.559512,18.853927 L 75.578527,18.853927 L 75.578527,10.556248 z" + id="text2400" /> + <path + transform="scale(1.0073595,0.9926943)" + style="font-size:40.23707581px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient3183);fill-opacity:1;stroke:#0066f0;stroke-width:0.54162031;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;font-family:'微软雅黑';-inkscape-font-specification:'微软雅黑 Bold'" + d="M 17.910913,20.390833 L 22.017138,20.390833 L 22.154667,12.532029 L 19.24691,12.532029 L 19.24691,7.6595704 L 24.099721,7.6595704 C 23.182841,6.2581114 22.023669,4.6208622 20.622201,2.7478179 L 24.787367,0.35088276 C 26.411497,2.1584395 27.799884,3.9135706 28.952533,5.6162814 L 25.5536,7.6595704 L 34.68946,7.6595704 L 32.017466,5.9699275 C 33.432021,4.2148245 34.781115,2.3418114 36.06475,0.35088276 L 40.465681,2.904994 C 39.273726,4.5684703 38.049064,6.1533275 36.79169,7.6595704 L 42.116029,7.6595704 L 42.116029,12.532029 L 38.422392,12.532029 L 38.422392,20.390833 L 43.216262,20.390833 L 43.216262,25.263291 L 38.422392,25.263291 L 38.422392,39.173374 L 33.156993,39.173374 L 33.156993,25.263291 L 26.850303,25.263291 C 26.051302,31.000221 24.119348,35.83338 21.054435,39.762784 C 19.849402,38.505371 18.395525,37.130082 16.692799,35.636912 C 19.155208,32.794646 20.766262,29.336776 21.525963,25.263291 L 17.910913,25.263291 L 17.910913,20.390833 M 27.380772,12.532029 L 27.243243,20.390833 L 33.156993,20.390833 L 33.156993,12.532029 L 27.380772,12.532029 M 4.4723588,7.5809823 L 8.7161129,7.5809823 L 8.7161129,0.82241099 L 13.863629,0.82241099 L 13.863629,7.5809823 L 17.517973,7.5809823 L 17.517973,12.492735 L 13.863629,12.492735 L 13.863629,18.524367 L 17.478679,17.836721 C 17.242901,19.565673 17.072628,21.333902 16.967857,23.141414 L 13.863629,23.69153 L 13.863629,33.868681 C 13.863619,35.466637 13.523071,36.678201 12.841985,37.503378 C 12.173978,38.328548 11.191629,38.77388 9.8949335,38.839375 C 8.6113238,38.917958 7.1443486,38.976899 5.4940033,39.016198 C 5.2582375,37.496826 4.8914937,35.741694 4.3937708,33.750799 C 5.3892175,33.855583 6.397763,33.907975 7.4194102,33.907975 C 8.257678,33.907975 8.6899118,33.344762 8.7161129,32.218332 L 8.7161129,24.732822 L 4.5902409,25.656231 L 4.2758887,20.037186 C 5.7559613,19.840731 7.2360345,19.624614 8.7161129,19.388835 L 8.7161129,12.492735 L 4.4723588,12.492735 L 4.4723588,7.5809823" + id="text2398" /> + </g> +</svg> diff --git a/data/scripts/create_db.py b/data/scripts/create_db.py new file mode 100644 index 0000000..e4826ae --- /dev/null +++ b/data/scripts/create_db.py @@ -0,0 +1,94 @@ +import sqlite3 +from pydict import * +from id import * +import sys + +con1 = sqlite3.connect("py.db") +con2 = sqlite3.connect("py-new.db") +con2.execute ("PRAGMA synchronous = NORMAL;") +con2.execute ("PRAGMA temp_store = MEMORY;") +con2.execute ("PRAGMA default_cache_size = 5000;") + +sql = "CREATE TABLE py_phrase_%d (phrase TEXT, freq INTEGER, %s)" + +for i in range(0, 16): + column= [] + for j in range(0, i + 1): + column.append ("s%d INTEGER" % j) + column.append ("y%d INTEGER" % j) + column = ",".join(column) + con2.execute(sql % (i, column)) +con2.commit() + +def get_sheng_yun(pinyin): + if pinyin == None: + return None, None + if pinyin == "ng": + return "", "en" + for i in xrange(2, 0, -1): + t = pinyin[:i] + if t in SHENGMU_DICT: + return t, pinyin[len(t):] + return "", pinyin + +def encode_pinyin(pinyin): + if pinyin == None or pinyin == "": + return 0 + return pinyin_id[pinyin] + e = 0 + for c in pinyin: + e = (e << 5) + (ord(c) - ord('a') + 1) + return e + +insert_sql = "INSERT INTO py_phrase_%d VALUES (%s);" +con2.commit() +new_freq = 0 +freq = 0 + +print "INSERTING" +for r in con1.execute("SELECT * FROM py_phrase ORDER BY freq"): + ylen = r[0] + phrase = r[10] + if r[11] > freq: + freq = r[11] + new_freq += 1 + + if ylen <= 4: + pys = map(lambda id: ID_PINYIN_DICT[id], r[1: 1 + ylen]) + else: + pys = map(lambda id: ID_PINYIN_DICT[id], r[1: 5]) + r[5].encode("utf8").split("'") + + i = ylen - 1 + if i >= 15: + i = 15 + + pys = pys[0:16] + + sheng_yun = [] + for s, y in map(get_sheng_yun, pys): + sheng_yun.append(s) + sheng_yun.append(y) + + + column = [phrase, new_freq] + map(encode_pinyin, sheng_yun) + + sql = insert_sql % (i, ",".join(["?"] * len(column))) + con2.execute (sql, column) + +print "Remove duplicate" +for i in xrange(0, 16): + sql = "DELETE FROM py_phrase_%d WHERE rowid IN (SELECT rowid FROM (SELECT count() as count, rowid FROM py_phrase_%d GROUP by %s,phrase) WHERE count > 1)" % (i, i, ",".join(map(lambda i: "s%d,y%d"%(i,i), range(0, i + 1)))) + con2.execute(sql) +con2.commit() +print "CACUUM" +con2.execute("VACUUM;") +con2.commit() + +# con2.execute("create index index_0_0 on py_phrase_0(s0, y0)") +# +# for i in xrange(1, 16): +# con2.execute("create index index_%d_0 on py_phrase_%d(s0, y0, s1, y1)" % (i, i)) +# con2.execute("create index index_%d_1 on py_phrase_%d(s0, s1, y1)" % (i, i)) +# +# con2.execute("vacuum") +# con2.commit() diff --git a/data/scripts/create_index.py b/data/scripts/create_index.py new file mode 100644 index 0000000..823e616 --- /dev/null +++ b/data/scripts/create_index.py @@ -0,0 +1,21 @@ +import sqlite3 + +con2 = sqlite3.connect("py-new.db") +con2.execute ("PRAGMA synchronous = NORMAL;") +con2.execute ("PRAGMA temp_store = MEMORY;") + + +con2.execute("CREATE INDEX index_0_0 ON py_phrase_0(s0, y0)") +print "py_phrase_%d done" % 0 + +con2.execute("CREATE INDEX index_1_0 ON py_phrase_1(s0, y0, s1, y1)") +con2.execute("CREATE INDEX index_1_1 ON py_phrase_1(s0, s1, y1)") +print "py_phrase_%d done" % 1 + +for i in xrange(2, 16): + con2.execute("CREATE INDEX index_%d_0 ON py_phrase_%d(s0, y0, s1, y1, s2, y2)" % (i, i)) + con2.execute("CREATE INDEX index_%d_1 ON py_phrase_%d(s0, s1, s2, y2)" % (i, i)) + print "py_phrase_%d done" % i + +# con2.execute("vacuum") +con2.commit() diff --git a/data/scripts/create_unique_index.py b/data/scripts/create_unique_index.py new file mode 100644 index 0000000..e22d986 --- /dev/null +++ b/data/scripts/create_unique_index.py @@ -0,0 +1,27 @@ +import sqlite3 + +con2 = sqlite3.connect("py-new.db") +con2.execute ("PRAGMA synchronous = NORMAL;") +con2.execute ("PRAGMA temp_store = MEMORY;") + + +con2.execute("CREATE UNIQUE INDEX IF NOT EXISTS index_0_0 ON py_phrase_0(s0, y0, phrase)") +print "py_phrase_%d done" % 0 + +con2.execute("CREATE UNIQUE INDEX IF NOT EXISTS index_1_0 ON py_phrase_1(s0, y0, s1, y1, phrase)") +con2.execute("CREATE INDEX IF NOT EXISTS index_1_1 ON py_phrase_1(s0, s1, y1)") +print "py_phrase_%d done" % 1 + +for i in xrange(2, 16): + sql = "CREATE UNIQUE INDEX IF NOT EXISTS index_%d_0 ON py_phrase_%d (" % (i, i) + sql = sql + "s0,y0" + for j in xrange(1, i + 1): + sql = sql + ",s%d,y%d" % (j, j) + sql = sql + ", phrase)" + print sql + con2.execute(sql) + con2.execute("CREATE INDEX IF NOT EXISTS index_%d_1 ON py_phrase_%d(s0, s1, s2, y2)" % (i, i)) + print "py_phrase_%d done" % i + +# con2.execute("vacuum") +con2.commit() diff --git a/data/scripts/double.py b/data/scripts/double.py new file mode 100644 index 0000000..1ee8359 --- /dev/null +++ b/data/scripts/double.py @@ -0,0 +1,38 @@ +import pydict + +for name, (sheng, yun) in pydict.SHUANGPIN_SCHEMAS.items(): + print "static const gint double_pinyin_%s_sheng[] = {" % name.lower() + for c in "abcdefghijklmnopqrstuvwxyz;": + s = sheng.get(c, "VOID") + if s == "'": + s = "ZERO" + else: + s = s.upper() + print " PINYIN_ID_%s // %s" % ((s + ",").ljust(5), c.upper()) + print "};" + + print "static const gint double_pinyin_%s_yun[][2] = {" % name.lower() + for c in "abcdefghijklmnopqrstuvwxyz;": + s = yun.get(c, ("VOID", "VOID")) + if len(s) == 1: + s1 = s[0] + s2 = "VOID" + else: + s1, s2 = s + if s1 == "'": + s1 = "ZERO" + if s2 == "'": + s2 = "ZERO" + s1 = s1.upper() + s2 = s2.upper() + print " { PINYIN_ID_%s PINYIN_ID_%s }, // %s" % ((s1 + ",").ljust(5), s2.ljust(4), c.upper()) + print "};" + +print ''' +static const struct { + const gint (&sheng)[27]; + const gint (&yun)[27][2]; +} double_pinyin_map [] = {''' +for name, (sheng, yun) in pydict.SHUANGPIN_SCHEMAS.items(): + print " { double_pinyin_%s_sheng, double_pinyin_%s_yun}," % (name.lower(), name.lower()) +print "};" diff --git a/data/scripts/id.py b/data/scripts/id.py new file mode 100644 index 0000000..44bd80c --- /dev/null +++ b/data/scripts/id.py @@ -0,0 +1 @@ +pinyin_id = {'ch': 3, 'zh': 23, 'ai': 25, 'uan': 50, 'iu': 43, 'ong': 45, 'ao': 28, 'an': 26, 'uai': 49, 'ang': 27, 'iong': 42, 'in': 40, 'ia': 35, 'ei': 30, 'ing': 41, 'ie': 39, 'er': 33, 'iao': 38, 'ian': 36, 'eng': 32, 'iang': 37, 'uo': 55, 'r': 15, 'en': 31, 'ui': 53, 'un': 54, 'ue': 52, 'uang': 51, 'a': 24, 'c': 2, 'b': 1, 'e': 29, 'd': 4, 'g': 6, 'f': 5, 'i': 34, 'h': 7, 'k': 9, 'j': 8, 'm': 11, 'l': 10, 'o': 44, 'n': 12, 'q': 14, 'p': 13, 's': 16, 'sh': 17, 'u': 47, 't': 18, 'w': 19, 'v': 56, 'y': 21, 'x': 20, 'ou': 46, 'z': 22, 'ua': 48} diff --git a/data/scripts/pydict.py b/data/scripts/pydict.py new file mode 100644 index 0000000..4646477 --- /dev/null +++ b/data/scripts/pydict.py @@ -0,0 +1,364 @@ +# -*- coding: utf-8 -*- +# vim:set et sts=4 sw=4: +# +# ibus-pinyin - The PinYin engine for IBus +# +# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> +# +# 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +N_ = lambda x : x +PINYIN_DICT = { + "a" : 1, "ai" : 2, "an" : 3, "ang" : 4, "ao" : 5, + "ba" : 6, "bai" : 7, "ban" : 8, "bang" : 9, "bao" : 10, + "bei" : 11, "ben" : 12, "beng" : 13, "bi" : 14, "bian" : 15, + "biao" : 16, "bie" : 17, "bin" : 18, "bing" : 19, "bo" : 20, + "bu" : 21, "ca" : 22, "cai" : 23, "can" : 24, "cang" : 25, + "cao" : 26, "ce" : 27, "cen" : 28, "ceng" : 29, "ci" : 30, + "cong" : 31, "cou" : 32, "cu" : 33, "cuan" : 34, "cui" : 35, + "cun" : 36, "cuo" : 37, "cha" : 38, "chai" : 39, "chan" : 40, + "chang" : 41, "chao" : 42, "che" : 43, "chen" : 44, "cheng" : 45, + "chi" : 46, "chong" : 47, "chou" : 48, "chu" : 49, "chuai" : 50, + "chuan" : 51, "chuang" : 52, "chui" : 53, "chun" : 54, "chuo" : 55, + "da" : 56, "dai" : 57, "dan" : 58, "dang" : 59, "dao" : 60, + "de" : 61, "dei" : 62, + # "den" : 63, + "deng" : 64, "di" : 65, + "dia" : 66, "dian" : 67, "diao" : 68, "die" : 69, "ding" : 70, + "diu" : 71, "dong" : 72, "dou" : 73, "du" : 74, "duan" : 75, + "dui" : 76, "dun" : 77, "duo" : 78, "e" : 79, "ei" : 80, + "en" : 81, "er" : 82, "fa" : 83, "fan" : 84, "fang" : 85, + "fei" : 86, "fen" : 87, "feng" : 88, "fo" : 89, "fou" : 90, + "fu" : 91, "ga" : 92, "gai" : 93, "gan" : 94, "gang" : 95, + "gao" : 96, "ge" : 97, "gei" : 98, "gen" : 99, "geng" : 100, + "gong" : 101, "gou" : 102, "gu" : 103, "gua" : 104, "guai" : 105, + "guan" : 106, "guang" : 107, "gui" : 108, "gun" : 109, "guo" : 110, + "ha" : 111, "hai" : 112, "han" : 113, "hang" : 114, "hao" : 115, + "he" : 116, "hei" : 117, "hen" : 118, "heng" : 119, "hong" : 120, + "hou" : 121, "hu" : 122, "hua" : 123, "huai" : 124, "huan" : 125, + "huang" : 126, "hui" : 127, "hun" : 128, "huo" : 129, "ji" : 130, + "jia" : 131, "jian" : 132, "jiang" : 133, "jiao" : 134, "jie" : 135, + "jin" : 136, "jing" : 137, "jiong" : 138, "jiu" : 139, "ju" : 140, + "juan" : 141, "jue" : 142, "jun" : 143, "ka" : 144, "kai" : 145, + "kan" : 146, "kang" : 147, "kao" : 148, "ke" : 149, + # "kei" : 150, + "ken" : 151, "keng" : 152, "kong" : 153, "kou" : 154, "ku" : 155, + "kua" : 156, "kuai" : 157, "kuan" : 158, "kuang" : 159, "kui" : 160, + "kun" : 161, "kuo" : 162, "la" : 163, "lai" : 164, "lan" : 165, + "lang" : 166, "lao" : 167, "le" : 168, "lei" : 169, "leng" : 170, + "li" : 171, "lia" : 172, "lian" : 173, "liang" : 174, "liao" : 175, + "lie" : 176, "lin" : 177, "ling" : 178, "liu" : 179, + "lo" : 180, + "long" : 181, "lou" : 182, "lu" : 183, "luan" : 184, "lue" : 185, + "lun" : 186, "luo" : 187, "lv" : 188, "lve" : 189, "ma" : 190, + "mai" : 191, "man" : 192, "mang" : 193, "mao" : 194, "me" : 195, + "mei" : 196, "men" : 197, "meng" : 198, "mi" : 199, "mian" : 200, + "miao" : 201, "mie" : 202, "min" : 203, "ming" : 204, "miu" : 205, + "mo" : 206, "mou" : 207, "mu" : 208, "na" : 209, "nai" : 210, + "nan" : 211, "nang" : 212, "nao" : 213, "ne" : 214, "nei" : 215, + "nen" : 216, "neng" : 217, "ni" : 218, "nian" : 219, "niang" : 220, + "niao" : 221, "nie" : 222, "nin" : 223, "ning" : 224, "niu" : 225, + "ng" : 226, "nong" : 227, "nou" : 228, "nu" : 229, "nuan" : 230, + "nue" : 231, "nuo" : 232, "nv" : 233, "nve" : 234, "o" : 235, + "ou" : 236, "pa" : 237, "pai" : 238, "pan" : 239, "pang" : 240, + "pao" : 241, "pei" : 242, "pen" : 243, "peng" : 244, "pi" : 245, + "pian" : 246, "piao" : 247, "pie" : 248, "pin" : 249, "ping" : 250, + "po" : 251, "pou" : 252, "pu" : 253, "qi" : 254, "qia" : 255, + "qian" : 256, "qiang" : 257, "qiao" : 258, "qie" : 259, "qin" : 260, + "qing" : 261, "qiong" : 262, "qiu" : 263, "qu" : 264, "quan" : 265, + "que" : 266, "qun" : 267, "ran" : 268, "rang" : 269, "rao" : 270, + "re" : 271, "ren" : 272, "reng" : 273, "ri" : 274, "rong" : 275, + "rou" : 276, "ru" : 277, "ruan" : 278, "rui" : 279, "run" : 280, + "ruo" : 281, "sa" : 282, "sai" : 283, "san" : 284, "sang" : 285, + "sao" : 286, "se" : 287, "sen" : 288, "seng" : 289, "si" : 290, + "song" : 291, "sou" : 292, "su" : 293, "suan" : 294, "sui" : 295, + "sun" : 296, "suo" : 297, "sha" : 298, "shai" : 299, "shan" : 300, + "shang" : 301, "shao" : 302, "she" : 303, "shei" : 304, "shen" : 305, + "sheng" : 306, "shi" : 307, "shou" : 308, "shu" : 309, "shua" : 310, + "shuai" : 311, "shuan" : 312, "shuang" : 313, "shui" : 314, "shun" : 315, + "shuo" : 316, "ta" : 317, "tai" : 318, "tan" : 319, "tang" : 320, + "tao" : 321, "te" : 322, + # "tei" : 323, + "teng" : 324, "ti" : 325, + "tian" : 326, "tiao" : 327, "tie" : 328, "ting" : 329, "tong" : 330, + "tou" : 331, "tu" : 332, "tuan" : 333, "tui" : 334, "tun" : 335, + "tuo" : 336, "wa" : 337, "wai" : 338, "wan" : 339, "wang" : 340, + "wei" : 341, "wen" : 342, "weng" : 343, "wo" : 344, "wu" : 345, + "xi" : 346, "xia" : 347, "xian" : 348, "xiang" : 349, "xiao" : 350, + "xie" : 351, "xin" : 352, "xing" : 353, "xiong" : 354, "xiu" : 355, + "xu" : 356, "xuan" : 357, "xue" : 358, "xun" : 359, "ya" : 360, + "yan" : 361, "yang" : 362, "yao" : 363, "ye" : 364, "yi" : 365, + "yin" : 366, "ying" : 367, "yo" : 368, "yong" : 369, "you" : 370, + "yu" : 371, "yuan" : 372, "yue" : 373, "yun" : 374, "za" : 375, + "zai" : 376, "zan" : 377, "zang" : 378, "zao" : 379, "ze" : 380, + "zei" : 381, "zen" : 382, "zeng" : 383, "zi" : 384, "zong" : 385, + "zou" : 386, "zu" : 387, "zuan" : 388, "zui" : 389, "zun" : 390, + "zuo" : 391, "zha" : 392, "zhai" : 393, "zhan" : 394, "zhang" : 395, + "zhao" : 396, "zhe" : 397, "zhen" : 398, "zheng" : 399, "zhi" : 400, + "zhong" : 401, "zhou" : 402, "zhu" : 403, "zhua" : 404, "zhuai" : 405, + "zhuan" : 406, "zhuang" : 407, "zhui" : 408, "zhun" : 409, "zhuo" : 410, + # some weird pinyins + #~ "eng" : 411, "chua" : 412, "fe" : 413, "fiao" : 414, "liong" : 415 + } + +PINYIN_LIST = PINYIN_DICT.keys () + +ID_PINYIN_DICT = {} +for pinyin, id in PINYIN_DICT.items (): + ID_PINYIN_DICT[id] = pinyin + +SHENGMU_DICT = { + "" : 0, "b" : 1, "p" : 2, "m" : 3, "f" : 4, "d" : 5, + "t" : 6, "n" : 7, "l" : 8, "g" : 9, "k" : 10, "h" : 11, + "j" : 12, "q" : 13, "x" : 14, "zh" : 15, "ch" : 16, "sh" : 17, + "r" : 18, "z" : 19, "c" : 20, "s" : 21, "y" : 22, "w" : 23 +} +SHENGMU_LIST = SHENGMU_DICT.keys () +#~ PINYIN_PARTIAL_LIST = [] +#~ for p in PINYIN_LIST: + #~ for i in range (2, len (p)): + #~ if not (p[:i] in PINYIN_LIST or p[:i] in SHENGMU_LIST or p[:i] in PINYIN_PARTIAL_LIST): + #~ PINYIN_PARTIAL_LIST.append (p[:i]) +#~ print PINYIN_PARTIAL_LIST +PINYIN_PARTIAL_LIST = [ +'ro', 'zo', 'zon', 'so', 'son', 'tua', 'zua', 'no', +'non', 'be', 'ho', 'cua', 'jio', 'jion', 'xua', 'ko', +'kon', 'we', 'go', 'tia', 'fi', 'fia', 'fe', 'din', 'ra', +'yon', 'do', 'don', 'ron', 'to', 'nia', 'qua', 'cho', +'chon', 'mia', 'den', 'sho', 'nua', 'ten', 'co', 'ton', +'pe', 'tin', 'sua', 'xio', 'xion', 'pia', 'bia', 'dua', +'con', 'hon', 'jua', 'yua', 'zho', 'zhon', 'rua', 'lua', +'lio', 'lion', 'qio', 'qion', 'lon', 'gon', 'len'] + +ID_SHENGMU_DICT = {} + + +for shengmu, id in SHENGMU_DICT.items (): + ID_SHENGMU_DICT[id] = shengmu + +MOHU_SHENGMU = { + "z" : ("z", "zh"), + "zh" : ("z", "zh"), + "c" : ("c", "ch"), + "ch" : ("c", "ch"), + "s" : ("s", "sh"), + "sh" : ("s", "sh"), + "l" : ("l", "n"), + "n" : ("l", "n") +} + +MOHU_YUNMU = { + "an" : ("an", "ang"), + "ang" : ("an", "ang"), + "en" : ("en", "eng"), + "eng" : ("en", "eng"), + "in" : ("in", "ing"), + "ing" : ("in", "ing") +} + +MSPY_SHUANGPIN_SHENGMU_DICT = { + "b" : "b", "c" : "c", "d" : "d", "f" : "f", "g" : "g", + "h" : "h", "i" : "ch","j" : "j", "k" : "k", "l" : "l", + "m" : "m", "n" : "n", "o" : "'", "p" : "p", "q" : "q", + "r" : "r", "s" : "s", "t" : "t", "u" : "sh","v" : "zh", + "w" : "w", "x" : "x", "y" : "y", "z" : "z" +} + +MSPY_SHUANGPIN_YUNMU_DICT = { + "a" : ("a",), + "b" : ("ou",), + "c" : ("iao",), + "d" : ("uang", "iang"), + "e" : ("e",), + "f" : ("en",), + "g" : ("eng", "ng"), + "h" : ("ang",), + "i" : ("i",), + "j" : ("an",), + "k" : ("ao",), + "l" : ("ai",), + "m" : ("ian",), + "n" : ("in",), + "o" : ("uo", "o"), + "p" : ("un",), + "q" : ("iu",), + "r" : ("uan", "er"), + "s" : ("ong", "iong"), + "t" : ("ue",), + "u" : ("u",), + "v" : ("ui","ue"), + "w" : ("ia","ua"), + "x" : ("ie",), + "y" : ("uai", "v"), + "z" : ("ei",), + ";" : ("ing",) +} + +ZRM_SHUANGPIN_SHENGMU_DICT = { + "b" : "b", "c" : "c", "d" : "d", "f" : "f", "g" : "g", + "h" : "h", "i" : "ch","j" : "j", "k" : "k", "l" : "l", + "m" : "m", "n" : "n", "o" : "'", "p" : "p", "q" : "q", + "r" : "r", "s" : "s", "t" : "t", "u" : "sh","v" : "zh", + "w" : "w", "x" : "x", "y" : "y", "z" : "z" +} + +ZRM_SHUANGPIN_YUNMU_DICT = { + "a" : ("a",), + "b" : ("ou",), + "c" : ("iao",), + "d" : ("uang", "iang"), + "e" : ("e",), + "f" : ("en",), + "g" : ("eng", "ng"), + "h" : ("ang",), + "i" : ("i",), + "j" : ("an",), + "k" : ("ao",), + "l" : ("ai",), + "m" : ("ian",), + "n" : ("in",), + "o" : ("uo", "o"), + "p" : ("un",), + "q" : ("iu",), + "r" : ("uan", "er"), + "s" : ("ong", "iong"), + "t" : ("ue",), + "u" : ("u",), + "v" : ("ui","v"), + "w" : ("ia","ua"), + "x" : ("ie",), + "y" : ("uai", "ing"), + "z" : ("ei",), +} + +ABC_SHUANGPIN_SHENGMU_DICT = { + "a" : "zh", "b" : "b", "c" : "c", "d" : "d", "e":"ch", "f" : "f", "g" : "g", + "h" : "h", "j" : "j", "k" : "k", "l" : "l", + "m" : "m", "n" : "n", "o" : "'", "p" : "p", "q" : "q", + "r" : "r", "s" : "s", "t" : "t", "v" : "sh", + "w" : "w", "x" : "x", "y" : "y", "z" : "z" +} + +ABC_SHUANGPIN_YUNMU_DICT = { + "a" : ("a",), + "b" : ("ou",), + "c" : ("in","uai"), + "d" : ("ia", "ua"), + "e" : ("e",), + "f" : ("en",), + "g" : ("eng", "ng"), + "h" : ("ang",), + "i" : ("i",), + "j" : ("an",), + "k" : ("ao",), + "l" : ("ai",), + "m" : ("ue","ui"), + "n" : ("un",), + "o" : ("uo", "o"), + "p" : ("uan",), + "q" : ("ei",), + "r" : ("er", "iu"), + "s" : ("ong", "iong"), + "t" : ("iang","uang"), + "u" : ("u",), + "v" : ("v","ue"), + "w" : ("ian",), + "x" : ("ie",), + "y" : ("ing",), + "z" : ("iao",), +} + +PYJJ_SHUANGPIN_SHENGMU_DICT = { + "a" : "'", "b" : "b", "c" : "c", "d" : "d", "f" : "f", "g" : "g", + "h" : "h", "i" : "sh","j" : "j", "k" : "k", "l" : "l", + "m" : "m", "n" : "n", "o" : "'", "p" : "p", "q" : "q", + "r" : "r", "s" : "s", "t" : "t", "u" : "ch","v" : "zh", + "w" : "w", "x" : "x", "y" : "y", "z" : "z" +} + +PYJJ_SHUANGPIN_YUNMU_DICT = { + "a" : ("a",), + "b" : ("ia","ua"), + "c" : ("uan",), + "d" : ("ao", ), + "e" : ("e",), + "f" : ("an",), + "g" : ("ang",), + "h" : ("iang","uang"), + "i" : ("i",), + "j" : ("ian",), + "k" : ("iao",), + "l" : ("in",), + "m" : ("ie",), + "n" : ("iu",), + "o" : ("uo", "o"), + "p" : ("ou",), + "q" : ("er","ing"), + "r" : ("en", ), + "s" : ("ai", ), + "t" : ("eng", "ng"), + "u" : ("u",), + "v" : ("v","ui"), + "w" : ("ei",), + "x" : ("uai","ue"), + "y" : ("ong","iong"), + "z" : ("un",), +} + +ZGPY_SHUANGPIN_SHENGMU_DICT = { + "a": "ch", "b" : "b", "c" : "c", "d" : "d", "f" : "f", "g" : "g", + "h" : "h", "i" : "sh","j" : "j", "k" : "k", "l" : "l", + "m" : "m", "n" : "n", "o" : "'", "p" : "p", "q" : "q", + "r" : "r", "s" : "s", "t" : "t", "u" : "zh", + "w" : "w", "x" : "x", "y" : "y", "z" : "z" +} + +ZGPY_SHUANGPIN_YUNMU_DICT = { + "a" : ("a", ), + "b" : ("iao", ), + "d" : ("ie", ), + "e" : ("e", ), + "f" : ("ian", ), + "g" : ("iang", "uang"), + "h" : ("ong", "iong"), + "i" : ("i", ), + "j" : ("er", "iu"), + "k" : ("ei", ), + "l" : ("uan", ), + "m" : ("un", ), + "n" : ("ue", "ui"), + "o" : ("uo", "o"), + "p" : ("ai", ), + "q" : ("ao", ), + "r" : ("an", ), + "s" : ("ang", ), + "t" : ("eng", "ng"), + "u" : ("u", ), + "v" : ("v", ), + "w" : ("en", ), + "x" : ("ia", "ua"), + "y" : ("in", "uai"), + "z" : ("ou" ,), + ";" : ("ing", ) +} + +SHUANGPIN_SCHEMAS = { + N_("MSPY") : (MSPY_SHUANGPIN_SHENGMU_DICT, MSPY_SHUANGPIN_YUNMU_DICT), + N_("ZRM") : (ZRM_SHUANGPIN_SHENGMU_DICT, ZRM_SHUANGPIN_YUNMU_DICT), + N_("ABC") : (ABC_SHUANGPIN_SHENGMU_DICT, ABC_SHUANGPIN_YUNMU_DICT), + N_("ZGPY") : (ZGPY_SHUANGPIN_SHENGMU_DICT, ZGPY_SHUANGPIN_YUNMU_DICT), + N_("PYJJ") : (PYJJ_SHUANGPIN_SHENGMU_DICT, PYJJ_SHUANGPIN_YUNMU_DICT) +} + diff --git a/data/scripts/pyutil.py b/data/scripts/pyutil.py new file mode 100644 index 0000000..1872659 --- /dev/null +++ b/data/scripts/pyutil.py @@ -0,0 +1,148 @@ +# -*- coding: utf-8 -*- +# vim:set et sts=4 sw=4: +# +# ibus-pinyin - The PinYin engine for IBus +# +# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com> +# +# 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +from pydict import * + +class PinYinWord: + correct_dict = {"nve" : "nue", "lve" : "lue"} + def __init__ (self, pinyin): + if pinyin in self.correct_dict: + pinyin = self.correct_dict [pinyin] + + self._pinyin = pinyin + self._is_completed = self.is_valid_pinyin () + if self._is_completed: + sheng_mu, yun_mu = self.split () + self._pinyin_id = PINYIN_DICT [self._pinyin] + self._sheng_mu_id = SHENGMU_DICT [sheng_mu] + else: + self._sheng_mu_id = SHENGMU_DICT [self._pinyin] + + def is_valid_pinyin (self): + return PINYIN_DICT.has_key (self._pinyin) + + def get_sheng_mu_id (self): + return self._sheng_mu_id + + def get_shengmu (self): + return ID_SHENGMU_DICT[self._sheng_mu_id] + + def get_pinyin_id (self): + return self._pinyin_id + + def get_pinyin (self): + return self._pinyin + + def get_pattern (self, mohu = False): + if mohu == False: + if self.is_valid_pinyin (): + return self._pinyin + else: + return self._pinyin + "%" + else: + if not self.is_valid_pinyin (): + if self._pinyin in ("zh", "ch", "sh"): + return self._pinyin[0] + "%" + return self._pinyin + "%" + else: + shengmu = self.get_shengmu () + yunmu = self._pinyin [len (shengmu):] + if shengmu in ("zh", "ch", "sh", "z", "c", "s"): + shengmu = shengmu[0] + "%" + if yunmu in ("ing", "in", "en", "eng", "an", "ang"): + yunmu = yunmu[0:2] + "%" + return shengmu + yunmu + + def split (self): + if not self.is_valid_pinyin (): + raise Exception ("Pinyin '%s' is not a valid pinyin!" % py) + if self._pinyin[:2] in SHENGMU_DICT.keys (): + return self._pinyin[:2], self._pinyin[2:] + elif self._pinyin[:1] in SHENGMU_DICT.keys (): + return self._pinyin[:1], self._pinyin[1:] + else: + return "", self._pinyin[:] + + def __str__ (self): + return self._pinyin + +class PinYinString: + def __init__ (self, string): + pass + +def load_pinyin_table (_file): + + def pinyin_table_parser (f): + for l in f: + a = unicode (l, "utf-8").strip ().split () + hanzi, pinyin, freq = a + yield (hanzi, pinyin, int (freq)) + # db.add_phrases (pinyin_table_parser (bzf)) + + hanzi_dic = {} + for hanzi, pinyin, freq in pinyin_table_parser (_file): + if not hanzi_dic.has_key (hanzi): + hanzi_dic[hanzi] = {} + + if hanzi_dic[hanzi].has_key (pinyin): + hanzi_dic[hanzi][pinyin] += freq + else: + hanzi_dic[hanzi][pinyin] = freq + + return hanzi_dic + +def load_phrase_pinyin_freq (_file): + def phrase_pinyin_parser (f): + for l in f: + phrase, pinyin, freq = unicode (l, "utf-8").strip ().split () + pinyin = pinyin.replace (u"u:", u"v") + yield (phrase, pinyin, int (freq)) + phrases_dic = {} + for phrase, pinyin, freq in phrase_pinyin_parser (_file): + if not phrases_dic.has_key (phrase): + phrases_dic[phrase] = [] + phrases_dic[phrase].append ((phrase, pinyin, freq)) + + return phrases_dic + +def load_phrase_pinyin (_file): + def phrase_pinyin_parser (f): + for l in f: + phrase, pinyin = unicode (l, "utf-8").strip ().split () + pinyin = pinyin.replace (u"u:", u"v") + yield (phrase, pinyin, 0) + phrases_dic = {} + for phrase, pinyin, freq in phrase_pinyin_parser (_file): + if not phrases_dic.has_key (phrase): + phrases_dic[phrase] = [] + phrases_dic[phrase].append ((phrase, pinyin, freq)) + + return phrases_dic + +def load_sogou_phrases (_file): + import re + dic = {} + for l in _file: + w = unicode (l, "utf8") + w = re.split (ur"\t+", w) + dic [w[0]] = (w[0], int (w[1])) + return dic + |