Java 类com.intellij.openapi.util.text.TrigramBuilder 实例源码

项目:tools-idea    文件:TrigramIndex.java   
@NotNull
@Override
public DataIndexer<Integer, Void, FileContent> getIndexer() {
  return new DataIndexer<Integer, Void, FileContent>() {
    @Override
    @NotNull
    public Map<Integer, Void> map(FileContent inputData) {
      final Map<Integer, Void> result = new THashMap<Integer, Void>();
      TIntHashSet built = TrigramBuilder.buildTrigram(inputData.getContentAsText());
      built.forEach(new TIntProcedure() {
        @Override
        public boolean execute(int value) {
          result.put(value, null);
          return true;
        }
      });
      return result;
    }
  };
}
项目:intellij-ce-playground    文件:TrigramIndex.java   
@NotNull
@Override
public DataIndexer<Integer, Void, FileContent> getIndexer() {
  return new DataIndexer<Integer, Void, FileContent>() {
    @Override
    @NotNull
    public Map<Integer, Void> map(@NotNull FileContent inputData) {
      MyTrigramProcessor trigramProcessor = new MyTrigramProcessor();
      TrigramBuilder.processTrigrams(inputData.getContentAsText(), trigramProcessor);

      return trigramProcessor.map;
    }
  };
}
项目:intellij-ce-playground    文件:FindInProjectTask.java   
private static boolean hasTrigrams(@NotNull String text) {
  return TrigramIndex.ENABLED &&
         !TrigramBuilder.processTrigrams(text, new TrigramBuilder.TrigramProcessor() {
           @Override
           public boolean execute(int value) {
             return false;
           }
         });
}
项目:consulo    文件:VcsLogMessagesTrigramIndex.java   
@Nullable
public TIntHashSet getCommitsForSubstring(@Nonnull String string) throws StorageException {
  MyTrigramProcessor trigramProcessor = new MyTrigramProcessor();
  TrigramBuilder.processTrigrams(string, trigramProcessor);

  if (trigramProcessor.map.isEmpty()) return null;

  return getCommitsWithAllKeys(trigramProcessor.map.keySet());
}
项目:consulo    文件:VcsLogMessagesTrigramIndex.java   
@Nonnull
@Override
public Map<Integer, Void> map(@Nonnull VcsFullCommitDetails inputData) {
  MyTrigramProcessor trigramProcessor = new MyTrigramProcessor();
  TrigramBuilder.processTrigrams(inputData.getFullMessage(), trigramProcessor);

  return trigramProcessor.map;
}
项目:consulo    文件:TrigramIndex.java   
@Nonnull
@Override
public DataIndexer<Integer, Void, FileContent> getIndexer() {
  return new DataIndexer<Integer, Void, FileContent>() {
    @Override
    @Nonnull
    public Map<Integer, Void> map(@Nonnull FileContent inputData) {
      MyTrigramProcessor trigramProcessor = new MyTrigramProcessor();
      TrigramBuilder.processTrigrams(inputData.getContentAsText(), trigramProcessor);

      return trigramProcessor.map;
    }
  };
}
项目:consulo    文件:FindInProjectTask.java   
private static boolean hasTrigrams(@Nonnull String text) {
  return TrigramIndex.ENABLED && !TrigramBuilder.processTrigrams(text, new TrigramBuilder.TrigramProcessor() {
    @Override
    public boolean execute(int value) {
      return false;
    }
  });
}