MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.sms.ftstore
Class FTTokenBufferStore

java.lang.Object
  extended by ch.ethz.mxquery.sms.MMimpl.FIFOStore
      extended by ch.ethz.mxquery.sms.MMimpl.TokenBufferStore
          extended by ch.ethz.mxquery.sms.ftstore.FTTokenBufferStore
All Implemented Interfaces:
Source, FullTextStore, ActiveStore, AppendUpdate, StreamStore, MXQueryAppendUpdate

public class FTTokenBufferStore
extends TokenBufferStore
implements FullTextStore

Storage of Tokens (materialized), Linguistic Tokens and indexes on them


Field Summary
 
Fields inherited from class ch.ethz.mxquery.sms.MMimpl.TokenBufferStore
level, MAX_NODE_ID, myId, tokenBuffer
 
Fields inherited from class ch.ethz.mxquery.sms.MMimpl.FIFOStore
iterator, readThread
 
Constructor Summary
FTTokenBufferStore(int id, WindowBuffer container)
           
FTTokenBufferStore(XDMIterator sourceStream, int id, WindowBuffer container)
          Creates a new FTTokenBuffer for a stream with standard parameters
 
Method Summary
 int compare(Source store)
           
 Token get(int tokenId)
          Returns the Token for a given token id
 Token get(int tokenId, int maxNodeId)
          Returns the token for a given tokenId.
 double getInverseDocumentFrequency(java.lang.String word)
           
 LinguisticToken getLinguisticTokens(DeweyIdentifier did)
           
 PhraseIterator getLinguisticTokensExact(java.lang.String word)
           
 PhraseIterator getLinguisticTokensForMultipleWildCard(java.lang.String word)
           
 PhraseIterator getLinguisticTokensWithInfix(java.lang.String prefix, java.lang.String suffix, java.lang.String wildcard)
          returns all Linguistic Tokens for the word with prefix "prefix" and suffix "suffix" and fulfilling the wildcard predicate
 PhraseIterator getLinguisticTokensWithPrefix(java.lang.String suffix, java.lang.String wildcard)
          returns all Linguistic Tokens for the word with suffix "suffix" and fulfilling the wildcard predicate
 PhraseIterator getLinguisticTokensWithSuffix(java.lang.String prefix, java.lang.String wildcard)
          returns all Linguistic Tokens for the word with prefix "prefix" and fulfilling the wildcard predicate
 int getNumberOfDescendants()
           
 PhraseIterator getPhraseExact(java.util.Vector v, DeweyIdentifier[] ignoreId)
           
 java.util.Vector getPhraseWithStemming(java.util.Vector v)
           
 PhraseIterator getPhraseWithWildcard(java.lang.String phrase, DeweyIdentifier[] ignoreId)
           
 java.util.Vector getPhraseWithWildcards(java.util.Vector v)
           
 int getTokenIdForNode(int nodeId)
          Returns the position for a given NodePosition.
 java.lang.String getURI()
          Returns the URI of the source.
 java.util.Vector getWordsExact(java.lang.String word)
           
 java.util.Vector getWordsForMultipleWildCard(java.lang.String word)
           
 java.util.Vector getWordsForStem(java.lang.String stem)
          returns all words for the word with the stem "stem" in a vector
 java.util.Vector getWordsForWildcards(java.lang.String text)
          returns all words for the word "text" and fulfilling the wildcard predicate
 java.util.Vector getWordsWithInfix(java.lang.String prefix, java.lang.String suffix, java.lang.String wildcard)
          returns all words for the word with prefix "prefix" and suffix "suffix" and fulfilling the wildcard predicate
 java.util.Vector getWordsWithPrefix(java.lang.String suffix, java.lang.String wildcard)
          returns all words for the word with suffix "suffix" and fulfilling the wildcard predicate
 java.util.Vector getWordsWithSuffix(java.lang.String prefix, java.lang.String wildcard)
          returns all words for the word with prefix "prefix" and fulfilling the wildcard predicate
 void setUri(java.lang.String uri)
           
 
