Examples of NGramProcessLM


Examples of com.aliasi.lm.NGramProcessLM

  //*-- create the spell checker
  if (crawlConfig.isSpellCheck())
  { FixedWeightEditDistance fixedEdit = new FixedWeightEditDistance( MATCH_WEIGHT, DELETE_WEIGHT, INSERT_WEIGHT,
      SUBSTITUTE_WEIGHT, TRANSPOSE_WEIGHT);
    NGramProcessLM lm = new NGramProcessLM(NGRAM_LENGTH);
    TokenizerFactory tokenizerFactory = new StandardBgramTokenizerFactory(false)//*-- do not extract entities
    try { if ( (new File(Constants.SPELL_TRAIN_MODEL).exists() ) && !crawlConfig.isFreshCrawl() )
             lm = readModel(Constants.SPELL_TRAIN_MODEL)
          sc = new TrainSpellChecker(lm, fixedEdit, tokenizerFactory); }
    catch (IOException ie) { logger.error("IO Error: Could not read spell train file " + ie.getMessage()); }
View Full Code Here

Examples of com.aliasi.lm.NGramProcessLM

   //*--- create object input stream from file
   BufferedInputStream bufIn = new BufferedInputStream(new FileInputStream(new File(filename)));
   ObjectInputStream objIn = new ObjectInputStream(bufIn);

   //*-- read the spell checker
   NGramProcessLM nLM = NGramProcessLM.readFrom(objIn);
  
   // close the resources and return result
   objIn.close(); bufIn.close();
   return(nLM);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.