Package org.languagetool.tools
Class DictionaryBuilder
- java.lang.Object
-
- org.languagetool.tools.DictionaryBuilder
-
- Direct Known Subclasses:
DictionaryExporter
,POSDictionaryBuilder
,SpellDictionaryBuilder
,SynthDictionaryBuilder
class DictionaryBuilder extends java.lang.Object
Create a Morfologik binary dictionary from plain text data.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
FIRST_RANGE_CODE
private static int
FREQ_RANGES_IN
private static int
FREQ_RANGES_OUT
private java.util.Map<java.lang.String,java.lang.Integer>
freqList
private java.lang.String
outputFilename
private java.util.regex.Pattern
pFreqEntry
private java.util.Properties
props
private java.util.regex.Pattern
pTaggerEntry
private static morfologik.tools.SerializationFormat
serializationFormat
-
Constructor Summary
Constructors Modifier Constructor Description protected
DictionaryBuilder(java.io.File infoFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.File
addFreqData(java.io.File dictFile, boolean useSeparator)
protected java.io.File
buildDict(java.io.File inputFile)
protected java.io.File
buildFSA(java.io.File inputFile)
protected java.io.File
convertTabToSeparator(java.io.File inputFile)
protected @Nullable java.lang.String
getOption(java.lang.String option)
protected java.lang.String
getOutputFilename()
protected boolean
hasOption(java.lang.String option)
protected boolean
isOptionTrue(java.lang.String option)
protected void
readFreqList(java.io.File freqListFile)
protected void
setOutputFilename(java.lang.String outputFilename)
-
-
-
Field Detail
-
props
private final java.util.Properties props
-
FREQ_RANGES_IN
private static final int FREQ_RANGES_IN
- See Also:
- Constant Field Values
-
FREQ_RANGES_OUT
private static final int FREQ_RANGES_OUT
- See Also:
- Constant Field Values
-
FIRST_RANGE_CODE
private static final int FIRST_RANGE_CODE
- See Also:
- Constant Field Values
-
serializationFormat
private static final morfologik.tools.SerializationFormat serializationFormat
-
freqList
private final java.util.Map<java.lang.String,java.lang.Integer> freqList
-
pFreqEntry
private final java.util.regex.Pattern pFreqEntry
-
pTaggerEntry
private final java.util.regex.Pattern pTaggerEntry
-
outputFilename
private java.lang.String outputFilename
-
-
Method Detail
-
setOutputFilename
protected void setOutputFilename(java.lang.String outputFilename)
-
getOutputFilename
protected java.lang.String getOutputFilename()
-
buildDict
protected java.io.File buildDict(java.io.File inputFile) throws java.lang.Exception
- Throws:
java.lang.Exception
-
buildFSA
protected java.io.File buildFSA(java.io.File inputFile) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getOption
@Nullable protected @Nullable java.lang.String getOption(java.lang.String option)
-
hasOption
protected boolean hasOption(java.lang.String option)
-
isOptionTrue
protected boolean isOptionTrue(java.lang.String option)
-
readFreqList
protected void readFreqList(java.io.File freqListFile)
-
addFreqData
protected java.io.File addFreqData(java.io.File dictFile, boolean useSeparator) throws java.io.IOException
- Throws:
java.io.IOException
-
convertTabToSeparator
protected java.io.File convertTabToSeparator(java.io.File inputFile) throws java.lang.RuntimeException, java.io.IOException
- Throws:
java.lang.RuntimeException
java.io.IOException
-
-