Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.owasp.dependencycheck.data.lucene
Class TokenPairConcatenatingFilter

    java.lang.Object
      org.apache.lucene.util.AttributeSource
          org.apache.lucene.analysis.TokenStream
              org.apache.lucene.analysis.TokenFilter
                  org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter

All Implemented Interfaces:
  Closeable

    public final class TokenPairConcatenatingFilter

extends org.apache.lucene.analysis.TokenFilter

Takes a TokenStream and adds additional tokens by concatenating pairs of words.

Example: "Spring Framework Core" -> "Spring SpringFramework Framework FrameworkCore Core".

Author:
  Jeremy Long (jeremy.long@owasp.org)

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
`org.apache.lucene.util.AttributeSource.AttributeFactory, org.apache.lucene.util.AttributeSource.State`

Field Summary

Fields inherited from class org.apache.lucene.analysis.TokenFilter
`input`

Constructor Summary
`TokenPairConcatenatingFilter(org.apache.lucene.analysis.TokenStream stream)` Constructs a new TokenPairConcatenatingFilter.

Method Summary
`void` | `clear()` Resets the Filter and clears any internal state data that may have been left-over from previous uses of the Filter.
`protected String` | `getPreviousWord()` Returns the previous word.
`protected LinkedList<String>` | `getWords()` Returns the words list.
`boolean` | `incrementToken()` Increments the underlying TokenStream and sets CharTermAttributes to construct an expanded set of tokens by concatenating tokens with the previous token.

Methods inherited from class org.apache.lucene.analysis.TokenFilter
`close, end, reset`

Methods inherited from class org.apache.lucene.util.AttributeSource
`addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TokenPairConcatenatingFilter

    public TokenPairConcatenatingFilter(org.apache.lucene.analysis.TokenStream stream)

  Constructs a new TokenPairConcatenatingFilter.

  Parameters:
    `stream` - the TokenStream that this filter will process

Method Detail

### getPreviousWord

    protected String getPreviousWord()

  Returns the previous word. This is needed in the test cases.

  Returns:
    te previous word

### getWords

    protected LinkedList<String> getWords()

  Returns the words list. This is needed in the test cases.

  Returns:
    the words list

### incrementToken

    public boolean incrementToken()
                           throws IOException

  Increments the underlying TokenStream and sets CharTermAttributes to construct an expanded set of tokens by concatenating tokens with the previous token.

  Specified by:
    `incrementToken` in class `org.apache.lucene.analysis.TokenStream`
  Returns:
    whether or not we have hit the end of the TokenStream
  Throws:
    `IOException` - is thrown when an IOException occurs

### clear

    public void clear()

  Resets the Filter and clears any internal state data that may have been left-over from previous uses of the Filter.

  If this Filter is re-used this method must be called between uses.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012-2013 OWASP. All Rights Reserved.