Class NLP

java.lang.Object
com.logicaldoc.via.NLP

public class NLP extends Object
basic operations of Natural Language Processing
Since:
7.8
Author:
Marco Meschieri - LogicalDOC
  • Field Details

    • CAT_SEARCHDOC

      public static String CAT_SEARCHDOC
    • CAT_GETDOC

      public static String CAT_GETDOC
  • Method Details

    • getLocale

      public Locale getLocale()
    • get

      public static NLP get(Locale locale)
    • getByText

      public static NLP getByText(String text) throws IOException
      Throws:
      IOException
    • detectLocale

      public static Locale detectLocale(String text) throws IOException
      Throws:
      IOException
    • trainCategorizer

      public void trainCategorizer(File trainFile) throws IOException
      Trains the categorizer and stores the compiled model
      Parameters:
      trainFile - The training file for the categories
      Throws:
      IOException - error reading the training files
    • categorize

      public String categorize(String contents) throws IOException
      Throws:
      IOException
    • trainDocumentsFinder

      public void trainDocumentsFinder(File trainFile) throws IOException
      Trains the name finder and stores the compiled model.
      Parameters:
      trainFile - The training file in clear form and natural language
      Throws:
      opennlp.tools.util.InvalidFormatException - the training files are corrupt
      IOException - error reading the training files
    • find

      public List<NameEntity> find(String contents) throws IOException
      Throws:
      IOException