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.

smarter number sequences - 'one one twenty one'

See original GitHub issue

Found another head-scratcher… At first I thought it was merely a limitation, but the issue appears to only pop up if there are an even number of individual digits in front of a multi-digit value.

Hopefully this example explains more clearly:

const nlp = require('compromise')
const arr = str => nlp(str).values().out('array')

// digits leading
console.log(arr('one twenty one')) // ['one', 'twenty one']
console.log(arr('one one twenty one')) // ['one one twenty one'] (x)
console.log(arr('one one one twenty one')) // ['one', 'one', 'one', 'twenty one']
console.log(arr('one one one one twenty one')) // ['one one one one twenty one'] (x)

// digits trailing
console.log(arr('one twenty one one')) // ['one', 'twenty one', 'one']
console.log(arr('one twenty one one one')) // ['one', 'twenty one', 'one', 'one']

I’m merely using “one” and “twenty one” to demonstrate the point, but it occurs with any even number of individual digits in front of a multi-digit value, but not after. 🤔

FYI, our team is trying to use this fantastic library to capture “creative pronunciations” of values.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
hboylancommented, Mar 14, 2018

I believe the ultimate goal here is to capture nominal values in addition to cardinal and ordinal.

My thought is that the lumping/splitting would still need to be enhanced to capture more advanced number sequences. Then, there might be another step to determine whether the value is nominal. Maybe by using a separate toNominal() function or something…

cardinal-ordinal-nominal

1reaction
hboylancommented, Mar 9, 2018

Great, I’ll take a look at this.

Enjoy your vaca! 😎

Read more comments on GitHub >

github_iconTop Results From Across the Web

Did you solve it? Are you smarter than a metagrobologist?
The solutions to today's two sequence puzzles. ... Seventeen, Eighteen, Nineteen, Twenty, Twenty one, ..... Thirty nine, Forty.
Read more >
Sequencing Numbers 1-20 Teaching Resources - TPT
Practice counting, subitizing and sequencing with this fun and engaging interactive number sense PowerPoint game for whiteboards and ...
Read more >
Sequencing Numbers 1-20 Puzzles - Set of 3
Our fun, animal-themed puzzles help kids build number skills—piece by piece! This set includes 3 wooden puzzles—all with simple, color-coded pieces numbered ...
Read more >
Get answers for some non-mathematical sequences
Given that 1 and 2 yield 9, 3 and 4 yield 20, and 5 and 6 yield 12, find the number yielded by...
Read more >
Number sequences - Microsoft Dynamics AX Forum ...
Or is AX smart and understands that I want to use the same number sequnce, ... If you share one sequence, indeed it...
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