Package org.languagetool.dev.index
Class Indexer
java.lang.Object
org.languagetool.dev.index.Indexer
- All Implemented Interfaces:
AutoCloseable
A class with a main() method that takes a text file and indexes its sentences, including POS tags
- Author:
- Tao Lin, Miaojuan Dai
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.apache.lucene.document.Document doc) voidclose()voidcommit()voidindexSentence(Sentence sentence, int docCount) voidindexText(BufferedReader reader) static voidstatic voidvoidsetLowercaseOnly(boolean lowercaseOnly) Set to true to index only a lowercase field (makes index smaller).
-
Constructor Details
-
Indexer
-
Indexer
public Indexer(org.apache.lucene.store.Directory dir, Language language, org.apache.lucene.analysis.Analyzer analyzer)
-
-
Method Details
-
setLowercaseOnly
public void setLowercaseOnly(boolean lowercaseOnly) Set to true to index only a lowercase field (makes index smaller). -
main
- Throws:
IOException
-
run
public static void run(String content, org.apache.lucene.store.Directory dir, Language language) throws IOException - Throws:
IOException
-
indexSentence
- Throws:
IOException
-
indexText
- Throws:
IOException
-
add
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
commit
- Throws:
IOException
-