Class Index | File Index

Classes


Class textmodel.RegExTextModel

textmodel.RegExTextModel This is the class for the RegExTextModel document model.


Defined in: RegExTextModel.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
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
Class Detail
textmodel.RegExTextModel(string)
Parameters:
string
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}

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Sep 24 2017 15:56:41 GMT-0500 (CDT)