/** Insert a term into this document, occurs at given block id, and in the given field */ public void insert(String t, int fieldId, int blockId) { super.insert(t, fieldId); TIntHashSet blockids = null; if ((blockids = term_blocks.get(t)) == null) { term_blocks.put(t, blockids = new TIntHashSet(/*TODO */)); } blockids.add(blockId); blockCount++; }
/** Insert a term into this document, occurs at given block id, and in the given fields */ public void insert(String t, int[] fieldIds, int blockId) { super.insert(t, fieldIds); TIntHashSet blockids = null; if ((blockids = term_blocks.get(t)) == null) { term_blocks.put(t, blockids = new TIntHashSet(/*TODO */)); } blockids.add(blockId); blockCount++; }
/** Insert a term into this document tf times, occurs at given block id, and in the given fields */ public void insert(int tf, String t, int[] fieldIds, int blockId) { super.insert(tf, t, fieldIds); TIntHashSet blockids = null; if ((blockids = term_blocks.get(t)) == null) { term_blocks.put(t, blockids = new TIntHashSet(/*TODO */)); } blockids.add(blockId); blockCount++; }
public void processTerm(String term) { if (term != null) { TIntHashSet freqs = new TIntHashSet(0); for (String docField : docFields) freqs.add(fieldIDs.get(docField)); if (fieldIDs.containsKey("ELSE") && freqs.size() == 0) freqs.add(fieldIDs.get("ELSE")); ((FieldDocumentPostingList) fdpl).insert(term, freqs.toArray()); } }
public void processTerm(String term) { /* null means the term has been filtered out (eg stopwords) */ if (term != null) { /* add term to Document tree */ for (String fieldName: termFields) { int tmp = fieldNames.get(fieldName); if (tmp > 0) { fields.add(tmp -1); } } if (ELSE_ENABLED && fields.size() == 0) { fields.add(ELSE_FIELD_ID); } ((FieldDocumentPostingList)termsInDocument).insert(term,fields.toArray()); numOfTokensInDocument++; fields.clear(); } }
public void processTerm(String term) { /* null means the term has been filtered out (eg stopwords) */ if (term != null) { /* add term to Document tree */ for (String fieldName: termFields) { int tmp = fieldNames.get(fieldName); if (tmp > 0) { fields.add(tmp -1); } } if (ELSE_ENABLED && fields.size() == 0) { fields.add(ELSE_FIELD_ID); } ((FieldDocumentPostingList)termsInDocument).insert(term,fields.toArray()); numOfTokensInDocument++; fields.clear(); } } @Override