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

Are there any way to escape double quotes for dictionary entry? #4

Open
shinpei opened this issue Nov 6, 2015 · 3 comments
Open

Are there any way to escape double quotes for dictionary entry? #4

shinpei opened this issue Nov 6, 2015 · 3 comments

Comments

@shinpei
Copy link

shinpei commented Nov 6, 2015

Hi, I need to add a keyword which contains double quote inside of dictionary. Do we have a way to escape it?

@johtani
Copy link
Member

johtani commented Nov 10, 2015

I think you don't need to escape double quote and you shouldn't quote a keyword.
e.g.

ラン"スロット,2770,名詞,固有名詞,人名,姓,*,*,"ランスロット","ランスロット","ランスロット"

@shinpei
Copy link
Author

shinpei commented Nov 19, 2015

Thank you for reply, correct me if I'm wrong, but the default ipa dictionary contains double quoted keyword,

head -n 1 dictionary.csv                                                                                                                                                                                    
"幽い",2982,形容詞,自立,*,*,形容詞・アウオ段,基本形,"幽い","カソケイ","カソケイ"

Anyway, I tried what you said, and found problem details. If I do like this, it is compilable.

あ"あ"あ",900,名詞,固有名詞,人名,一般,*,*,"","",""

But if I start from double quote, it fails.

"あ"あ"あ,900,名詞,固有名詞,人名,一般,*,*,"","",""
compile:
     [java] Exception in thread "main" java.lang.RuntimeException: format error:"あ"あ"あ,900,名詞,固有名詞,人名,一般,*,*,"","",""
     [java]     at net.java.sen.compiler.DictionaryBuilder.createPartOfSpeechDataFile(DictionaryBuilder.java:240)
     [java]     at net.java.sen.compiler.DictionaryBuilder.<init>(DictionaryBuilder.java:678)
     [java]     at net.java.sen.tools.DictionaryCompiler.main(DictionaryCompiler.java:40)
     [java] Java Result: 1

@johtani
Copy link
Member

johtani commented Jun 11, 2016

Hi @shinpei ,
Sorry for sooooo late reply... I missed your comment...
And you are right, your case fail in our CSVParser.
And now, our CSVParser has no option for escaping quote...
We should replace CSVParser to OpenCSV or something.

If you still think using lucene-gosen, please wait fixing a bug

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

No branches or pull requests

2 participants