1 | $Id$ |
---|
2 | |
---|
3 | = ããã¯äœïŒ = |
---|
4 | C/Migemo ã Python ãã䜿ãããã® wrapper ã§ãïŒ |
---|
5 | |
---|
6 | |
---|
7 | = å¿
èŠãªãã® = |
---|
8 | C/Migemo ã©ã€ãã©ãªãã€ã³ã¹ããŒã«ãããŠããããšãåæãšãªã£ãŠããŸãïŒ |
---|
9 | ã©ã€ãã©ãªæ€çŽ¢ãã¹ã« migemo.so ãïŒãããæ€çŽ¢ãã¹ã« migemo.h ãååšããããšãã確èªäžããïŒ |
---|
10 | |
---|
11 | |
---|
12 | = ã€ã³ã¹ããŒã«æ¹æ³ = |
---|
13 | å梱㮠setup.py ããå©çšäžããïŒ |
---|
14 | |
---|
15 | {{{ |
---|
16 | $ ./setup.py build |
---|
17 | # ./setup.py install |
---|
18 | }}} |
---|
19 | |
---|
20 | |
---|
21 | = ã©ã€ã»ã³ã¹ = |
---|
22 | äºæ¡é
BSD ã©ã€ã»ã³ã¹ã«æºæ ããŸãïŒ |
---|
23 | 詳现ã¯å梱㮠LICENSE ãã¡ã€ã«ãã芧äžããïŒ |
---|
24 | |
---|
25 | |
---|
26 | = 䜿ãæ¹ = |
---|
27 | {{{ |
---|
28 | >>> import migemo |
---|
29 | >>> m = migemo.Migemo("/usr/share/migemo/migemo-dict") |
---|
30 | >>> print m.query("hoge") |
---|
31 | (hoge|ïœïœïœïœ
|ã»ã|æ鯚|åžæ¡|è£å
|ãã²) |
---|
32 | }}} |
---|
33 | |
---|
34 | |
---|
35 | == ãªãã¡ã¬ã³ã¹ == |
---|
36 | === ã¢ãžã¥ãŒã«ã³ã³ãã³ã === |
---|
37 | * VERSION |
---|
38 | * MIGEMO_VERSION |
---|
39 | * C/Migemo ã®ããŒãžã§ã³ |
---|
40 | * PYMIGEMO_VERSION |
---|
41 | * PyMigemo ã®ããŒãžã§ã³ |
---|
42 | |
---|
43 | * DICTID |
---|
44 | * DICTID_MIGEMO |
---|
45 | * migemo-dict èŸæž |
---|
46 | * DICTID_ROMA2HIRA |
---|
47 | * ããŒãåâ平仮åå€æè¡š |
---|
48 | * DICTID_HIRA2KATA |
---|
49 | * 平仮åâã«ã¿ã«ãå€æè¡š |
---|
50 | * DICTID_HAN2ZEN |
---|
51 | * åè§âå
šè§å€æè¡š |
---|
52 | * DICTID_ZEN2HAN |
---|
53 | * å
šè§âåè§å€æè¡š |
---|
54 | * DICTID_INVALID |
---|
55 | * load ã¡ãœããã§èŸæžã®èªã¿èŸŒã¿ã«å€±æããå Žåã«è¿ã |
---|
56 | |
---|
57 | * OPINDEX |
---|
58 | * OPINDEX_OR |
---|
59 | * è«çå |
---|
60 | * Migemo.get_operator() ã«æž¡ããéã®ããã©ã«ã㯠"|" |
---|
61 | * OPINDEX_NEST_IN |
---|
62 | * ã°ã«ãŒãã³ã°æã®éãæ¬åŒ§ |
---|
63 | * Migemo.get_operator() ã«æž¡ããéã®ããã©ã«ã㯠"(" |
---|
64 | * OPINDEX_NEST_OUT |
---|
65 | * ã°ã«ãŒãã³ã°æã®éãæ¬åŒ§ |
---|
66 | * Migemo.get_operator() ã«æž¡ããéã®ããã©ã«ã㯠")" |
---|
67 | * OPINDEX_SELECT_IN |
---|
68 | * éžæã®éå§ãè¡šãéãéæ¬åŒ§ |
---|
69 | * Migemo.get_operator() ã«æž¡ããéã®ããã©ã«ã㯠"[" |
---|
70 | * OPINDEX_SELECT_OUT |
---|
71 | * éžæã®çµäºãè¡šãéãéæ¬åŒ§ |
---|
72 | * Migemo.get_operator() ã«æž¡ããéã®ããã©ã«ã㯠"]" |
---|
73 | * OPINDEX_NEWLINE |
---|
74 | * åæåã®éã«æ¿å
¥ãããã0 å以äžã®ç©ºçœãããã¯æ¹è¡ã«ãããããããã¿ãŒã³ |
---|
75 | * Migemo.get_operator() ã«æž¡ããéã®ããã©ã«ã㯠"" (空æåå) |
---|
76 | |
---|
77 | * Migemo ã¯ã©ã¹ |
---|
78 | * __init__(dictionary) |
---|
79 | * Migemo ã¯ã©ã¹ã®ã³ã³ã¹ãã©ã¯ã¿ |
---|
80 | * åŒæ° |
---|
81 | * dictionary: migemo-dict èŸæžãã¡ã€ã«ã®ãã¹ (str) |
---|
82 | * get_encoding() |
---|
83 | * migemo-dict èŸæžã®ãšã³ã³ãŒãã£ã³ã°ã str ã§è¿ãïŒ |
---|
84 | äŸãã° EUC-JP ã§æžãããèŸæžã§ããã° "euc_jp" ãè¿ãïŒ |
---|
85 | cp932ïŒeuc_jpïŒutf8 ã®ãããããè¿ããïŒ |
---|
86 | èŸæžã®ãšã³ã³ãŒãã£ã³ã°ããããã«è©²åœããªãã£ãå Žå㯠"ascii" ãè¿ã |
---|
87 | * åŒæ° |
---|
88 | * ãªã |
---|
89 | * è¿ãå€ |
---|
90 | * ãšã³ã³ãŒãã£ã³ã°æåå (str) |
---|
91 | * get_operator(index) |
---|
92 | * index ã§æå®ãããïŒæ£èŠè¡šçŸã«äœ¿çšããã¡ã¿æåãè¿ã (str) |
---|
93 | * åŒæ° |
---|
94 | * index: åè¿°ã® OPINDEX ã®ãããã |
---|
95 | * è¿ãå€ |
---|
96 | * ã¡ã¿æåå (str) |
---|
97 | * is_enable() |
---|
98 | * Migemo å
éšã«ïŒæ£åžžã«èŸæžãèªã¿èŸŒããŠãããã©ããããã§ãã¯ãã |
---|
99 | * åŒæ° |
---|
100 | * ãªã |
---|
101 | * è¿ãå€ |
---|
102 | * çåœå€ (int) : æ£åžžã«èªã¿èŸŒããŠããå Žåã«ç |
---|
103 | * load(dict_id, dict_file) |
---|
104 | * Migemo ãªããžã§ã¯ãã«èŸæžãè¿œå ã§èªã¿èŸŒã |
---|
105 | * åŒæ° |
---|
106 | * dict_id: åè¿°ã® DICTID ã®ãããã |
---|
107 | * dict_file: èŸæžãã¡ã€ã«ã®ãã¹ |
---|
108 | * è¿ãå€ |
---|
109 | * èªã¿èŸŒãã èŸæžã® DICTIDïŒ |
---|
110 | èªã¿èŸŒã¿ã«å€±æããå Žå DICTID_INVALID ãè¿ã |
---|
111 | * query(query) |
---|
112 | * query ã§äžããããæååããæ¥æ¬èªæ€çŽ¢ã®ããã®æ£èŠè¡šçŸãè¿ã |
---|
113 | * åŒæ° |
---|
114 | * query: åãåãããæåå (Unicode or str)ïŒ |
---|
115 | str 㧠ascii 以å€ã®æååãæž¡ãå ŽåïŒ |
---|
116 | èŸæžãšåããšã³ã³ãŒãã£ã³ã°ã®æååã§ãªããšãšã©ãŒã«ãªãå¯èœæ§ããã |
---|
117 | * è¿ãå€ |
---|
118 | * æ£èŠè¡šçŸæåå (Unicode) |
---|
119 | * set_operator(index, op) |
---|
120 | * index ã§æå®ãããïŒæ£èŠè¡šçŸã«äœ¿çšããã¡ã¿æåã op ã«å€æŽãã |
---|
121 | * åŒæ° |
---|
122 | * index: åè¿°ã® OPINDEX ã®ãããã |
---|
123 | * op: ã¡ã¿æåå (str) |
---|
124 | * è¿ãå€ |
---|
125 | * çåœå€ (int) : æåæã«ç |
---|
126 | |
---|
127 | |
---|
128 | = ãã®ä» = |
---|
129 | æ¬ãœãããŠã§ã¢ã«å¯Ÿããã³ã¡ã³ãïŒãã°å ±åïŒããããªã©ã¯å€§ãã«æè¿ããŸãïŒ |
---|
130 | äžèšã¡ãŒã«ã¢ãã¬ã¹ãŸã§ãæ°è»œã«ãå¯ãäžããïŒ |
---|
131 | |
---|
132 | Atzm WATANABE <atzm@atzm.org> |
---|