smarter number sequences - 'one one twenty one'
See original GitHub issueFound 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:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top 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 >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
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…Great, I’ll take a look at this.
Enjoy your vaca! 😎