code: private static void remainLongest(Collection<Emit> collectedEmits)
      {
          if (collectedEmits.size() < 2) return;
          Map<Integer, Emit> emitMapStart = new TreeMap<Integer, Emit>();
          for (Emit emit : collectedEmits)
          {
              Emit pre = emitMapStart.get(emit.getStart());
              if (pre == null || pre.size() < emit.size())
              {
                  emitMapStart.put(emit.getStart(), emit);
              }
          }
          if (emitMapStart.size() < 2)
          {
              collectedEmits.clear();
              collectedEmits.addAll(emitMapStart.values());
              return;
          }
          Map<Integer, Emit> emitMapEnd = new TreeMap<Integer, Emit>();
          for (Emit emit : emitMapStart.values())
          {
              Emit pre = emitMapEnd.get(emit.getEnd());
              if (pre == null || pre.size() < emit.size())
              {
                  emitMapEnd.put(emit.getEnd(), emit);
              }
          }
  
          collectedEmits.clear();
          collectedEmits.addAll(emitMapEnd.values());
      }
docs: 只保留最长词
  @param collectedEmits