private void analyzeSeedDocument(Document inputDocument,Map<String,List<String[]>> fieldName2tokensArray,Map<String,Float> fieldName2boost) throws IOException {
  for (int i=0; i < textFieldNames.length; i++) {
    String fieldName=textFieldNames[i];
    float boost=1;
    List<String[]> tokenizedValues=new LinkedList<>();
    if (fieldName.contains("^")) {
      String[] field2boost=fieldName.split("\\^");
      fieldName=field2boost[0];
      boost=Float.parseFloat(field2boost[1]);
    }
    IndexableField[] fieldValues=inputDocument.getFields(fieldName);
    for (    IndexableField fieldValue : fieldValues) {
      TokenStream fieldTokens=fieldValue.tokenStream(field2analyzer.get(fieldName),null);
      String[] fieldTokensArray=getTokenArray(fieldTokens);
      tokenizedValues.add(fieldTokensArray);
    }
    fieldName2tokensArray.put(fieldName,tokenizedValues);
    fieldName2boost.put(fieldName,boost);
    textFieldNames[i]=fieldName;
  }
}

private void analyzeSeedDocument ( Document inputDocument , Map < String , List < String [ ] > > fieldName2tokensArray , Map < String , Float > fieldName2boost ) throws IOException { for ( int i = 0 ; i < textFieldNames . length ; i ++ ) { String fieldName = textFieldNames [ i ] ; float boost = 1 ; List < String [ ] > tokenizedValues = new LinkedList < > ( ) ; if ( fieldName . contains ( "^" ) ) { String [ ] field2boost = fieldName . split ( "\\^" ) ; fieldName = field2boost [ 0 ] ; boost = Float . parseFloat ( field2boost [ 1 ] ) ; } IndexableField [ ] fieldValues = inputDocument . getFields ( fieldName ) ; for ( IndexableField fieldValue : fieldValues ) { TokenStream fieldTokens = fieldValue . tokenStream ( field2analyzer . get ( fieldName ) , null ) ; String [ ] fieldTokensArray = getTokenArray ( fieldTokens ) ; tokenizedValues . add ( fieldTokensArray ) ; } fieldName2tokensArray . put ( fieldName , tokenizedValues ) ; fieldName2boost . put ( fieldName , boost ) ; textFieldNames [ i ] = fieldName ; } }
this methods performs the analysis for the seed document and extract the boosts if present . this is done only one time for the seed document .
