Skip to content

[NLU-5564] Fix for Pence and penny#169

Open
CiaraCrowe wants to merge 1 commit intodevelopfrom
NLU-5564
Open

[NLU-5564] Fix for Pence and penny#169
CiaraCrowe wants to merge 1 commit intodevelopfrom
NLU-5564

Conversation

@CiaraCrowe
Copy link
Collaborator

Originally we had penny set for our sub-unit currency.
Penny -> individual coin
Pence -> sum of pennies
Kind of like cent vs cents.
Since pence was not classified as our unit currency for GBP, phrases like "The total is 50 pound and 60 pence" were not being resolved -> resolving to 50 pound.
I also noticed that penny was resolving on its own correctly, '1 penny' would return '0.01' but when paired with its whole unit '1 pound and 1 penny', it wasn't resolving correctly.
The issue is how we utilise the currencies. Looking at penny and pence, we have a couple of different ISO codes which use these, example GBP, SHP, AKP etc. This is similar for cents.
When we input a phrase like "1 dollar and 1 cent", since we haven't specified an ISO code this gets picked up as ("__D", "CENT") in our CurrencyFractionMapping. I added the same logic for Pence and Penny so now when paired with Pound Unit it is properly picked up, ("__P", "PENNY|PENCE")

In the ticket it states, When a utterance is received with pence when defining an amount of money in GBP, the pence part is ignored, but it will accept just p . However p was not being being properly picked up. As it is commonly used as a sub-unit phrase 50p I added it as an abbreviation for pence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants