{
  "_id": "6a480a44e06c18f0a65297ef",
  "Package": "kgrams",
  "Title": "Classical k-gram Language Models",
  "Version": "0.2.1",
  "Authors@R": "person(given = \"Valerio\",\nfamily = \"Gherardi\",\nrole = c(\"aut\", \"cre\"),\nemail = \"vgherard840@gmail.com\",\ncomment = c(ORCID = \"0000-0002-8215-3013\"))",
  "Description": "Training and evaluating k-gram language models in R,\nsupporting several probability smoothing techniques, perplexity\ncomputations, random text generation and more.",
  "License": "GPL (>= 3)",
  "Encoding": "UTF-8",
  "LazyData": "true",
  "Roxygen": "list(markdown = TRUE, roclets = c (\"namespace\", \"rd\"))",
  "RoxygenNote": "7.3.2",
  "Config/testthat/edition": "3",
  "RdMacros": "Rdpack",
  "VignetteBuilder": "knitr",
  "URL": "https://vgherard.github.io/kgrams/,\nhttps://github.com/vgherard/kgrams",
  "BugReports": "https://github.com/vgherard/kgrams/issues",
  "Repository": "https://vgherard.r-universe.dev",
  "Date/Publication": "2024-11-13 08:22:45 UTC",
  "RemoteUrl": "https://github.com/vgherard/kgrams",
  "RemoteRef": "v0.2.1",
  "RemoteSha": "bf86cee71acc90aa00fd5d570cebebc293359486",
  "NeedsCompilation": "yes",
  "Packaged": {
    "Date": "2026-07-03 19:07:39 UTC",
    "User": "root"
  },
  "Author": "Valerio Gherardi [aut, cre] (ORCID:\n<https://orcid.org/0000-0002-8215-3013>)",
  "Maintainer": "Valerio Gherardi <vgherard840@gmail.com>",
  "_user": "vgherard",
  "_type": "src",
  "_file": "kgrams_0.2.1.tar.gz",
  "_fileid": "https://r2.ropensci.org/16523b69ef690ebdc2806f5c8bb2c732e45d80f44dce1e93c632654e39820758",
  "_filesize": 431223,
  "_sha256": "16523b69ef690ebdc2806f5c8bb2c732e45d80f44dce1e93c632654e39820758",
  "_expires": "2026-10-11T19:15:14.000Z",
  "_created": "2026-07-03T19:07:39.000Z",
  "_published": "2026-07-03T19:15:16.109Z",
  "_jobs": [
    {
      "job": 85058647851,
      "time": 178,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "8073429447"
    },
    {
      "job": 85058647862,
      "time": 208,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "8073435038"
    },
    {
      "job": 85058647855,
      "time": 184,
      "config": "linux-release-arm64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "8073430614"
    },
    {
      "job": 85058647892,
      "time": 187,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "8073430646"
    },
    {
      "job": 85058647828,
      "time": 190,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "NOTE",
      "artifact": "8073430947"
    },
    {
      "job": 85058647842,
      "time": 246,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "NOTE",
      "artifact": "8073442011"
    },
    {
      "job": 85058647838,
      "time": 147,
      "config": "macos-release-arm64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "8073422914"
    },
    {
      "job": 85058647848,
      "time": 384,
      "config": "macos-release-x86_64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "8073468699"
    },
    {
      "job": 85058146897,
      "time": 264,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8073393667"
    },
    {
      "job": 85058647812,
      "time": 163,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "8073425928"
    },
    {
      "job": 85058647832,
      "time": 169,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "8073427064"
    },
    {
      "job": 85058647835,
      "time": 177,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "NOTE",
      "artifact": "8073428655"
    },
    {
      "job": 85058647807,
      "time": 161,
      "config": "windows-release",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "8073425438"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009",
  "_status": "success",
  "_upstream": "https://github.com/vgherard/kgrams",
  "_commit": {
    "id": "bf86cee71acc90aa00fd5d570cebebc293359486",
    "author": "Valerio Gherardi <vgherard840@gmail.com>",
    "committer": "Valerio Gherardi <vgherard840@gmail.com>",
    "message": "Update CRAN comments for v0.2.1 submission\n",
    "time": 1731486165
  },
  "_maintainer": {
    "name": "Valerio Gherardi",
    "email": "vgherard840@gmail.com",
    "login": "vgherard",
    "linkedin": "in/vgherard",
    "orcid": "0000-0002-8215-3013",
    "twitter": "@ValerioGherardi",
    "description": "|physicist>   +   |data scientist>",
    "uuid": 62836440
  },
  "_distro": "resolute",
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 4.0",
      "role": "Depends"
    },
    {
      "package": "Rcpp",
      "role": "LinkingTo"
    },
    {
      "package": "RcppProgress",
      "role": "LinkingTo"
    },
    {
      "package": "Rcpp",
      "role": "Imports"
    },
    {
      "package": "rlang",
      "role": "Imports"
    },
    {
      "package": "methods",
      "role": "Imports"
    },
    {
      "package": "utils",
      "role": "Imports"
    },
    {
      "package": "RcppProgress",
      "version": ">= 0.1",
      "role": "Imports"
    },
    {
      "package": "Rdpack",
      "role": "Imports"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    },
    {
      "package": "covr",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "tibble",
      "role": "Suggests"
    }
  ],
  "_owner": "vgherard",
  "_selfowned": true,
  "_usedby": 1,
  "_updates": [],
  "_tags": [],
  "_topics": [
    "language-models",
    "n-grams",
    "natural-language-processing",
    "cpp"
  ],
  "_stars": 7,
  "_contributors": [
    {
      "user": "vgherard",
      "count": 27,
      "uuid": 62836440
    }
  ],
  "_userbio": {
    "uuid": 62836440,
    "type": "user",
    "name": "Valerio Gherardi",
    "followers": 14,
    "description": "|physicist>   +   |data scientist>"
  },
  "_downloads": {
    "count": 660,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/kgrams"
  },
  "_devurl": "https://github.com/vgherard/kgrams",
  "_pkgdown": "https://vgherard.github.io/kgrams/",
  "_searchresults": 19,
  "_rbuild": "4.6.1",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/kgrams.html",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/vgherard/kgrams",
  "_realowner": "vgherard",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2021-02-15"
    },
    {
      "version": "0.1.2",
      "date": "2021-11-16"
    },
    {
      "version": "0.1.5",
      "date": "2023-04-18"
    },
    {
      "version": "0.2.0",
      "date": "2023-10-06"
    },
    {
      "version": "0.2.1",
      "date": "2024-11-14"
    }
  ],
  "_exports": [
    "%+%",
    "%|%",
    "as_dictionary",
    "BOS",
    "dictionary",
    "EOS",
    "info",
    "kgram_freqs",
    "language_model",
    "param",
    "param<-",
    "parameters",
    "perplexity",
    "preprocess",
    "probability",
    "process_sentences",
    "query",
    "sample_sentences",
    "smoothers",
    "tknz_sent",
    "UNK"
  ],
  "_datasets": [
    {
      "name": "midsummer",
      "title": "A Midsummer Night's Dream",
      "object": "midsummer",
      "class": [
        "character"
      ],
      "fields": [],
      "table": false,
      "tojson": true
    },
    {
      "name": "much_ado",
      "title": "Much Ado About Nothing",
      "object": "much_ado",
      "class": [
        "character"
      ],
      "fields": [],
      "table": false,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "grapes-plus-grapes",
      "title": "String concatenation",
      "topics": [
        "%+%"
      ]
    },
    {
      "page": "dictionary",
      "title": "Word dictionaries",
      "topics": [
        "as.character.kgrams_dictionary",
        "as_dictionary",
        "as_dictionary.character",
        "as_dictionary.kgrams_dictionary",
        "dictionary",
        "dictionary.character",
        "dictionary.connection",
        "dictionary.kgram_freqs"
      ]
    },
    {
      "page": "special_tokens",
      "title": "Special Tokens",
      "topics": [
        "BOS",
        "EOS",
        "special_tokens",
        "UNK"
      ]
    },
    {
      "page": "kgram_freqs",
      "title": "k-gram Frequency Tables",
      "topics": [
        "kgram_freqs",
        "kgram_freqs.character",
        "kgram_freqs.connection",
        "kgram_freqs.kgram_freqs",
        "kgram_freqs.numeric",
        "process_sentences",
        "process_sentences.character",
        "process_sentences.connection"
      ]
    },
    {
      "page": "language_model",
      "title": "k-gram Language Models",
      "topics": [
        "language_model",
        "language_model.kgram_freqs",
        "language_model.language_model"
      ]
    },
    {
      "page": "midsummer",
      "title": "A Midsummer Night's Dream",
      "topics": [
        "midsummer"
      ]
    },
    {
      "page": "much_ado",
      "title": "Much Ado About Nothing",
      "topics": [
        "much_ado"
      ]
    },
    {
      "page": "parameters",
      "title": "Language Model Parameters",
      "topics": [
        "param",
        "param.kgram_freqs",
        "param<-",
        "parameters"
      ]
    },
    {
      "page": "perplexity",
      "title": "Language Model Perplexities",
      "topics": [
        "perplexity",
        "perplexity.character",
        "perplexity.connection"
      ]
    },
    {
      "page": "preprocess",
      "title": "Text preprocessing",
      "topics": [
        "preprocess"
      ]
    },
    {
      "page": "probability",
      "title": "Language Model Probabilities",
      "topics": [
        "probability",
        "probability.character",
        "probability.kgrams_word_context"
      ]
    },
    {
      "page": "query",
      "title": "Query k-gram frequency tables or dictionaries",
      "topics": [
        "query",
        "query.kgrams_dictionary",
        "query.kgram_freqs"
      ]
    },
    {
      "page": "sample_sentences",
      "title": "Random Text Generation",
      "topics": [
        "sample_sentences"
      ]
    },
    {
      "page": "smoothers",
      "title": "k-gram Probability Smoothers",
      "topics": [
        "info",
        "smoothers"
      ]
    },
    {
      "page": "tknz_sent",
      "title": "Sentence tokenizer",
      "topics": [
        "tknz_sent"
      ]
    },
    {
      "page": "word_context",
      "title": "Word-context conditional expression",
      "topics": [
        "%|%",
        "word_context"
      ]
    }
  ],
  "_readme": "https://github.com/vgherard/kgrams/raw/v0.2.1/README.md",
  "_rundeps": [
    "rbibutils",
    "Rcpp",
    "RcppProgress",
    "Rdpack",
    "rlang"
  ],
  "_sysdeps": [
    {
      "shlib": "libstdc++",
      "package": "libstdc++6",
      "source": "gcc",
      "version": "16-20260322-1ubuntu1",
      "name": "c++",
      "homepage": "http://gcc.gnu.org/",
      "description": "GNU Standard C++ Library v3"
    }
  ],
  "_vignettes": [
    {
      "source": "kgrams.Rmd",
      "filename": "kgrams.html",
      "title": "Classical $k$-gram Language Models in R",
      "author": "Valerio Gherardi",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Building a $k$-gram language model",
        "Step 1: Loading the training corpus",
        "Step 2: preprocessing and tokenizing sentences",
        "Step 3: get $k$-gram frequency counts",
        "Step 4. Build the final language model",
        "Using language_model objects",
        "Word continuation and sentence probabilities",
        "Generating random text",
        "Compute language model's perplexities",
        "Conclusions",
        "References"
      ],
      "created": "2021-02-06 18:04:34",
      "modified": "2023-10-06 10:21:22",
      "commits": 9
    }
  ],
  "_score": 5.299942900022767,
  "_indexed": true,
  "_nocasepkg": "kgrams",
  "_universes": [
    "vgherard"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.2.1",
      "date": "2026-07-03T19:10:36.000Z",
      "distro": "resolute",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/2f42934f0a67ef3ea4b66a34cf27bc1c8fefd0197ef93fa2924b820ab134183a",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.2.1",
      "date": "2026-07-03T19:10:57.000Z",
      "distro": "resolute",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/b5f8fb1363ad5f531b72b5e2c883e4de2f9c9b4d339fad6299c400a68e188dbb",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.2.1",
      "date": "2026-07-03T19:10:42.000Z",
      "distro": "resolute",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/6bf2676dfd73cbc4c3886664c63cd05eab913e4e673b2d966e77198e52bcb2cc",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.2.1",
      "date": "2026-07-03T19:10:27.000Z",
      "distro": "resolute",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/a14b7f97f54f1ea3036e2d93808a329df3b2c3d410702dce57599030744e6d52",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.2.1",
      "date": "2026-07-03T19:10:13.000Z",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/c2f352fcf28ecb5209953fcf5e6e08bebb196211a93c82022c4ecae725ad98d9",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.2.1",
      "date": "2026-07-03T19:11:02.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/c2f0565172e6b1c698441fc322f28de9665985357c36cd3f5ae8cf11ebca4616",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.2.1",
      "date": "2026-07-03T19:10:01.000Z",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/f0d31192871ddbf93e6ef4bc6d9261ad376e6ac4fe5688233baac153913e6ee1",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.2.1",
      "date": "2026-07-03T19:12:18.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/25ca2b04a5fae36d8db9e23a29104f584a86300d47131cd32fc36897fa8d43c4",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.2.1",
      "date": "2026-07-03T19:10:50.000Z",
      "arch": "emscripten",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/55ef97b4cd861f2b689bd2e8cb9a587e9be5a4eb00f8454f3fffe20358962d97",
      "status": "success",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.2.1",
      "date": "2026-07-03T19:09:30.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/8ab4939a0f0cb5f25efed3fd52a221fd4d5fb903c4ed861ec5d9ae453ebad59d",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.2.1",
      "date": "2026-07-03T19:09:26.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/082e5f89045374802135af259e557db0fec8df2c0714f1c28c64e39a9f6289b9",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "0.2.1",
      "date": "2026-07-03T19:09:26.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/34d046cc31e02d2348973898ca0684a5da4f4e180afe5d340010b389f424c8a9",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/28678902009"
    }
  ]
}