NameFinderME implements TokenNameFinder { public static Span[] dropOverlappingSpans(Span spans[]) { List<Span> sortedSpans = new ArrayList<Span>(spans.length); Collections.addAll(sortedSpans, spans); Collections.sort(sortedSpans); Iterator<Span> it = sortedSpans.iterator(); Span lastSpan = null; while (it.hasNext()) { Span span = it.next(); if (lastSpan != null) { if (lastSpan.intersects(span)) { it.remove(); span = lastSpan; } } lastSpan = span; } return sortedSpans.toArray(new Span[sortedSpans.size()]); } NameFinderME(TokenNameFinderModel model);  NameFinderME(TokenNameFinderModel model, AdaptiveFeatureGenerator generator, int beamSize,
      SequenceValidator<String> sequenceValidator);  NameFinderME(TokenNameFinderModel model, AdaptiveFeatureGenerator generator, int beamSize);  NameFinderME(TokenNameFinderModel model, int beamSize); @Deprecated  NameFinderME(MaxentModel mod); @Deprecated  NameFinderME(MaxentModel mod, NameContextGenerator cg); @Deprecated  NameFinderME(MaxentModel mod, NameContextGenerator cg, int beamSize); Span[] find(String[] tokens); Span[] find(String[] tokens, String[][] additionalContext); void clearAdaptiveData(); void probs(double[] probs); double[] probs(); double[] probs(Span[] spans); static TokenNameFinderModel train(String languageCode, String type, ObjectStream<NameSample> samples,
       TrainingParameters trainParams, AdaptiveFeatureGenerator generator, final Map<String, Object> resources); static TokenNameFinderModel train(String languageCode, String type,
      ObjectStream<NameSample> samples, TrainingParameters trainParams,
      byte[] featureGeneratorBytes, final Map<String, Object> resources); static TokenNameFinderModel train(String languageCode, String type, ObjectStream<NameSample> samples,
       AdaptiveFeatureGenerator generator, final Map<String, Object> resources,
       int iterations, int cutoff); @Deprecated static TokenNameFinderModel train(String languageCode, String type, ObjectStream<NameSample> samples,
       final Map<String, Object> resources, int iterations, int cutoff); static TokenNameFinderModel train(String languageCode, String type, ObjectStream<NameSample> samples,
       final Map<String, Object> resources); @Deprecated static TokenNameFinderModel train(String languageCode, String type, ObjectStream<NameSample> samples,
       byte[] generatorDescriptor, final Map<String, Object> resources,
       int iterations, int cutoff); @Deprecated static GISModel train(EventStream es, int iterations, int cut); static Span[] dropOverlappingSpans(Span spans[]); static final int DEFAULT_BEAM_SIZE; static final String START; static final String CONTINUE; static final String OTHER; }
@Test public void testDropOverlappingSpans() { Span spans[] = new Span[] {new Span(1, 10), new Span(1,11), new Span(1,11), new Span(5, 15)}; Span remainingSpan[] = NameFinderME.dropOverlappingSpans(spans); assertEquals(new Span(1, 11), remainingSpan[0]); }