Exemplo n.º 1
0
 public virtual string Tag()
 {
     return(label.Tag());
 }
Exemplo n.º 2
0
 public static string WordToString <T>(T o, bool justValue, string separator)
 {
     if (justValue && o is ILabel)
     {
         if (o is CoreLabel)
         {
             CoreLabel l = (CoreLabel)o;
             string    w = l.Value();
             if (w == null)
             {
                 w = l.Word();
             }
             return(w);
         }
         else
         {
             return(((ILabel)o).Value());
         }
     }
     else
     {
         if (o is CoreLabel)
         {
             CoreLabel l = ((CoreLabel)o);
             string    w = l.Value();
             if (w == null)
             {
                 w = l.Word();
             }
             if (l.Tag() != null)
             {
                 if (separator == null)
                 {
                     return(w + CoreLabel.TagSeparator + l.Tag());
                 }
                 else
                 {
                     return(w + separator + l.Tag());
                 }
             }
             return(w);
         }
         else
         {
             // an interface that covered these next four cases would be
             // nice, but we're moving away from these data types anyway
             if (separator != null && o is TaggedWord)
             {
                 return(((TaggedWord)o).ToString(separator));
             }
             else
             {
                 if (separator != null && o is LabeledWord)
                 {
                     return(((LabeledWord)o).ToString(separator));
                 }
                 else
                 {
                     if (separator != null && o is WordLemmaTag)
                     {
                         return(((WordLemmaTag)o).ToString(separator));
                     }
                     else
                     {
                         if (separator != null && o is WordTag)
                         {
                             return(((WordTag)o).ToString(separator));
                         }
                         else
                         {
                             return(o.ToString());
                         }
                     }
                 }
             }
         }
     }
 }