예제 #1
0
 /// <exception cref="System.IO.IOException"/>
 public TestClassifier(MaxentTagger maxentTagger, string testFile)
 {
     // TODO: can we break this class up in some way?  Perhaps we can
     // spread some functionality into TestSentence and some into MaxentTagger
     // TODO: at the very least, it doesn't seem to make sense to make it
     // an object with state, rather than just some static methods
     // TODO: only one boolean here instead of 4?  They all use the same
     // debug status
     this.maxentTagger = maxentTagger;
     this.config       = maxentTagger.config;
     SetDebug(config.GetDebug());
     fileRecord = TaggedFileRecord.CreateRecord(config, testFile);
     saveRoot   = config.GetDebugPrefix();
     if (saveRoot == null || saveRoot.Equals(string.Empty))
     {
         saveRoot = fileRecord.Filename();
     }
     Test();
     if (writeConfusionMatrix)
     {
         PrintFile pf = new PrintFile(saveRoot + ".confusion");
         pf.Write(confusionMatrix.ToString());
         pf.Close();
     }
 }