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

replace_word_elongations creates NAs #61

Open
erhard1 opened this issue Jan 5, 2022 · 2 comments
Open

replace_word_elongations creates NAs #61

erhard1 opened this issue Jan 5, 2022 · 2 comments

Comments

@erhard1
Copy link

erhard1 commented Jan 5, 2022

I was doing some text clean up with replace_word_elongations and ran into a case where the phrase "AAA battery" caused all word elongation matches to become NA. I modified the example from the help file to show the situation:

x <- c('look', 'noooooo!', 'real coooool!', "it's sooo goooood", 'fsdfds',
'fdddf', 'as', "aaaahahahahaha", "aabbccxccbbaa", 'I said heyyy!',
"I'm liiiike whyyyyy me?", "Wwwhhatttt!", "AAA battery")

replace_word_elongation(x)
[1] "look" NA NA NA "fsdfds" NA "as" NA
[9] "aabbccxccbbaa" NA NA NA NA

Thanks in advance for any help you can provide. I have been pleased with how the textclean package has been working so far.

@ihsankahveci
Copy link

ihsankahveci commented Feb 6, 2022

Assuming you are using the CRAN version, I wanted to let you know that this issue should be solved after the last commit: 5443d74.

You can install the latest version using pacman package:

pacman::p_load_gh(
    "trinker/lexicon",    
    "trinker/textclean"
)

Or using remotes package:

remotes::install_github("trinker/textclean", force = TRUE)

@erhard1
Copy link
Author

erhard1 commented Feb 7, 2022

Yes, I am using the current version on CRAN. I will give that new commit a try. The work around I used was to transform all the text to lower case. That resolved the issue I was having wit moved case.

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

No branches or pull requests

2 participants