private static Pair <int, int> GetSpan(IList <CoreLabel> tokens, IToIntFunction <CoreLabel> toMin, IToIntFunction <CoreLabel> toMax)
        {
            int min = int.MaxValue;
            int max = int.MinValue;

            foreach (CoreLabel token in tokens)
            {
                min = Math.Min(min, toMin.ApplyAsInt(token));
                max = Math.Max(max, toMax.ApplyAsInt(token) + 1);
            }
            return(Pair.MakePair(min, max));
        }
Beispiel #2
0
 public override int Size()
 {
     return(sizeFn.ApplyAsInt(null));
 }