Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metaphone crashing when encoding "gh" #43

Open
turtlegraphics opened this issue Apr 24, 2021 · 1 comment
Open

Metaphone crashing when encoding "gh" #43

turtlegraphics opened this issue Apr 24, 2021 · 1 comment
Assignees
Labels

Comments

@turtlegraphics
Copy link

Describe the bug
metaphone crashes when encoding "gh"

Possibly this is version dependent - I'm running an old R and cannot upgrade until I buy a new computer.

It's just strange that it seems to work for many words and only crash on gh. Maybe gh is producing some sort of strange unicode or something? IDK, I'm not much of a user of this package, but I need to get some code to run and this is breaking it. Any help would be appreciated.

To Reproduce
phonics::metaphone("sigh")

Or any other word with gh in it, as far as I can tell

Expected behavior
Should return the metaphone encoding for sigh.

Example

> phonics::metaphone("ruff")
[1] "RF"
> phonics::metaphone("rough")
Error in metaphone_internal(word, maxCodeLen) : 
  c++ exception (unknown reason)
> phonics::metaphone("funhouse")
[1] "FNHS"
> phonics::metaphone("bughouse")
Error in metaphone_internal(word, maxCodeLen) : 
  c++ exception (unknown reason)
library(stringr); words[!str_detect(words,"gh")] %>% phonics::metaphone()
# works properly on 962 other words :-)

Desktop (please complete the following information):

> version
               _                           
platform       x86_64-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          6.1                         
year           2019                        
month          07                          
day            05                          
svn rev        76782                       
language       R                           
version.string R version 3.6.1 (2019-07-05)
nickname       Action of the Toes

Running phonics v1.3.9

@howardjp
Copy link
Collaborator

That's a bug, alright! I'll take a look into it. Thanks!

@howardjp howardjp self-assigned this Apr 24, 2021
@howardjp howardjp added the bug label Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants