custom lexicon key with multiple words only partially matching
See original GitHub issueIs this normal behavior? I was hoping any custom lexicon key of mine would override anything else. Any suggestions around it if it’s normal behavior?
let nlp = require('nlp_compromise');
let newLex = nlp.lexicon();
newLex['ser waymar royce'] = 'TARGETED_GUY';
console.log(nlp.sentence('Ser Waymar Royce asked cooly.', {lexicon: newLex}).terms);
is giving output
Noun {
whitespace: { preceding: '', trailing: ' ' },
text: 'Ser Waymar',
normal: 'ser waymar',
expansion: null,
reasoning: [ 'fallback', 'capital_signal', 'chunked two-nouns' ],
pos: { Noun: true },
tag: 'Noun' },
Person {
whitespace: { preceding: '', trailing: ' ' },
text: 'Royce',
normal: 'royce',
expansion: null,
reasoning: [ 'capital_signal', 'lexicon_pass' ],
pos: { Noun: true, Person: true, MalePerson: true },
tag: 'MalePerson',
honourific: null,
firstName: 'Royce',
middleName: '',
lastName: null },
Verb {
whitespace: { preceding: '', trailing: ' ' },
text: 'asked',
normal: 'asked',
expansion: null,
reasoning: [ 'lexicon_pass' ],
pos: { Verb: true, PastTense: true },
tag: 'PastTense' },
etc…
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
c# - Is it possible to do a partial string match on a Dictionary ...
When you pull items out using two keys, you could use the LINQ Extension method Intersect() to get the items that match both...
Read more >Smart Matching: Using a Dictionary | Using iKnow
Describes how iKnow can use a dictionary and a defined matching profile to identify full or partial matches with indexed text data.
Read more >Create custom sensitive information types - Microsoft Learn
Prepare two files, like a Word document. One with content that matches the elements you specified in your sensitive information type and one ......
Read more >Rule-based matching · spaCy Usage Documentation
Find phrases and tokens, and match entities. ... Each token can set multiple attributes like text value, part-of-speech tag or boolean flags.
Read more >3 Processing Raw Text - NLTK
from __future__ import division # Python 2 users only >>> import nltk, re, ... 6 in the center row, and «^[a-fj-o]+$» will match...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hey, this works now! https://runkit.com/spencermountain/59a16a6f7cca6a00128245f2 cheers
hey brian, yuck. this seems like a bug for sure. it looks like the term ‘Royce’ is tripping it up because it’s already recognized as a first-name. There may be some lumping/splitting rule it’s colliding with, because of the first-name. Definitely not what it’s supposed to do… I can look at doing a hotfix this week. thanks