Пример #1
0
 // end main()
 private static void PrintPunct(Treebank treebank, ITreebankLanguagePack tlp, PrintWriter pw)
 {
     if (tlp == null)
     {
         log.Info("The -punct option requires you to specify -tlp");
     }
     else
     {
         IPredicate <string> punctTagFilter = tlp.PunctuationTagAcceptFilter();
         foreach (Tree t in treebank)
         {
             IList <TaggedWord> tws = t.TaggedYield();
             foreach (TaggedWord tw in tws)
             {
                 if (punctTagFilter.Test(tw.Tag()))
                 {
                     pw.Println(tw);
                 }
             }
         }
     }
 }