Open thiagodp opened 6 years ago
Given a entity foo and a sentence recognized as "A {foo} and a {foo} with a {bar}.", the property entitiesIndex (of the object returned by the test() method) will be something like:
foo
"A {foo} and a {foo} with a {bar}."
entitiesIndex
test()
{ "foo": { position: 2, entity: "foo", ... }, "foo1": { position: 15, entity: "foo", ... }, "bar": { position: 24: entity: "bar", ... } }
The second foo entity is represented by foo1. I think it is better having an array for each entity found:
foo1
{ "foo": [ { position: 2, entity: "foo", ... },{ position: 15, entity: "foo", ... } ] "bar": [ { position: 24: entity: "bar", ... } ] }
This makes it easier to get all the results of a certain entity as well as to count them.
Given a entity
foo
and a sentence recognized as"A {foo} and a {foo} with a {bar}."
, the propertyentitiesIndex
(of the object returned by thetest()
method) will be something like:The second
foo
entity is represented byfoo1
. I think it is better having an array for each entity found:This makes it easier to get all the results of a certain entity as well as to count them.