Skip to content

Commit

Permalink
update Term.set for new autofill method
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Apr 18, 2021
1 parent 9e5d5bb commit c6c1878
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 12 deletions.
2 changes: 1 addition & 1 deletion plugins/dates/scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const context = {
// let doc = nlp('22-23 Feb 2016 at 7pm')
// let doc = nlp('ten to 4 in the morning')
// let doc = nlp('february 5th, 6th or 7th') //.debug()
let doc = nlp('during march or september').debug()
let doc = nlp('20 september').debug()
// let doc = nlp('march 1')
// let doc = nlp('next friday, this monday').debug()
// let doc = nlp('wednesdays at 3') //.debug()
Expand Down
4 changes: 2 additions & 2 deletions plugins/typeahead/builds/compromise-typeahead.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/typeahead/builds/compromise-typeahead.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/typeahead/builds/compromise-typeahead.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions plugins/typeahead/builds/compromise-typeahead.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* compromise-typeahead 0.3.0 MIT */
/* compromise-typeahead 0.3.1 MIT */
const tryPrefix = function (doc, lex) {
let world = doc.world;
world.prefixes = world.prefixes || {}; // get end-part of text
Expand Down Expand Up @@ -113,7 +113,7 @@ const plugin = function (Doc, world, _nlp) {
Doc.prototype.autoFill = function () {
this.termList().forEach(t => {
if (t.typeAhead === true && t.implicit) {
t.text = t.implicit;
t.set(t.implicit);
t.implicit = null;
t.typeAhead = undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/typeahead/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "compromise-typeahead",
"description": "plugin for nlp-compromise",
"version": "0.3.0",
"version": "0.3.1",
"author": "Spencer Kelly <[email protected]> (http://spencermounta.in)",
"main": "./builds/compromise-typeahead.js",
"unpkg": "./builds/compromise-typeahead.min.js",
Expand Down
2 changes: 1 addition & 1 deletion plugins/typeahead/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const plugin = function (Doc, world, _nlp) {
Doc.prototype.autoFill = function () {
this.termList().forEach((t) => {
if (t.typeAhead === true && t.implicit) {
t.text = t.implicit
t.set(t.implicit)
t.implicit = null
t.typeAhead = undefined
}
Expand Down
Loading

0 comments on commit c6c1878

Please sign in to comment.