{"id":40856093,"url":"https://github.com/spro/nalgene-js","last_synced_at":"2026-01-21T23:46:37.633Z","repository":{"id":57307536,"uuid":"83853068","full_name":"spro/nalgene-js","owner":"spro","description":"Natural language generation language","archived":false,"fork":false,"pushed_at":"2019-01-11T17:11:22.000Z","size":55,"stargazers_count":6,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-18T17:54:08.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-04T00:21:19.000Z","updated_at":"2022-09-29T07:30:20.000Z","dependencies_parsed_at":"2022-08-29T02:41:24.780Z","dependency_job_id":null,"html_url":"https://github.com/spro/nalgene-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spro/nalgene-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fnalgene-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fnalgene-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fnalgene-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fnalgene-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spro","download_url":"https://codeload.github.com/spro/nalgene-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spro%2Fnalgene-js/sbom","scorecard":{"id":842607,"data":{"date":"2025-08-11","repo":{"name":"github.com/spro/nalgene-js","commit":"eccb5ffc97edaea8f31ec3cac460a7af63edec63"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T20:48:42.523Z","repository_id":57307536,"created_at":"2025-08-23T20:48:42.524Z","updated_at":"2025-08-23T20:48:42.524Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28646977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-21T23:46:37.144Z","updated_at":"2026-01-21T23:46:37.628Z","avatar_url":"https://github.com/spro.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nalgene-js\n\n## Installation\n\nAs a local Node module:\n\n```\nnpm install nalgene\n```\n\nOr to use the `nalgene` command line tool:\n\n```\nnpm install -g nalgene\n```\n\n## What is this?\n\nThe basic idea of Nalgene is to generate sentences based on a *grammar* and a set of *variables*. The grammar defines a recursive tree of *phrases* that can be generated given some variables, and the generator will expand those phrases into a sentence that makes the most use of the variables.\n\n```\n\u003e nalgene examples/iot.nlg --device \"office light\" --state \"on\"\nThe office light is now on.\n\n\u003e nalgene examples/iot.nlg --asset \"bitcoin\" --price \"$1155.33\"\nBitcoin is at $1155.33.\n\n\u003e nalgene examples/order.nlg --food \"a burger\" --location \"Tokyo\"\nYou're looking for a burger in Tokyo?\n\n\u003e nalgene examples/order.nlg --food \"a burger\"\nYou're looking for a burger?\n\n\u003e nalgene examples/order.nlg\nYou're looking for some food?\n```\n\n## Syntax\n\n### Phrases\n\nPhrases represent multiple sets of tokens, where each set of tokens is a different \"possibility\", and each token is either a regular word or a special token. A phrase may have many possibilities for different ways to say the same sentence with different amounts of context (from variables, below).\n\n```\n%\n    %sayHi\n    %sayBye\n\n%sayHi\n    hello there\n    hi\n\n%sayBye\n    %formalBye\n    %informalBye\n\n%formalBye\n    farewell\n\n%informalBye\n    bye\n    cya\n```\n\nWhen generating you supply an \"entry phrase\" to expand from, which is `%` by default. In this example, expanding from `%` would start a random walk down all the possibilities, expanding each phrase token it encounters, to generate one of \"hello there\", \"hi\", \"farewell\", \"bye\", or \"cya\". Generating from the specific node `%informalBye` would return only \"bye\" or \"cya\".\n\n### Variables\n\nVariables are user-supplied values that also influence phrase selection.\n\nIf a phrase possibility has variables, it will only be used if all of the variables are available in the context. During generation phrases are ranked by the number of variables that match, to generate a sentence that uses the most context.\n\nFor example, with this simple grammar:\n\n```\n%confirmFoodSearch\n    You're looking for $food in $location ?\n    You're looking for some food in $location ?\n    You're looking for $food ?\n    You're looking for some food ?\n```\n\nNalgene will generate the output that satisfies the most variables from the context:\n\n```\n%confirmFoodSearch $food=\"a burger\" $location=\"Tokyo\"\n\u003e You're looking for a burger in Tokyo?\n\n%confirmFoodSearch $food=\"a burger\"\n\u003e You're looking for a burger?\n\n%confirmFoodSearch\n\u003e You're looking for some food?\n```\n\n## Examples\n\n`examples/iot.nlg` defines some responses for a conversational IoT bot:\n\n```\n\u003e nalgene examples/iot.nlg --device \"office light\" --state \"on\"\nThe office light is now on.\n\n\u003e nalgene examples/iot.nlg --asset \"bitcoin\" --price \"$1155.33\"\nBitcoin is at $1155.33.\n```\n\n## Usage\n\n*TODO*: Expand\n\n```coffeescript\nnalgene = require 'nalgene'\n\ngrammar = nalgene.parse '...'\ngrammar.addChild nalgene.parse.fromCSV '...'\ngrammar.addChild nalgene.parse.fromObject {...}\nnalgene.generate grammar, {...}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspro%2Fnalgene-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspro%2Fnalgene-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspro%2Fnalgene-js/lists"}