|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jqurantree.search.TokenSearch
public class TokenSearch
The TokenSearch
class searches for tokens within the orthography
model. This class supports searching for tokens using an exact string match,
or by substring, and is used by performing the following steps:
Step 1. Initiate a new TokenSearch
instance by specifying which
encoding type to use, e.g. Buckwalter transliteration, or Unicode. All string
comparisons will be performed using the specified encoding type.
Step 2. Define the search criteria through calls to
findToken(String)
and findSubstring(String)
.
Step 3. Run the search by calling the getResults()
method.
The results will be returned as an analysis table with 4 columns:
- The chapter number.
- The verse number.
- The token number.
- The token's text in the specified encoding.
The returned analysis table will list all matching tokens together with their location. The search criteria are combined using a Boolean OR, so that if any of the search criteria match, the token will be listed.
Constructor Summary | |
---|---|
TokenSearch(EncodingType encodingType)
Creates a new TokenSearch instance, using the specified
encoding scheme. |
|
TokenSearch(EncodingType encodingType,
SearchOptions options)
Creates a new TokenSearch instance, using the specified
encoding scheme and search options. |
Method Summary | |
---|---|
void |
findSubstring(java.lang.String text)
Adds a substring match to the list of search criteria. |
void |
findSubstring(java.lang.String text,
SearchOptions options)
Adds a substring match to the list of search criteria. |
void |
findToken(java.lang.String text)
Adds an exact string match to the list of search criteria. |
void |
findToken(java.lang.String text,
SearchOptions options)
Adds an exact string match to the list of search criteria, with search options. |
AnalysisTable |
getResults()
Gets an AnalysisTable holding the search results. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TokenSearch(EncodingType encodingType)
TokenSearch
instance, using the specified
encoding scheme.
encodingType
- the encoding scheme to use when performing string comparsionspublic TokenSearch(EncodingType encodingType, SearchOptions options)
TokenSearch
instance, using the specified
encoding scheme and search options. If
SearchOptions.RemoveDiacritics
is specified, then the search
performed will not be sensitive to the presence of diacritics.
encodingType
- the encoding scheme to use when performing string comparsionsoptions
- the search options to use.Method Detail |
---|
public void findToken(java.lang.String text)
text
- the string to search for, in the specified encoding schemepublic void findToken(java.lang.String text, SearchOptions options)
text
- the string to search for, in the specified encoding schemeoptions
- the search options to use when performing this matchpublic void findSubstring(java.lang.String text)
text
- the substring to search for, in the specified encoding schemepublic void findSubstring(java.lang.String text, SearchOptions options)
text
- the substring to search for, in the specified encoding schemeoptions
- the search options to use when performing this matchpublic AnalysisTable getResults()
AnalysisTable
holding the search results. The returned
analysis table will list all matching tokens together with their
location. The search criteria are combined using a Boolean OR, so that if
any of the search criteria match, the token will be listed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |