Issue 2124 - #2129
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2129 +/- ##
==========================================
- Coverage 96.17% 96.14% -0.04%
==========================================
Files 87 87
Lines 4938 4949 +11
==========================================
+ Hits 4749 4758 +9
- Misses 189 191 +2
Continue to review full report at Codecov.
|
kbenoit
left a comment
There was a problem hiding this comment.
This is a good addition and move to make the coercion methods more consistent as well. However I see two things.
-
Better to deprecate or just make
noRdthe currentphrase()methods that will be moved toas.phrase(), just so not to break existing code in a minor update. (I'm happy to do this if you want.) -
I'm happy with the use the
separatorhere. But I did take opportunity to review our various uses ofcontatenatorversusseparatorto make sure our usage makes sense and is consistent. I think it is.
| Function | concatenator |
separator |
(none) |
|---|---|---|---|
kwic() |
✓ | ||
dictionary() |
✓ | ||
as.dictionary() |
✓ | ||
tokens_split() |
✓ | ||
tokens_ngrams() |
✓ | ||
tokens_skipgrams() |
✓ | ||
corpus_group() |
✓ | ||
spacyr::entity_consolidate() |
✓ | ||
spacyr::entity_extract() |
✓ | ||
quanteda.textstats::textstat_collocations() |
✓ |
I think this is consistent because all of our functions that use concatenator are designed to take parts and put them together, using the value of concatenator to be the joining character. The functions that use separator on the other hand either take things that are already concatenated and split them using the value of separator to know what value to use for this split.
So by that logic, for as.phrase() or phrase() the use of separator is correct.
|
I doubt that more than one or two people are using |
For #2124, add
separatortophrase()and makeas.phrase()for objects for which separator has no effect.