com.fatdog.xmlEngine.words
Class WordManager
java.lang.Object
com.fatdog.xmlEngine.words.WordBreaker
com.fatdog.xmlEngine.words.WordManager
- All Implemented Interfaces:
- IWordHandler
- public class WordManager
- extends WordBreaker
- implements IWordHandler
A class used to manage words.
In XQEngine
, everything is a word:
the individual words contained in both element and attribute content,
as well as both components of the QNames
which represent
element and attribute names.
- Version:
- 0.66
- Author:
- Howard Katz, howardk@fatdog.com
Method Summary |
int[] |
addEntry(java.lang.String localName,
java.lang.String qName)
|
int |
getNumLocalParts()
|
int |
getNumPrefixes()
|
int |
getNumWordInstances()
|
int |
getNumWords()
|
int |
getNumWordsIndexed()
|
java.lang.String |
getQName(int[] keys)
|
java.lang.String |
getQName(int prefixKey,
int localKey)
|
int[] |
keysFromQName(java.lang.String qName)
Returns either a prefix key + localPart key pair, or a namespace index
plus localPart key pair, depending on the value of the boolean argument
to m_engine.setUseLexicalPrefixes(true/false). |
void |
newWord(char[] cbuf,
int wordStart,
int wordEnd,
int parent,
IntList args)
This method will be called whenever WordBreaker.characters(char[], int, int, int, IntList) encounters
a new word. |
void |
startDocument(NodeTree tree)
|
void |
stopDocument()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_ENTRY
public static final int NO_ENTRY
- See Also:
- Constant Field Values
WILDCARD
public static final int WILDCARD
- See Also:
- Constant Field Values
NOT_FOUND
public static final int NOT_FOUND
- See Also:
- Constant Field Values
WordManager
public WordManager(IndexManager indexer,
int prefixes,
int locals,
int words)
keysFromQName
public int[] keysFromQName(java.lang.String qName)
throws CategorizedInvalidQueryException
- Returns either a prefix key + localPart key pair, or a namespace index
plus localPart key pair, depending on the value of the boolean argument
to m_engine.setUseLexicalPrefixes(true/false).
- Parameters:
qName
-
- Returns:
- int[]
- Throws:
CategorizedInvalidQueryException
startDocument
public void startDocument(NodeTree tree)
stopDocument
public void stopDocument()
addEntry
public int[] addEntry(java.lang.String localName,
java.lang.String qName)
getNumPrefixes
public int getNumPrefixes()
getNumLocalParts
public int getNumLocalParts()
getQName
public java.lang.String getQName(int[] keys)
getQName
public java.lang.String getQName(int prefixKey,
int localKey)
getNumWordInstances
public int getNumWordInstances()
getNumWordsIndexed
public int getNumWordsIndexed()
getNumWords
public int getNumWords()
newWord
public void newWord(char[] cbuf,
int wordStart,
int wordEnd,
int parent,
IntList args)
- Description copied from interface:
IWordHandler
- This method will be called whenever
WordBreaker.characters(char[], int, int, int, IntList)
encounters
a new word.
- Specified by:
newWord
in interface IWordHandler
- Parameters:
cbuf
- A char[] array holding the word, possibly larger than the word itselfwordStart
- Starting offset of the word in the arraywordEnd
- Offset of the first character past the end of the wordparent
- Document id index of the node in which the word is foundargs
- An optional IntList
you can pass indirectly to the routine
via WordBreaker.characters()
- See Also:
FandO.contains_word(SimpleNode,SimpleNode)
,
IndexManager