-
Notifications
You must be signed in to change notification settings - Fork 13
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
Does liwkalike() handle proper regular expressions? #31
Comments
Currently, To get the equivalent patterns, you would use: library("quanteda.dictionaries")
txt <- c("The red-shirted lawyer gave her yellow-haired,
red nose ex-boyfriend $300 out of pity:(.")
dict <- quanteda::dictionary(list(lawyer = c("lawyer", "law?er")))
liwcalike(txt, dict)
## docname Segment WPS WC Sixltr Dic lawyer AllPunc Period Comma Colon SemiC
## 1 text1 1 24 24 8.33 4.17 4.17 29.17 4.17 4.17 4.17 0
## QMark Exclam Dash Quote Apostro Parenth OtherP
## 1 0 0 12.5 0 0 0 12.5 |
Thank you for clarifying! I have a dictionary that makes extensive use of perl regex, so indeed, I would like to put my name down for this feature request :) Sincerely, |
Noted! This will not be hard to add. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear Dr. Benoit,
I tried to run the following:
But the word lawyer is not matched:
Is this expected behavior? To what extent are regular expressions supported by
liwkalike()
and, downstream,tokens_lookup.tokens()
?Thank you sincerely,
Caspar
The text was updated successfully, but these errors were encountered: