简体   繁体   English

如何使用lucene进行词形还原和消除空的法语单词

[英]how to use lucene for lemmatization and elimination of empty French words

我正在寻找lemmatizate和用法语中使用lucene用法语写的文件中的空话来消除我在互联网上看到的但是我没有找到好的tutoriels。

The term for "empty words" is stop words . “空话”一词是停用词

Lucene provides the FrenchAnalyzer class, which comes with a default stop words list for the French language. Lucene提供了FrenchAnalyzer类,它带有法语的默认停用词列表。

Just use that class as your analyzer. 只需将该类用作分析器即可。

It's easy, all what you need is a FrenchAnalyzer like this: 这很简单,你需要的就是这样的FrenchAnalyzer:

IndexWriterConfig conf= new IndexWriterConfig (Version.LUCENE_45,new FrenchAnalyzer(Version.LUCENE_45,FrenchAnalyzer.getDefaultStopSet()));

and for empty words we use : FrenchAnalyzer.getDefaultStopSet() like i did in the previous code , and for the lemmatization it's already integrated in this analyzer and you can notice that when you look for the important words (by tf idf) . 对于我们使用的空单词:FrenchAnalyzer.getDefaultStopSet()就像我在前面的代码中所做的那样,对于词形还原,它已经集成在这个分析器中,你可以注意到当你查找重要单词时(通过tf idf)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM