Class Morfeusz
java.lang.Object
pl.sgjp.morfeusz.Morfeusz
Performs morphological analysis (analyse methods) and syntesis (generate methods).
It is NOT thread-safe
but it is possible to use separate Morfeusz instance for each concurrent thread.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionpl.sgjp.morfeusz._ResultsIterator_analyseAsIterator(String text) analyseAsIterator(String text) Analyze given text and return the results as iterator.analyseAsList(String text) Analyze given text and return the results as list.clone()static MorfeuszCreates actual instance of Morfeusz class.static MorfeuszcreateInstance(String dictName) Creates actual instance of Morfeusz class.static MorfeuszcreateInstance(String dictName, MorfeuszUsage usage) Creates actual instance of Morfeusz class.static MorfeuszcreateInstance(MorfeuszUsage usage) Creates actual instance of Morfeusz class.voiddelete()protected voidfinalize()Perform morphological synthesis on a given lemma.Perform morphological synthesis on a given lemma.getAggl()Get list of possible agglutination rules.Get list of possible past-tense segmentation rules.static Stringprotected static longstatic StringGet list of paths for dictionaries searching.getPraet()static StringReturns a string containing library version.voidSet aggl segmentation option value.voidsetCaseHandling(CaseHandling caseHandling) Set case handling.voidsetDictionary(String dictName) Set dictionary to be used with this instance.voidSet praet segmentation option value.voidsetTokenNumbering(TokenNumbering numbering) Set token numbering policy.voidsetWhitespaceHandling(WhitespaceHandling whitespaceHandling) Set whitespace handling.protected static longswigRelease(Morfeusz obj)
-
Field Details
-
swigCMemOwn
protected transient boolean swigCMemOwn
-
-
Constructor Details
-
Morfeusz
protected Morfeusz(long cPtr, boolean cMemoryOwn)
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
-
delete
public void delete() -
analyseAsIterator
Analyze given text and return the results as iterator. It does not store results for whole text at once, so may be less memory-consuming for analysis of big texts. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
text- text for morphological analysis.- Returns:
- iterator over morphological analysis results
-
analyseAsList
Analyze given text and return the results as list. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
text- text for morphological analysis.- Returns:
- list containing the results of morphological analysis
-
generate
Perform morphological synthesis on a given lemma. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
lemma- lemma to be synthesized- Returns:
- list containing results of the morphological synthesis
- Throws:
MorfeuszException- when given parameter contains whitespaces
-
generate
Perform morphological synthesis on a given lemma. Limit results to interpretations with the specified tag. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
lemma- lemma to be analysedtagnum- tag number of result interpretations- Returns:
- list containing results of the morphological synthesis
- Throws:
MorfeuszException- when given parameter contains whitespaces
-
getDictionarySearchPaths
Get list of paths for dictionaries searching. It is neccessary to modify this list to search for dictionaries under non-default paths. The returned list is NOT THREAD-SAFE (must have exclusive acces to modify it).- Returns:
- modifiable list of paths
-
getAvailableAgglOptions
-
getAvailablePraetOptions
-
setDictionary
Set dictionary to be used with this instance. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
dictName- new dictionary name- Throws:
IOException- when IO error occurs when trying to read dictionaryMorfeuszException- when there is no such dictionary
-
getVersion
Returns a string containing library version.- Returns:
- library version string
-
getDefaultDictName
-
getCopyright
-
createInstance
Creates actual instance of Morfeusz class.- Returns:
- Morfeusz instance
-
createInstance
Creates actual instance of Morfeusz class.- Returns:
- Morfeusz instance
-
createInstance
Creates actual instance of Morfeusz class.- Returns:
- Morfeusz instance
-
createInstance
-
getDictID
-
getDictCopyright
-
clone
-
setAggl
Set aggl segmentation option value. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
aggl- aggl value- Throws:
MorfeuszException- when invalid aggl parameter provided
-
getAggl
-
setPraet
Set praet segmentation option value. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
praet- praet value- Throws:
MorfeuszException- when invalid praet parameter provided
-
getPraet
-
setCaseHandling
Set case handling. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
caseHandling- case handling policy
-
getCaseHandling
-
setTokenNumbering
Set token numbering policy. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
numbering- token numbering policy
-
getTokenNumbering
-
setWhitespaceHandling
Set whitespace handling. NOT THREAD-SAFE (must have exclusive access to this instance).- Parameters:
whitespaceHandling- whitespace handling policy
-
getWhitespaceHandling
-
getIdResolver
-
_analyseAsIterator
-