Class textmodel.RegExTextModel
textmodel.RegExTextModel This is the class for the RegExTextModel document model.
Defined in: RegExTextModel.js.
Constructor Attributes | Constructor Name and Description |
---|---|
textmodel.RegExTextModel(string)
|
Method Attributes | Method Name and Description |
---|---|
getItem(re, contextLen, maxRandomHits)
|
|
getItemAndContext(re, index, contextLen)
Get a previously calculated item at the index along with some context on either side
|
Method Detail
getItem(re, contextLen, maxRandomHits)
- Parameters:
- re
- is the search expression. Only the i and m flags may be used. g may not.
- contextLen
- the length of the preceding and following context to be returned
- maxRandomHits
- how many random hits to return. -1 or null to return all
- Returns:
- array of [array of prefixes, array of item, array of suffixes, array of ids], where prefixes and suffixes come from splitting on whitespace, and the item is extended in both directions to the nearest whitespace
getItemAndContext(re, index, contextLen)
Get a previously calculated item at the index along with some context on either side
- Parameters:
- re
- is a the regular expression used previsousy by textmodel.RegExTextModel.KWIC#getItem to calculate the index
- index
- is an index as calculated by textmodel.RegExTextModel.KWIC#getItem
- contextLen
- is the length (in characters) of the context
- Returns:
- an object {item:String, left:String, right:String}