Class HunmorphWordProcessor
java.lang.Object
com.github.szgabsz91.morpher.languagehandlers.hunmorph.impl.HunmorphWordProcessor
- All Implemented Interfaces:
AutoCloseable
Processes words using Hunmorph-Ocamorph.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that creates the hunmorph.bin file as a temporary file automatically.HunmorphWordProcessor(Function<Path, Path> binFileSupplier) Constructor that retrieves the hunmorph.bin file from the provided supplier. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deletes the temporary files and folders.Processes the given grammatical form and returns the resulting optionalHunmorphResultinstance.Processes the given grammatical form and returns the resulting optionalHunmorphResultinstance.
-
Constructor Details
-
HunmorphWordProcessor
public HunmorphWordProcessor()Default constructor that creates the hunmorph.bin file as a temporary file automatically. -
HunmorphWordProcessor
Constructor that retrieves the hunmorph.bin file from the provided supplier.- Parameters:
binFileSupplier- the supplier that returns the hunmorph.bin file
-
-
Method Details
-
close
public void close()Deletes the temporary files and folders.- Specified by:
closein interfaceAutoCloseable
-
process
Processes the given grammatical form and returns the resulting optionalHunmorphResultinstance.- Parameters:
grammaticalForm- the grammatical form- Returns:
- the resulting optional
HunmorphResultinstance
-
process
Processes the given grammatical form and returns the resulting optionalHunmorphResultinstance.- Parameters:
grammaticalForm- the grammatical formguess- flag that indicates if unknown words should be analyzed or not- Returns:
- the resulting optional
HunmorphResultinstance
-