Methods inherited from class ch.ethz.mxquery.sms.MMimpl.TokenBufferStore
buffer, copySource, deleteItems, getAttributePosFromNodeId, getAttributePosFromTokenId, getMaxNodeId, getMaxTokenId, getMyId, getNodeIdFromTokenId, getNodeIdFromTokenId, getSize, hasNode, newItem, printBuffer, setContext, setIterator, start
 
Methods inherited from class ch.ethz.mxquery.sms.MMimpl.FIFOStore
getCurrentTokenId, getIterator, setContainer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.ethz.mxquery.datamodel.Source
copySource, getIterator
 

Constructor Detail

FTTokenBufferStore

public FTTokenBufferStore(XDMIterator sourceStream,
                          int id,
                          WindowBuffer container)
                   throws MXQueryException
Creates a new FTTokenBuffer for a stream with standard parameters

Parameters:
sourceStream - Source Stream
Throws:
MXQueryException

FTTokenBufferStore

public FTTokenBufferStore(int id,
                          WindowBuffer container)
                   throws MXQueryException
Throws:
MXQueryException
Method Detail

get

public Token get(int tokenId)
          throws MXQueryException
Description copied from class: TokenBufferStore
Returns the Token for a given token id

Specified by:
get in interface StreamStore
Specified by:
get in interface MXQueryAppendUpdate
Overrides:
get in class TokenBufferStore
Parameters:
tokenId - Unique id given to the token inside this store instance (token position
Returns:
the token for this Id
Throws:
MXQueryException

get

public Token get(int tokenId,
                 int maxNodeId)
          throws MXQueryException
Description copied from class: TokenBufferStore
Returns the token for a given tokenId. If the token is corresponds to a higher nodeId than maxNodeId, the END_SEQUENCE token is returned.

Specified by:
get in interface MXQueryAppendUpdate
Overrides:
get in class TokenBufferStore
Parameters:
tokenId - Token Id
maxNodeId - Max Token Id
Returns:
the token, or END_SEQENCE if out of range
Throws:
MXQueryException

getTokenIdForNode

public int getTokenIdForNode(int nodeId)
                      throws MXQueryException
Description copied from class: TokenBufferStore
Returns the position for a given NodePosition. If the node id is higher than the availabe source nodes the latest position is returned

Specified by:
getTokenIdForNode in interface MXQueryAppendUpdate
Overrides:
getTokenIdForNode in class TokenBufferStore
Returns:
the token id
Throws:
MXQueryException

getInverseDocumentFrequency

public double getInverseDocumentFrequency(java.lang.String word)
Specified by:
getInverseDocumentFrequency in interface FullTextStore
Returns:
the precomputed idf for document collections

getWordsExact

public java.util.Vector getWordsExact(java.lang.String word)

getWordsForStem

public java.util.Vector getWordsForStem(java.lang.String stem)
returns all words for the word with the stem "stem" in a vector

Specified by:
getWordsForStem in interface FullTextStore
Returns:
words that have stem "stem".

getLinguisticTokensWithInfix

public PhraseIterator getLinguisticTokensWithInfix(java.lang.String prefix,
                                                   java.lang.String suffix,
                                                   java.lang.String wildcard)
returns all Linguistic Tokens for the word with prefix "prefix" and suffix "suffix" and fulfilling the wildcard predicate

Specified by:
getLinguisticTokensWithInfix in interface FullTextStore
Returns:
iterator over the corresponding Linguistic Token of words that have "prefix" as prefix and "suffix" as suffix

getWordsWithInfix

public java.util.Vector getWordsWithInfix(java.lang.String prefix,
                                          java.lang.String suffix,
                                          java.lang.String wildcard)
returns all words for the word with prefix "prefix" and suffix "suffix" and fulfilling the wildcard predicate

Specified by:
getWordsWithInfix in interface FullTextStore
Returns:
set of words that have "prefix" as prefix and "suffix" as suffix

getLinguisticTokensWithPrefix

public PhraseIterator getLinguisticTokensWithPrefix(java.lang.String suffix,
                                                    java.lang.String wildcard)
returns all Linguistic Tokens for the word with suffix "suffix" and fulfilling the wildcard predicate

Specified by:
getLinguisticTokensWithPrefix in interface FullTextStore
Returns:
iterator over the corresponding Linguistic Token of words that have "suffix" as suffix.

getWordsWithPrefix

public java.util.Vector getWordsWithPrefix(java.lang.String suffix,
                                           java.lang.String wildcard)
returns all words for the word with suffix "suffix" and fulfilling the wildcard predicate

Specified by:
getWordsWithPrefix in interface FullTextStore
Returns:
set of words that have "suffix" as suffix.

getLinguisticTokensWithSuffix

public PhraseIterator getLinguisticTokensWithSuffix(java.lang.String prefix,
                                                    java.lang.String wildcard)
returns all Linguistic Tokens for the word with prefix "prefix" and fulfilling the wildcard predicate

Specified by:
getLinguisticTokensWithSuffix in interface FullTextStore
Returns:
iterator over the corresponding Linguistic Token of words that have "prefix" as prefix.

getWordsWithSuffix

public java.util.Vector getWordsWithSuffix(java.lang.String prefix,
                                           java.lang.String wildcard)
returns all words for the word with prefix "prefix" and fulfilling the wildcard predicate

Specified by:
getWordsWithSuffix in interface FullTextStore
Returns:
set of words that have "prefix" as prefix.

getWordsForWildcards

public java.util.Vector getWordsForWildcards(java.lang.String text)
returns all words for the word "text" and fulfilling the wildcard predicate


getPhraseWithStemming

public java.util.Vector getPhraseWithStemming(java.util.Vector v)
Parameters:
v - phrase (each word as an element)
Returns:
all the combinations of the different words that have the same stem as the original words in the phrase

getPhraseExact

public PhraseIterator getPhraseExact(java.util.Vector v,
                                     DeweyIdentifier[] ignoreId)
                              throws MXQueryException
Specified by:
getPhraseExact in interface FullTextStore
Parameters:
v - phrase (each word as an element)
Returns:
a Phrase Iterator with all the phrases that contain all the words of v
Throws:
MXQueryException

getPhraseWithWildcard

public PhraseIterator getPhraseWithWildcard(java.lang.String phrase,
                                            DeweyIdentifier[] ignoreId)
                                     throws MXQueryException
Specified by:
getPhraseWithWildcard in interface FullTextStore
Parameters:
phrase - phrase (as String)
Returns:
a Phrase Iterator with all the phrases that contain all the words of the phrase and fulfills the Wildcard predicate
Throws:
MXQueryException

getPhraseWithWildcards

public java.util.Vector getPhraseWithWildcards(java.util.Vector v)
Parameters:
v - phrase (each word as an element)
Returns:
a Phrase Iterator with all the phrases that contain all the words of v fulfilling the wildcard predicate

getLinguisticTokens

public LinguisticToken getLinguisticTokens(DeweyIdentifier did)
Specified by:
getLinguisticTokens in interface FullTextStore
Returns:
iterator over the Linguistic Tokens sequentially following the linguistic token with dewey id "did".

getLinguisticTokensExact

public PhraseIterator getLinguisticTokensExact(java.lang.String word)
Specified by:
getLinguisticTokensExact in interface FullTextStore
Returns:
iterator over the corresponding Linguistic Token of word "word".

getLinguisticTokensForMultipleWildCard

public PhraseIterator getLinguisticTokensForMultipleWildCard(java.lang.String word)

getWordsForMultipleWildCard

public java.util.Vector getWordsForMultipleWildCard(java.lang.String word)
Specified by:
getWordsForMultipleWildCard in interface FullTextStore
Returns:
set of words that fulfill "word" with its wildcards.

getNumberOfDescendants

public int getNumberOfDescendants()

getURI

public java.lang.String getURI()
Description copied from interface: Source
Returns the URI of the source.

Specified by:
getURI in interface Source
Overrides:
getURI in class TokenBufferStore
Returns:
a String representing the URI/Identifier of this source

setUri

public void setUri(java.lang.String uri)

compare

public int compare(Source store)
Specified by:
compare in interface Source
Overrides:
compare in class TokenBufferStore

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich