Skip to content

Latest commit

 

History

History
305 lines (211 loc) · 8.81 KB

api.md

File metadata and controls

305 lines (211 loc) · 8.81 KB

Classes

SearchFactory

SearchFactory Class

SearchInterpreter
SearchInterpreter
SearchNormalizer
SearchParser
SearchParser
SearchTokenizer
SearchTokenizer
Search
Search

SearchFactory

SearchFactory Class

Kind: global class

new SearchFactory(registry)

Param Type Description
registry Object The registry for storing class references

searchFactory.createTokenizer() ⇒ SearchTokenizer

Creates an instance of the SearchTokenizer class

Kind: instance method of SearchFactory
Returns: SearchTokenizer - - Instance of SearchTokenizer

searchFactory.createParser() ⇒ SearchParser

Creates an instance of the SearchParser class

Kind: instance method of SearchFactory
Returns: SearchParser - - Instance of SearchParser

searchFactory.createInterpreter() ⇒ SearchInterpreter

Creates an instance of the SearchInterpreter class

Kind: instance method of SearchFactory
Returns: SearchInterpreter - - Instance of SearchInterpreter

SearchInterpreter

Kind: global class

new SearchInterpreter(ast)

Param Type Description
ast Object The AST to interpret

searchInterpreter.interpret(text) ⇒ boolean

Interprets the AST against a given text

Kind: instance method of SearchInterpreter

Param Type Description
text string Text to search

SearchInterpreter

Kind: global class

new SearchInterpreter(ast)

Param Type Description
ast Object The AST to interpret

searchInterpreter.interpret(text) ⇒ boolean

Interprets the AST against a given text

Kind: instance method of SearchInterpreter

Param Type Description
text string Text to search

SearchNormalizer

Kind: global class

SearchNormalizer.normalize(text) ⇒ string

Normalizes a text string

Kind: static method of SearchNormalizer

Param Type Description
text string Text to normalize

SearchParser

Kind: global class

new SearchParser(tokens)

Param Type Description
tokens Array Tokens to parse

searchParser.parse() ⇒ Object

Initiates the parsing process

Kind: instance method of SearchParser
Returns: Object - - AST

SearchParser

Kind: global class

new SearchParser(tokens)

Param Type Description
tokens Array Tokens to parse

searchParser.parse() ⇒ Object

Initiates the parsing process

Kind: instance method of SearchParser
Returns: Object - - AST

SearchTokenizer

Kind: global class

searchTokenizer.tokenize(query) ⇒ Array

Tokenizes a query string

Kind: instance method of SearchTokenizer
Returns: Array - - List of tokens

Param Type Description
query string Query to tokenize

SearchTokenizer

Kind: global class

searchTokenizer.tokenize(query) ⇒ Array

Tokenizes a query string

Kind: instance method of SearchTokenizer
Returns: Array - - List of tokens

Param Type Description
query string Query to tokenize

Search

Kind: global class

new Search(opts)

Param Type Description
opts Object Options for Search

search.evaluator(needle) ⇒ function

Creates an evaluator function based on the needle (query string)

Kind: instance method of Search
Returns: function - - Evaluator function

Param Type Description
needle string Query string

search.evaluate(needle, haystack) ⇒ boolean

Evaluates a query string against a text string

Kind: instance method of Search
Returns: boolean - - True if the query matches, false otherwise

Param Type Description
needle string Query string
haystack string Text string

Search

Kind: global class

new Search(opts)

Param Type Description
opts Object Options for Search

search.evaluator(needle) ⇒ function

Creates an evaluator function based on the needle (query string)

Kind: instance method of Search
Returns: function - - Evaluator function

Param Type Description
needle string Query string

search.evaluate(needle, haystack) ⇒ boolean

Evaluates a query string against a text string

Kind: instance method of Search
Returns: boolean - - True if the query matches, false otherwise

Param Type Description
needle string Query string
haystack string Text string