Skip to content

Instantly share code, notes, and snippets.

@PolMine
Created December 27, 2019 22:55
Show Gist options
  • Select an option

  • Save PolMine/76bbf7623e60bb19cde9658a8096c1d3 to your computer and use it in GitHub Desktop.

Select an option

Save PolMine/76bbf7623e60bb19cde9658a8096c1d3 to your computer and use it in GitHub Desktop.

Revisions

  1. PolMine created this gist Dec 27, 2019.
    16 changes: 16 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    library(polmineR)
    use("GermaParl")

    stopwords <- unname(unlist(
    noise(
    terms("GERMAPARL", p_attribute = "word"),
    stopwordsLanguage = "en"
    )
    ))

    r <- Cooccurrences(
    .Object = "GERMAPARL", p_attribute = "word",
    left = 0L, right = 1L, stoplist = stopwords
    )
    decode(r)
    pmi(r)