question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Number range tagging

See original GitHub issue

Number ranges seem to be tagged strangely resulting in things this not working:

nlp('1-2').numbers().out('array'); // => []

nlp('1-2').contractions().expand().numbers().out('array') // => []

nlp('1-2').contractions().expand().numbers().out('array') // => []

Using the debug i can see that the numbers in a number range aren’t tagged with #Value, they are tagged with #Number, but that is not used on ‘single’ numbers?


nlp('1').debug()
// '1'       -  Cardinal, Value, NumericValue

nlp('1-2').debug();
/*
"1-2"
compromise.mjs:7687    '[1]'     -  Number, Cardinal, NumberRange, Contraction
compromise.mjs:7687    '[to]'    -  Conjunction, NumberRange, Contraction
compromise.mjs:7687    '[2]'     -  Number, Cardinal, NumberRange, Contraction
*/

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
spencermountaincommented, Nov 13, 2020

whaaaaaa! ahh, what a good catch. Fixed on dev. WIll release in a few days. cheers

0reactions
spencermountaincommented, Dec 18, 2020

empty results are now removed from .out('array') in 13.8.0 If you have any ideas for how this syntax could be improved, let me know. There’s some tech-debt in there that shouldn’t be exposed in the api like that - thanks for your patience with this. cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Which specific tag is used for describing the range of numbers ...
The HTML input tag is used for describing the range of numbers in HTML form. The <input> tag is used to define an...
Read more >
HTML input type="range" - W3Schools
The <input type="range"> defines a control for entering a number whose exact value is not important (like a slider control). Default range is...
Read more >
Tags, Ranges and Masks
One generic way to represent tagged animations is using ranges - essentially start and stop frames for each tagged section that appears in...
Read more >
Number range expires - SAP Community
Hi all Can anybody tell me what happens when my number range expires. I have defined the object using SNRO and set the...
Read more >
2-4: Select a range of cells and understand Smart Tags
In this video lesson you'll learn how to select a range of cells using both the mouse and the keyboard. You'll then go...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found