Java 类org.apache.lucene.analysis.ja.JapaneseTokenizer.WrappedPositionArray 实例源码

项目:search    文件:GraphvizFormatter.java   
private void setBestPathMap(WrappedPositionArray positions, int startPos, Position endPosData, int fromIDX) {
  bestPathMap.clear();

  int pos = endPosData.pos;
  int bestIDX = fromIDX;
  while (pos > startPos) {
    final Position posData = positions.get(pos);

    final int backPos = posData.backPos[bestIDX];
    final int backIDX = posData.backIndex[bestIDX];

    final String toNodeID = getNodeID(pos, bestIDX);
    final String fromNodeID = getNodeID(backPos, backIDX);

    assert !bestPathMap.containsKey(fromNodeID);
    assert !bestPathMap.containsValue(toNodeID);
    bestPathMap.put(fromNodeID, toNodeID);
    pos = backPos;
    bestIDX = backIDX;
  }
}
项目:NYBC    文件:GraphvizFormatter.java   
private void setBestPathMap(WrappedPositionArray positions, int startPos, Position endPosData, int fromIDX) {
  bestPathMap.clear();

  int pos = endPosData.pos;
  int bestIDX = fromIDX;
  while (pos > startPos) {
    final Position posData = positions.get(pos);

    final int backPos = posData.backPos[bestIDX];
    final int backIDX = posData.backIndex[bestIDX];

    final String toNodeID = getNodeID(pos, bestIDX);
    final String fromNodeID = getNodeID(backPos, backIDX);

    assert !bestPathMap.containsKey(fromNodeID);
    assert !bestPathMap.containsValue(toNodeID);
    bestPathMap.put(fromNodeID, toNodeID);
    pos = backPos;
    bestIDX = backIDX;
  }
}
项目:read-open-source-code    文件:GraphvizFormatter.java   
private void setBestPathMap(WrappedPositionArray positions, int startPos, Position endPosData, int fromIDX) {
  bestPathMap.clear();

  int pos = endPosData.pos;
  int bestIDX = fromIDX;
  while (pos > startPos) {
    final Position posData = positions.get(pos);

    final int backPos = posData.backPos[bestIDX];
    final int backIDX = posData.backIndex[bestIDX];

    final String toNodeID = getNodeID(pos, bestIDX);
    final String fromNodeID = getNodeID(backPos, backIDX);

    assert !bestPathMap.containsKey(fromNodeID);
    assert !bestPathMap.containsValue(toNodeID);
    bestPathMap.put(fromNodeID, toNodeID);
    pos = backPos;
    bestIDX = backIDX;
  }
}
项目:read-open-source-code    文件:GraphvizFormatter.java   
private void setBestPathMap(WrappedPositionArray positions, int startPos, Position endPosData, int fromIDX) {
  bestPathMap.clear();

  int pos = endPosData.pos;
  int bestIDX = fromIDX;
  while (pos > startPos) {
    final Position posData = positions.get(pos);

    final int backPos = posData.backPos[bestIDX];
    final int backIDX = posData.backIndex[bestIDX];

    final String toNodeID = getNodeID(pos, bestIDX);
    final String fromNodeID = getNodeID(backPos, backIDX);

    assert !bestPathMap.containsKey(fromNodeID);
    assert !bestPathMap.containsValue(toNodeID);
    bestPathMap.put(fromNodeID, toNodeID);
    pos = backPos;
    bestIDX = backIDX;
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:GraphvizFormatter.java   
private void setBestPathMap(WrappedPositionArray positions, int startPos, Position endPosData, int fromIDX) {
  bestPathMap.clear();

  int pos = endPosData.pos;
  int bestIDX = fromIDX;
  while (pos > startPos) {
    final Position posData = positions.get(pos);

    final int backPos = posData.backPos[bestIDX];
    final int backIDX = posData.backIndex[bestIDX];

    final String toNodeID = getNodeID(pos, bestIDX);
    final String fromNodeID = getNodeID(backPos, backIDX);

    assert !bestPathMap.containsKey(fromNodeID);
    assert !bestPathMap.containsValue(toNodeID);
    bestPathMap.put(fromNodeID, toNodeID);
    pos = backPos;
    bestIDX = backIDX;
  }
}
项目:search    文件:GraphvizFormatter.java   
void onBacktrace(JapaneseTokenizer tok, WrappedPositionArray positions, int lastBackTracePos, Position endPosData, int fromIDX, char[] fragment, boolean isEnd) {
  setBestPathMap(positions, lastBackTracePos, endPosData, fromIDX);
  sb.append(formatNodes(tok, positions, lastBackTracePos, endPosData, fragment));
  if (isEnd) {
    sb.append("  fini [style=invis]\n");
    sb.append("  ");
    sb.append(getNodeID(endPosData.pos, fromIDX));
    sb.append(" -> fini [label=\"" + EOS_LABEL + "\"]");
  }
}
项目:NYBC    文件:GraphvizFormatter.java   
void onBacktrace(JapaneseTokenizer tok, WrappedPositionArray positions, int lastBackTracePos, Position endPosData, int fromIDX, char[] fragment, boolean isEnd) {
  setBestPathMap(positions, lastBackTracePos, endPosData, fromIDX);
  sb.append(formatNodes(tok, positions, lastBackTracePos, endPosData, fragment));
  if (isEnd) {
    sb.append("  fini [style=invis]\n");
    sb.append("  ");
    sb.append(getNodeID(endPosData.pos, fromIDX));
    sb.append(" -> fini [label=\"" + EOS_LABEL + "\"]");
  }
}
项目:read-open-source-code    文件:GraphvizFormatter.java   
void onBacktrace(JapaneseTokenizer tok, WrappedPositionArray positions, int lastBackTracePos, Position endPosData, int fromIDX, char[] fragment, boolean isEnd) {
  setBestPathMap(positions, lastBackTracePos, endPosData, fromIDX);
  sb.append(formatNodes(tok, positions, lastBackTracePos, endPosData, fragment));
  if (isEnd) {
    sb.append("  fini [style=invis]\n");
    sb.append("  ");
    sb.append(getNodeID(endPosData.pos, fromIDX));
    sb.append(" -> fini [label=\"" + EOS_LABEL + "\"]");
  }
}
项目:read-open-source-code    文件:GraphvizFormatter.java   
void onBacktrace(JapaneseTokenizer tok, WrappedPositionArray positions, int lastBackTracePos, Position endPosData, int fromIDX, char[] fragment, boolean isEnd) {
  setBestPathMap(positions, lastBackTracePos, endPosData, fromIDX);
  sb.append(formatNodes(tok, positions, lastBackTracePos, endPosData, fragment));
  if (isEnd) {
    sb.append("  fini [style=invis]\n");
    sb.append("  ");
    sb.append(getNodeID(endPosData.pos, fromIDX));
    sb.append(" -> fini [label=\"" + EOS_LABEL + "\"]");
  }
}
项目:Maskana-Gestor-de-Conocimiento    文件:GraphvizFormatter.java   
void onBacktrace(JapaneseTokenizer tok, WrappedPositionArray positions, int lastBackTracePos, Position endPosData, int fromIDX, char[] fragment, boolean isEnd) {
  setBestPathMap(positions, lastBackTracePos, endPosData, fromIDX);
  sb.append(formatNodes(tok, positions, lastBackTracePos, endPosData, fragment));
  if (isEnd) {
    sb.append("  fini [style=invis]\n");
    sb.append("  ");
    sb.append(getNodeID(endPosData.pos, fromIDX));
    sb.append(" -> fini [label=\"" + EOS_LABEL + "\"]");
  }
}