How custom match with no spaced number and string
See original GitHub issueLove the tool 💯 i’m having this issue to match string containing number and custom unit with or without space.
i used plugin to add new word to #Unit
tag
nlp.plugin({
words: {
sotok: 'Unit'
}
});
eg: #Cardinal #Unit
does match with 24 sotok
but doesn’t match with 24sotok
nlp(`24 sotok`).match("#Cardinal #Unit").out("array") // ✅
nlp(`24sotok`).match("#Cardinal #Unit").out("array") // ❌
I can use regex to do that but is there any way to do with existing tags in compromise?
There must be something i’m doing wrong as i have seen the exising
money
tag does the same.
const money = nlp("$33.2cad").money().json()
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Regex for field that allows numbers and spaces - Stack Overflow
This regular expression matches numbers with spaces, numbers without spaces, but not the spaces after all numbers (\s*[0-9]+)+.
Read more >Custom numeric format strings - Microsoft Learn
Learn how to create a custom numeric format string to format numeric data in .NET. A custom numeric format string has one or...
Read more >Excel MATCH function with formula examples - Ablebits
See how to match data in Excel using the MATCH function. Basic uses and advanced formula examples for case-sensitive match, Vlookup and ...
Read more >Writing YARA rules — yara 4.2.0 documentation
... can appear contiguously or separated by spaces. Decimal numbers are not allowed in hex strings. ... Any of the following strings will...
Read more >15: 9.4. String Functions and Operators - PostgreSQL
Returns number of bytes in the string. Since this version of the function accepts type character directly, it will not strip trailing spaces....
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 @nilooy this is fixed now in 14.4.0. I wanted to do something that normalized ‘2l’ ‘2 litre’ and ‘2 litres’ but it got too messy.
for now, ‘2foo’ will tokenize as [‘Value’, ‘Unit’], no matter what, and ambiguous units like ‘m’ will tag asa unit, when following a number cheers
hey,
#Value #Units
will work for both cases, (both ‘24 sotok’ and ‘24sotok’) in next week’s release. i’ll let you know when it’s published cheers