Open ColinFay opened 6 years ago
Hi @ColinFay! Thanks for the PR, it's awesome!
You added some things that were definitely on the way. You just pushed it in the right direction :-)
I have a few comments on some of the commits.
devtools_history.R
used? I haven't seen it before and I don't know its purpose although I suspect it.n_swearwords
instead of sweary_n
.attempt
looks great. I'd like the package to be with as less dependencies as possible. I am using quite a lot of packages and none of them forced me to install attempt
yet :-) Could you persuade me?en_swear_words <- get_swearwords("en")
Error in .x %in% swear_lang : object 'swear_lang' not found
Calls: get_swearwords ... check_is_lang -> stop_if_not -> <Anonymous> -> %in%
An offtopic question at the end. How did you come across this project?
Hey,
So, I'll guess I'll answer point by point:
devtools_history
is a file I create to keep trace of all the dev related action I've performed. That way when you receive you have a direct file to refer to for all the things that could otherwise be run in the console. Feel free to drop it if you want :)
No pblm :) Here are the new function names I suggest : is_swearword, pct_swearword, n_swearword, any_swearword, censor_swearword. I've kept them singular, as it seems to me important to keep some kind of consistency between function names. Tell me if this sounds ok to you.
Done
Done
{attempt}
is a package of mine :) Low on dependencies (just has {rlang}
, which in return has zero dep), so the dependency tree is pretty small. I never remember how to use base::stopifnot, and when I do, it seems a little bit cumbersome to write something to catch if it's an error, and then writing a use message. This is what is done directly in attempt::stop_if_not
: test, and if the condition is not met, the error message specified is returned. Let me know if you'd prefer me to rewrite the check function, no pblm.
Arf, noob error: I forgot to push a file :/ I have a vector called swear_lang
that contains the unique of the languages. It now appears to me that it is only called once in the check function, so I've put the unique there instead.
And for the last question, I stumbled upon your repo as I was doing some text mining, and was looking for a "bad word labeller". I coded some functions upon the package, so it seemed natural to me to send these one to you.
Hi @ColinFay, sorry for the delayed reply.
Point by point to you again.
is_swearword
singular and rename others to include the plural "s" at the end. It makes sense even if you take a look at the function's arguments. is_swearword
works with a single word but all of the others work with vectors. Does it make sense to you too?{attempt}
is yours, it's pretty cool :-) Although if you don't mind, I would prefer not to include it for now. I'll keep it in mind for the future though!And one more note. I'd prefer not to change the development version number yet. We're figuring out what should be included in the first version but until then it's pointless to change it IMO.
Here are some funs to play with the db: