You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The currency parser seems to need some work. Things like ("Five cents") or ("5 dollars") just return "5"...
Plus we should be adding rules for all things like "(one|five|ten) (dollar|dollars) bill".
That said - throwing this here! (Thinking this should be the new .get() ) etc...
functionextractCurrencys(str){letdoc=nlp(str).money().json();letcurrencies=[]for(letitemindoc){letcurrency=doc[item]constunit=currency?.number?.unit;// we need to replace units with only (dollars/cents, exchanges like USD etc...)consttext=currency?.text;if(unit&&text){currencies.push({text,unit})}}returncurrencies}console.log(extractCurrencys("$1 dollar to $2 dollar"))
If you want to hack on this alone - you're more than welcome. Or you want to work on it together. More than fine.
The text was updated successfully, but these errors were encountered:
functionextractCurrencys(str){letdoc=nlp(str).money().json();letcurrencies=[]for(letitemindoc){letcurrency=doc[item]letunit=currency?.number?.unit;// we need to replace units with only (dollars/cents, exchanges like USD etc...)consttext=currency?.text;if(unit&&!nlp(currency.number.unit).has("#Currency")){unit=null;}if(unit&&text){currencies.push({text,unit})}if(!unit&&text){currencies.push({text,unit:null})}}returncurrencies}
The currency parser seems to need some work. Things like ("Five cents") or ("5 dollars") just return "5"...
Plus we should be adding rules for all things like "(one|five|ten) (dollar|dollars) bill".
That said - throwing this here! (Thinking this should be the new .get() ) etc...
If you want to hack on this alone - you're more than welcome. Or you want to work on it together. More than fine.
The text was updated successfully, but these errors were encountered: