java.lang.Object
com.github.szgabsz91.morpher.languagehandlers.hunmorph.impl.HunmorphWordProcessor
All Implemented Interfaces:
AutoCloseable

public class HunmorphWordProcessor extends Object implements AutoCloseable
Processes words using Hunmorph-Ocamorph.
  • Constructor Details

    • HunmorphWordProcessor

      public HunmorphWordProcessor()
      Default constructor that creates the hunmorph.bin file as a temporary file automatically.
    • HunmorphWordProcessor

      public HunmorphWordProcessor(Function<Path,Path> binFileSupplier)
      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:
      close in interface AutoCloseable
    • process

      public Optional<HunmorphResult> process(String grammaticalForm)
      Processes the given grammatical form and returns the resulting optional HunmorphResult instance.
      Parameters:
      grammaticalForm - the grammatical form
      Returns:
      the resulting optional HunmorphResult instance
    • process

      public Optional<HunmorphResult> process(String grammaticalForm, boolean guess)
      Processes the given grammatical form and returns the resulting optional HunmorphResult instance.
      Parameters:
      grammaticalForm - the grammatical form
      guess - flag that indicates if unknown words should be analyzed or not
      Returns:
      the resulting optional HunmorphResult instance