Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wordlist.sq3に壊れたデータが登録されて地名語が全く抽出されない問題の修整 #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

deton
Copy link

@deton deton commented Oct 6, 2018

現象

echo '沖縄県の南海上で台風が発生しました' | geonlp_ma
で地名語が全く認識されない。

期待する結果:
https://geonlp.ex.nii.ac.jp/docs/developers/system_developers/software/advanced.html

実際の結果:

沖縄	名詞,固有名詞,地域,一般,*,*,沖縄,オキナワ,オキナワ
県	名詞,接尾,地域,*,*,*,県,ケン,ケン
の	助詞,連体化,*,*,*,*,の,ノ,ノ
南海	名詞,固有名詞,組織,*,*,*,南海,ナンカイ,ナンカイ
上	名詞,固有名詞,地域,一般,*,*,上,ウエ,ウエ
で	助詞,格助詞,一般,*,*,*,で,デ,デ
台風	名詞,一般,*,*,*,*,台風,タイフウ,タイフー
が	助詞,格助詞,一般,*,*,*,が,ガ,ガ
発生	名詞,サ変接続,*,*,*,*,発生,ハッセイ,ハッセイ
し	動詞,自立,*,*,サ変・スル,連用形,する,シ,シ
まし	助動詞,*,*,*,特殊・マス,連用形,ます,マシ,マシ
た	助動詞,*,*,*,特殊・タ,基本形,た,タ,タ
EOS

調査

辞書ファイルサイズ

修整前:

 975920 geo_name_fullname.drt
3661824 geodic.sq3
 110318 mecabusr.dic
1363968 wordlist.sq3

修整後:

 9019008 geo_name_fullname.drt
67686400 geodic.sq3
 2281382 mecabusr.dic
12525568 wordlist.sq3

wordlist.sq3内容

修整前:
ng

select count(*) from wordlist;
19730

修整後:

0|26線川|26線川|FWefYC:26線川|
1|8線の沢川|8線の沢川|wWGf7V:8線の沢川|
2|JR三山木|JR三山木|r2XsgD:JR三山木駅|ジェイアールミヤマキ
3|JR三山木駅|JR三山木駅|r2XsgD:JR三山木駅|ジェイアールミヤマキエキ
4|JR五位堂|JR五位堂|B4JZEA:JR五位堂駅|ジェイアールゴイドウ
5|JR五位堂駅|JR五位堂駅|B4JZEA:JR五位堂駅|ジェイアールゴイドウエキ
6|JR俊徳道|JR俊徳道|qIJKpF:JR俊徳道駅|ジェイアールシュントクドウ
7|JR俊徳道駅|JR俊徳道駅|qIJKpF:JR俊徳道駅|ジェイアールシュントクドウエキ
8|JR小倉|JR小倉|xKuv19:JR小倉駅|ジェイアールオグラ
9|JR小倉駅|JR小倉駅|xKuv19:JR小倉駅|ジェイアールオグラエキ
select count(*) from wordlist;
178588

原因

wordlist.sq3に登録されたデータが壊れている。

修整

sqlite3_bind_text()のSQLITE_STATIC引数を、SQLITE_TRANSIENTに置換。

環境

openSUSE Tumbleweed 20180924-0
Linux wasabi 4.18.8-1-default #1 SMP PREEMPT Sat Sep 15 14:10:30 UTC 2018 (f486469) x86_64 x86_64 x86_64 GNU/Linux

g++ (SUSE Linux) 8.2.1 20180831 [gcc-8-branch revision 264010]
sqlite3-devel 3.24.0-3.1
libboost_filesystem1_68_0-devel
libboost_regex1_68_0-devel
libboost_system1_68_0-devel
libboost_thread1_68_0-devel

mecab of 0.996

deton added 2 commits October 3, 2018 20:02
warning: no return statement in function returning non-void [-Wreturn-type]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant