Skip to content

kwic keywords not vectorised #306

@kbenoit

Description

@kbenoit

The manual page suggests they are, but they are not:

mycorpus <- corpus(c("This is a test",
                     "This is it.",
                     "What is in a train?",
                     "Is it a question?",
                     "Sometimes you don't know if this is it.",
                     "Is it a bird or a plane or is it a train?"))

kwic(mycorpus, c("is", "a"), valuetype = "fixed")
##              contextPre keyword contextPost
## [text1, 2:3]     This [    is a          ] 

This should match all occurrences of is and of a separately, but appears to concatenate them to form a sequence matching only the is a in text1.

Thanks to @jjphorn for bringing this to my attention.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions