new Context(array)
Find contextual relevant searches between array entries
Example
var ContextLink = require('context-link');
var context = new ContextLink([
'hello world',
'hello saturn',
'hello pluto'
]);
Parameters:
Name | Type | Description |
---|---|---|
array |
Array.string | array of strings to find contextual relevant searches |
Methods
(static) find(wordopt) → {Object.<string, array.<object>>}
find all values or a given value in the paragraphs
Example
var result = context.find('hello');
/* result is
{
hello:
[ { entry: [Object], index: 1 },
{ entry: [Object], index: 1 },
{ entry: [Object], index: 3 },
{ entry: [Object], index: 5 } ] }
}
/*
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
word |
String |
<optional> |
a word to search for, if not passed, find all words |
Returns:
- the response is an hash map of arrays that contains objects
- Type
- Object.<string, array.<object>>