Package org.apache.log4j

Examples of org.apache.log4j.Logger.debug()


  //*-- train on files in data directory ending in "txt"
  if (!TRAINING_DIR.isDirectory())
  { logger.fatal("Could not find training directory=" + TRAINING_DIR); }
  File[] files = TRAINING_DIR.listFiles(new FileExtensionFilter("txt"));
  for (int i = 0; i < files.length; ++i)
  { logger.debug("Training on file: " + files[i]); parser.parse(files[i]); }

  //*-- write output to file
  File modelFile = new File(MUSTRU_HOME + File.separator + "data" + File.separator + "training" + File.separator + "pos" + File.separator + "pos_tagger");
  ObjectOutputStream objOut = new ObjectOutputStream(new FileOutputStream(modelFile));
  estimator.compileTo(objOut);
View Full Code Here


  //*-- write output to file
  File modelFile = new File(MUSTRU_HOME + File.separator + "data" + File.separator + "training" + File.separator + "pos" + File.separator + "pos_tagger");
  ObjectOutputStream objOut = new ObjectOutputStream(new FileOutputStream(modelFile));
  estimator.compileTo(objOut);
  Streams.closeOutputStream(objOut);
  logger.debug("Finished POS tagger model generation");
}
}
View Full Code Here

public static void main(String[] args) throws ClassNotFoundException, IOException
{
  PropertyConfigurator.configure (Constants.LOG4J_FILE);
  Logger logger = Logger.getLogger(TrainFtypeClassifier.class.getName());
  logger.debug("Started TrainFtypeClassifier");
  DynamicLMClassifier classifier = new DynamicLMClassifier(CATEGORIES, NGRAM_SIZE, BOUNDED);

  //*-- Start of training
  //*-- loop through the list of categories and verify that a directory exists for each one.
  for (int i = 0; i < CATEGORIES.length; ++i)
View Full Code Here

   //*-- get the list of training files for the category and train the classifier on each of the files
   String[] trainingFiles = classDir.list();
   for (int j = 0; j < trainingFiles.length; ++j)
   {
    String text = Files.readFromFile(new File(classDir,trainingFiles[j]));
    logger.debug("Training on " + CATEGORIES[i] + File.separator + trainingFiles[j]);
    classifier.train(CATEGORIES[i], text);
   } //*-- end of inner for
  } //*-- end of outer for
  //*-- end of training

View Full Code Here

  ObjectOutputStream os = new ObjectOutputStream( new FileOutputStream(modelFile) );
  classifier.compileTo(os);
  os.close();
  logger.info("End compiling ftype classifier");

  logger.debug("Ended TrainFtypeClassifier");
}
}
View Full Code Here

public static void main(String[] args) throws ClassNotFoundException, IOException
{
  PropertyConfigurator.configure (Constants.LOG4J_FILE);
  Logger logger = Logger.getLogger(TrainTtypeClassifier.class.getName());
  logger.debug("Started TrainCatClassifier");
  DynamicLMClassifier classifier = new DynamicLMClassifier(CATEGORIES, NGRAM_SIZE, BOUNDED);

  //*-- Start of training
  //*-- loop through the list of categories and verify that a directory exists for each one.
  for (int i = 0; i < CATEGORIES.length; ++i)
View Full Code Here

   //*-- get the list of training files for the category and train the classifier on each of the files
   String[] trainingFiles = classDir.list();
   for (int j = 0; j < trainingFiles.length; ++j)
   {
    String text = Files.readFromFile(new File(classDir,trainingFiles[j]));
    logger.debug("Training on " + CATEGORIES[i] + File.separator + trainingFiles[j]);
    classifier.train(CATEGORIES[i], text);
   } //*-- end of inner for
  } //*-- end of outer for
  //*-- end of training

View Full Code Here

  String modelFile = Constants.TTYPE_CLASS_MODEL;
  ObjectOutputStream os = new ObjectOutputStream( new FileOutputStream(modelFile) );
  classifier.compileTo(os);
  os.close();
  logger.info("End compiling classifier");
  logger.debug("Ended TrainCatClassifier");
}
}
View Full Code Here


  void common(String msg) {
    Logger logger = Logger.getLogger("test");
    logger.trace(msg);
    logger.debug(msg);
    logger.info(msg);
    logger.warn(msg);
    logger.error(msg);
    logger.fatal(msg);
  }
View Full Code Here

    rootLogger.setLevel(Level.TRACE);
   
    logger.trace("Message " + ++i);
    root.trace("Message " + ++i);
    logger.debug("Message " + ++i);
    root.debug("Message " + ++i);
    logger.info("Message " + ++i);
    logger.warn("Message " + ++i);
    logger.log(XLevel.LETHAL, "Message " + ++i); //5
   
    Exception e = new Exception("Just testing");
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.