Commits

David McClosky  committed 17ff02a

first-stage/TRAIN/InputTree: Slightly better error messages for corpus reading

  • Participants
  • Parent commits 5963163

Comments (0)

Files changed (1)

File first-stage/TRAIN/InputTree.C

 	}
       else
 	{
-	  cerr << temp << " is not legal topmost type" << endl;
+	  cerr << temp << " is not a legal topmost type (skipping sentence)" << endl;
 	  flushConstit(is);
 	  return;
 	}
     {
       //ans->term() = auxify(wrd,trm);
       ans->headTree() = ans;
-      assert( (Term::get(ans->term()))->terminal_p() );
+      if (!(Term::get(ans->term()))->terminal_p()) {
+          cerr << "Word: " << wrd << endl;
+          cerr << "Term: " << trm << endl;
+          cerr << "Corpus error: The term a phrasal term but it's being used as a part of speech tag." << endl;
+          assert( (Term::get(ans->term()))->terminal_p() );
+      }
     }
   else
     {