Java 类org.apache.lucene.search.vectorhighlight.FieldPhraseList.WeightedPhraseInfo.Toffs 实例源码

项目:search    文件:BaseFragmentsBuilder.java   
protected String makeFragment( StringBuilder buffer, int[] index, Field[] values, WeightedFragInfo fragInfo,
    String[] preTags, String[] postTags, Encoder encoder ){
  StringBuilder fragment = new StringBuilder();
  final int s = fragInfo.getStartOffset();
  int[] modifiedStartOffset = { s };
  String src = getFragmentSourceMSO( buffer, index, values, s, fragInfo.getEndOffset(), modifiedStartOffset );
  int srcIndex = 0;
  for( SubInfo subInfo : fragInfo.getSubInfos() ){
    for( Toffs to : subInfo.getTermsOffsets() ){
      fragment
        .append( encoder.encodeText( src.substring( srcIndex, to.getStartOffset() - modifiedStartOffset[0] ) ) )
        .append( getPreTag( preTags, subInfo.getSeqnum() ) )
        .append( encoder.encodeText( src.substring( to.getStartOffset() - modifiedStartOffset[0], to.getEndOffset() - modifiedStartOffset[0] ) ) )
        .append( getPostTag( postTags, subInfo.getSeqnum() ) );
      srcIndex = to.getEndOffset() - modifiedStartOffset[0];
    }
  }
  fragment.append( encoder.encodeText( src.substring( srcIndex ) ) );
  return fragment.toString();
}
项目:search    文件:FieldPhraseListTest.java   
public void testToffsComparisonConsistency() {
  Toffs a = new Toffs( 0, 0 );
  Toffs b = new Toffs( 1, 2 );
  Toffs c = new Toffs( 2, 3 );
  Toffs d = new Toffs( 0, 0 );

  assertConsistentEquals( a, a );
  assertConsistentEquals( b, b );
  assertConsistentEquals( c, c );
  assertConsistentEquals( d, d );
  assertConsistentEquals( a, d );
  assertConsistentLessThan( a, b );
  assertConsistentLessThan( b, c );
  assertConsistentLessThan( a, c );
  assertConsistentLessThan( d, b );
  assertConsistentLessThan( d, c );
}
项目:NYBC    文件:BaseFragmentsBuilder.java   
protected String makeFragment( StringBuilder buffer, int[] index, Field[] values, WeightedFragInfo fragInfo,
    String[] preTags, String[] postTags, Encoder encoder ){
  StringBuilder fragment = new StringBuilder();
  final int s = fragInfo.getStartOffset();
  int[] modifiedStartOffset = { s };
  String src = getFragmentSourceMSO( buffer, index, values, s, fragInfo.getEndOffset(), modifiedStartOffset );
  int srcIndex = 0;
  for( SubInfo subInfo : fragInfo.getSubInfos() ){
    for( Toffs to : subInfo.getTermsOffsets() ){
      fragment
        .append( encoder.encodeText( src.substring( srcIndex, to.getStartOffset() - modifiedStartOffset[0] ) ) )
        .append( getPreTag( preTags, subInfo.getSeqnum() ) )
        .append( encoder.encodeText( src.substring( to.getStartOffset() - modifiedStartOffset[0], to.getEndOffset() - modifiedStartOffset[0] ) ) )
        .append( getPostTag( postTags, subInfo.getSeqnum() ) );
      srcIndex = to.getEndOffset() - modifiedStartOffset[0];
    }
  }
  fragment.append( encoder.encodeText( src.substring( srcIndex ) ) );
  return fragment.toString();
}
项目:read-open-source-code    文件:BaseFragmentsBuilder.java   
protected String makeFragment( StringBuilder buffer, int[] index, Field[] values, WeightedFragInfo fragInfo,
    String[] preTags, String[] postTags, Encoder encoder ){
  StringBuilder fragment = new StringBuilder();
  final int s = fragInfo.getStartOffset();
  int[] modifiedStartOffset = { s };
  String src = getFragmentSourceMSO( buffer, index, values, s, fragInfo.getEndOffset(), modifiedStartOffset );
  int srcIndex = 0;
  for( SubInfo subInfo : fragInfo.getSubInfos() ){
    for( Toffs to : subInfo.getTermsOffsets() ){
      fragment
        .append( encoder.encodeText( src.substring( srcIndex, to.getStartOffset() - modifiedStartOffset[0] ) ) )
        .append( getPreTag( preTags, subInfo.getSeqnum() ) )
        .append( encoder.encodeText( src.substring( to.getStartOffset() - modifiedStartOffset[0], to.getEndOffset() - modifiedStartOffset[0] ) ) )
        .append( getPostTag( postTags, subInfo.getSeqnum() ) );
      srcIndex = to.getEndOffset() - modifiedStartOffset[0];
    }
  }
  fragment.append( encoder.encodeText( src.substring( srcIndex ) ) );
  return fragment.toString();
}
项目:read-open-source-code    文件:BaseFragmentsBuilder.java   
protected String makeFragment( StringBuilder buffer, int[] index, Field[] values, WeightedFragInfo fragInfo,
    String[] preTags, String[] postTags, Encoder encoder ){
  StringBuilder fragment = new StringBuilder();
  final int s = fragInfo.getStartOffset();
  int[] modifiedStartOffset = { s };
  String src = getFragmentSourceMSO( buffer, index, values, s, fragInfo.getEndOffset(), modifiedStartOffset );
  int srcIndex = 0;
  for( SubInfo subInfo : fragInfo.getSubInfos() ){
    for( Toffs to : subInfo.getTermsOffsets() ){
      fragment
        .append( encoder.encodeText( src.substring( srcIndex, to.getStartOffset() - modifiedStartOffset[0] ) ) )
        .append( getPreTag( preTags, subInfo.getSeqnum() ) )
        .append( encoder.encodeText( src.substring( to.getStartOffset() - modifiedStartOffset[0], to.getEndOffset() - modifiedStartOffset[0] ) ) )
        .append( getPostTag( postTags, subInfo.getSeqnum() ) );
      srcIndex = to.getEndOffset() - modifiedStartOffset[0];
    }
  }
  fragment.append( encoder.encodeText( src.substring( srcIndex ) ) );
  return fragment.toString();
}
项目:read-open-source-code    文件:BaseFragmentsBuilder.java   
protected String makeFragment( StringBuilder buffer, int[] index, Field[] values, WeightedFragInfo fragInfo,
    String[] preTags, String[] postTags, Encoder encoder ){
  StringBuilder fragment = new StringBuilder();
  final int s = fragInfo.getStartOffset();
  int[] modifiedStartOffset = { s };
  String src = getFragmentSourceMSO( buffer, index, values, s, fragInfo.getEndOffset(), modifiedStartOffset );
  int srcIndex = 0;
  for( SubInfo subInfo : fragInfo.getSubInfos() ){
    for( Toffs to : subInfo.getTermsOffsets() ){
      fragment
        .append( encoder.encodeText( src.substring( srcIndex, to.getStartOffset() - modifiedStartOffset[0] ) ) )
        .append( getPreTag( preTags, subInfo.getSeqnum() ) )
        .append( encoder.encodeText( src.substring( to.getStartOffset() - modifiedStartOffset[0], to.getEndOffset() - modifiedStartOffset[0] ) ) )
        .append( getPostTag( postTags, subInfo.getSeqnum() ) );
      srcIndex = to.getEndOffset() - modifiedStartOffset[0];
    }
  }
  fragment.append( encoder.encodeText( src.substring( srcIndex ) ) );
  return fragment.toString();
}
项目:Maskana-Gestor-de-Conocimiento    文件:BaseFragmentsBuilder.java   
protected String makeFragment( StringBuilder buffer, int[] index, Field[] values, WeightedFragInfo fragInfo,
    String[] preTags, String[] postTags, Encoder encoder ){
  StringBuilder fragment = new StringBuilder();
  final int s = fragInfo.getStartOffset();
  int[] modifiedStartOffset = { s };
  String src = getFragmentSourceMSO( buffer, index, values, s, fragInfo.getEndOffset(), modifiedStartOffset );
  int srcIndex = 0;
  for( SubInfo subInfo : fragInfo.getSubInfos() ){
    for( Toffs to : subInfo.getTermsOffsets() ){
      fragment
        .append( encoder.encodeText( src.substring( srcIndex, to.getStartOffset() - modifiedStartOffset[0] ) ) )
        .append( getPreTag( preTags, subInfo.getSeqnum() ) )
        .append( encoder.encodeText( src.substring( to.getStartOffset() - modifiedStartOffset[0], to.getEndOffset() - modifiedStartOffset[0] ) ) )
        .append( getPostTag( postTags, subInfo.getSeqnum() ) );
      srcIndex = to.getEndOffset() - modifiedStartOffset[0];
    }
  }
  fragment.append( encoder.encodeText( src.substring( srcIndex ) ) );
  return fragment.toString();
}
项目:Maskana-Gestor-de-Conocimiento    文件:FieldPhraseListTest.java   
public void testToffsComparisonConsistency() {
  Toffs a = new Toffs( 0, 0 );
  Toffs b = new Toffs( 1, 2 );
  Toffs c = new Toffs( 2, 3 );
  Toffs d = new Toffs( 0, 0 );

  assertConsistentEquals( a, a );
  assertConsistentEquals( b, b );
  assertConsistentEquals( c, c );
  assertConsistentEquals( d, d );
  assertConsistentEquals( a, d );
  assertConsistentLessThan( a, b );
  assertConsistentLessThan( b, c );
  assertConsistentLessThan( a, c );
  assertConsistentLessThan( d, b );
  assertConsistentLessThan( d, c );
}
项目:search    文件:FieldFragList.java   
@Override
public String toString(){
  StringBuilder sb = new StringBuilder();
  sb.append( text ).append( '(' );
  for( Toffs to : termsOffsets )
    sb.append( to.toString() );
  sb.append( ')' );
  return sb.toString();
}
项目:NYBC    文件:FieldFragList.java   
@Override
public String toString(){
  StringBuilder sb = new StringBuilder();
  sb.append( text ).append( '(' );
  for( Toffs to : termsOffsets )
    sb.append( to.toString() );
  sb.append( ')' );
  return sb.toString();
}
项目:read-open-source-code    文件:FieldFragList.java   
@Override
public String toString(){
  StringBuilder sb = new StringBuilder();
  sb.append( text ).append( '(' );
  for( Toffs to : termsOffsets )
    sb.append( to.toString() );
  sb.append( ')' );
  return sb.toString();
}
项目:read-open-source-code    文件:FieldFragList.java   
@Override
public String toString(){
  StringBuilder sb = new StringBuilder();
  sb.append( text ).append( '(' );
  for( Toffs to : termsOffsets )
    sb.append( to.toString() );
  sb.append( ')' );
  return sb.toString();
}
项目:read-open-source-code    文件:FieldFragList.java   
@Override
public String toString(){
  StringBuilder sb = new StringBuilder();
  sb.append( text ).append( '(' );
  for( Toffs to : termsOffsets )
    sb.append( to.toString() );
  sb.append( ')' );
  return sb.toString();
}
项目:Maskana-Gestor-de-Conocimiento    文件:FieldFragList.java   
@Override
public String toString(){
  StringBuilder sb = new StringBuilder();
  sb.append( text ).append( '(' );
  for( Toffs to : termsOffsets )
    sb.append( to.toString() );
  sb.append( ')' );
  return sb.toString();
}
项目:search    文件:FieldFragList.java   
public SubInfo( String text, List<Toffs> termsOffsets, int seqnum, float boost ){
  this.text = text;
  this.termsOffsets = termsOffsets;
  this.seqnum = seqnum;
  this.boost = boost;
}
项目:search    文件:FieldFragList.java   
public List<Toffs> getTermsOffsets(){
  return termsOffsets;
}
项目:NYBC    文件:FieldFragList.java   
public SubInfo( String text, List<Toffs> termsOffsets, int seqnum ){
  this.text = text;
  this.termsOffsets = termsOffsets;
  this.seqnum = seqnum;
}
项目:NYBC    文件:FieldFragList.java   
public List<Toffs> getTermsOffsets(){
  return termsOffsets;
}
项目:read-open-source-code    文件:FieldFragList.java   
public SubInfo( String text, List<Toffs> termsOffsets, int seqnum, float boost ){
  this.text = text;
  this.termsOffsets = termsOffsets;
  this.seqnum = seqnum;
  this.boost = boost;
}
项目:read-open-source-code    文件:FieldFragList.java   
public List<Toffs> getTermsOffsets(){
  return termsOffsets;
}
项目:read-open-source-code    文件:FieldFragList.java   
public SubInfo( String text, List<Toffs> termsOffsets, int seqnum, float boost ){
  this.text = text;
  this.termsOffsets = termsOffsets;
  this.seqnum = seqnum;
  this.boost = boost;
}
项目:read-open-source-code    文件:FieldFragList.java   
public List<Toffs> getTermsOffsets(){
  return termsOffsets;
}
项目:read-open-source-code    文件:FieldFragList.java   
public SubInfo( String text, List<Toffs> termsOffsets, int seqnum, float boost ){
  this.text = text;
  this.termsOffsets = termsOffsets;
  this.seqnum = seqnum;
  this.boost = boost;
}
项目:read-open-source-code    文件:FieldFragList.java   
public List<Toffs> getTermsOffsets(){
  return termsOffsets;
}
项目:Maskana-Gestor-de-Conocimiento    文件:FieldFragList.java   
public SubInfo( String text, List<Toffs> termsOffsets, int seqnum ){
  this.text = text;
  this.termsOffsets = termsOffsets;
  this.seqnum = seqnum;
}
项目:Maskana-Gestor-de-Conocimiento    文件:FieldFragList.java   
public List<Toffs> getTermsOffsets(){
  return termsOffsets;
}