{
  "_id": "6ab22b6d3d719c1f84089c5e",
  "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-09-22 07:09:23 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/dacc9377138ff163a15c4b4960846533a54597a1bc2d66162c7f464612a509d3",
  "_filesize": 430997,
  "_sha256": "dacc9377138ff163a15c4b4960846533a54597a1bc2d66162c7f464612a509d3",
  "_expires": "2026-12-31T07:16:59.000Z",
  "_created": "2026-09-22T07:09:23.000Z",
  "_published": "2026-09-22T07:17:01.359Z",
  "_jobs": [
    {
      "job": 106649933491,
      "time": 174,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "10680748883"
    },
    {
      "job": 106649933878,
      "time": 189,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "10681568554"
    },
    {
      "job": 106649933556,
      "time": 167,
      "config": "linux-release-arm64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "10680594135"
    },
    {
      "job": 106649933517,
      "time": 189,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "10681143111"
    },
    {
      "job": 106649933464,
      "time": 117,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "NOTE",
      "artifact": "10680753687"
    },
    {
      "job": 106649933519,
      "time": 215,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "NOTE",
      "artifact": "10681273036"
    },
    {
      "job": 106649933623,
      "time": 150,
      "config": "macos-release-arm64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "10681163076"
    },
    {
      "job": 106649933628,
      "time": 263,
      "config": "macos-release-x86_64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "10680963688"
    },
    {
      "job": 106648629028,
      "time": 296,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "10681262565"
    },
    {
      "job": 106649933432,
      "time": 128,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "10681242973"
    },
    {
      "job": 106649933526,
      "time": 364,
      "config": "windows-devel-arm64",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "10681522992"
    },
    {
      "job": 106649933569,
      "time": 217,
      "config": "windows-devel-x86_64",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "10681417784"
    },
    {
      "job": 106649933578,
      "time": 143,
      "config": "windows-oldrel-x86_64",
      "r": "4.5.3",
      "check": "NOTE",
      "artifact": "10680848793"
    },
    {
      "job": 106649933597,
      "time": 374,
      "config": "windows-release-arm64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "10680838920"
    },
    {
      "job": 106649933535,
      "time": 172,
      "config": "windows-release-x86_64",
      "r": "4.6.1",
      "check": "NOTE",
      "artifact": "10681347853"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422",
  "_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": 13,
    "description": "|physicist>   +   |data scientist>"
  },
  "_downloads": {
    "count": 506,
    "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/manual.pdf",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md"
  ],
  "_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-09-22T07:12:08.000Z",
      "distro": "resolute",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/e183740e405c09105a7b28582e2c14052a36f3e010009cc38cea516c6e39246a",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.2.1",
      "date": "2026-09-22T07:12:12.000Z",
      "distro": "resolute",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/8e1e96c781b17fb3a881ec0bfa831f1d6bc43087ff605fa47473b8eeb37522dd",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.2.1",
      "date": "2026-09-22T07:12:06.000Z",
      "distro": "resolute",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/f5f75a5c268af99988155a36d1738e574cf9636193aef75e5e536a0ae69195a5",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.2.1",
      "date": "2026-09-22T07:12:18.000Z",
      "distro": "resolute",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/81b2e14a58182691a6dca9ca14acd5f374a98c221a7765fd38fee24a720b19cb",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.2.1",
      "date": "2026-09-22T07:11:31.000Z",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/0e1d7f7bde62208a494f320f30267520cdf79d3c601111dfc41d8ee4dbb78b9b",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.2.1",
      "date": "2026-09-22T07:12:19.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/5ce8f909b6fa2bcf949b2ac9d555329fbc7f679d6aad695323302aeffdd12acc",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.2.1",
      "date": "2026-09-22T07:11:50.000Z",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/924c6a6cbbf4e30eb99eb908427ddecbe22dc4a24f40087f810447061f7542e4",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.2.1",
      "date": "2026-09-22T07:13:00.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/cf2160590243a32faf4d70cd5fc854def68f8ad0f72bde075b881178e971a914",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.2.1",
      "date": "2026-09-22T07:12:00.000Z",
      "arch": "emscripten",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/0c66329f9a2d0a703358e80c973c85f82101cc60b83ec7880937b3b4e739a858",
      "status": "success",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.2.1",
      "date": "2026-09-22T07:14:32.000Z",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/3af4f550e2e6d29b0299d73eeb82c547ac75fb0b280c3e20b6db64a78665159f",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.2.1",
      "date": "2026-09-22T07:11:14.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/da429e59e02fbb92e1cd3f73c073626f141980afd39d619379c6d815cb207a04",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.2.1",
      "date": "2026-09-22T07:11:03.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/d616a14f0854409ed4f730b2493a3983dd06c04371edc439fedfa8b1d04e4555",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "0.2.1",
      "date": "2026-09-22T07:14:42.000Z",
      "arch": "aarch64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/03808fd980d28a6385fa1ea5abbf5060d0223cea40dbee03309a42580e7e40b5",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "0.2.1",
      "date": "2026-09-22T07:11:05.000Z",
      "arch": "x86_64",
      "commit": "bf86cee71acc90aa00fd5d570cebebc293359486",
      "fileid": "https://r2.ropensci.org/370e9f247b4a68ccebd8c47020aa887eb9f87e63eaec17f226405a7cead7b5d4",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/vgherard/actions/runs/35697816422"
    }
  ]
}