{"id":16170416,"url":"https://github.com/corentinth/autheur","last_synced_at":"2025-07-16T06:45:25.430Z","repository":{"id":57676802,"uuid":"425624700","full_name":"CorentinTh/autheur","owner":"CorentinTh","description":"Random french sentence generator","archived":false,"fork":false,"pushed_at":"2024-02-09T13:14:51.000Z","size":233,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T00:03:45.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://autheur.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CorentinTh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["CorentinTh"]}},"created_at":"2021-11-07T21:53:09.000Z","updated_at":"2024-11-19T14:07:33.000Z","dependencies_parsed_at":"2024-10-27T19:19:45.995Z","dependency_job_id":"9cc09be0-17e9-4d2c-92c0-ccd61fa225a4","html_url":"https://github.com/CorentinTh/autheur","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"a17ee1f495d88fd513217d9fd6caac4abed07084"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fautheur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fautheur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fautheur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fautheur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CorentinTh","download_url":"https://codeload.github.com/CorentinTh/autheur/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161273,"owners_count":21057555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-10T03:18:41.256Z","updated_at":"2025-04-10T05:05:41.399Z","avatar_url":"https://github.com/CorentinTh.png","language":"TypeScript","funding_links":["https://github.com/sponsors/CorentinTh"],"categories":[],"sub_categories":[],"readme":"# autheur\n\n[![CI](https://github.com/CorentinTh/autheur/actions/workflows/ci.yml/badge.svg)](https://github.com/CorentinTh/autheur/actions/workflows/ci.yml)\n\n\u003e Simple random french sentence (with correct grammar) generator\n\n```typescript\nimport { generate, determinant, noun, adverb, adjective } from '@autheur/generator';\n\nconst sentence = generate([determinant(), noun(), adverb(), adjective()]);\n// une croix peut-être importante\n```\n\n## Installation\n\nInstall using your favorite dependency manager.\n\n**NPM**\n\n```bash\nnpm install @autheur/generator\n```\n\n**PNPM**\n\n```bash\npnpm install @autheur/generator\n```\n\n**Yarn**\n\n```bash\nyarn add @autheur/generator\n```\n\n## Usage\n\nThe core function is `generate`: it permits to generate a sentence given a pattern\n\n```typescript\nimport { generate, determinant, noun, adverb, adjective } from '@autheur/generator';\n\nconst sentence = generate([determinant(), noun(), adverb(), adjective()]);\n\nconsole.log(sentence);\n// leurs taille-crayons à demi alourdis\n```\n\n## Generators\n\nA generator permits to define a portion of the sentence\n\n### `determinant`\n\nGenerate a determinant (_un_, _une_, _le_, _les_, _cette_, ...)\n\n```typescript\nimport { generate, determinant } from '@autheur/generator';\n\ngenerate([determinant()]); // mon\n```\n\nYou can specify which types of determinant you want between **undefined**, **defined**, **possessive**, **demonstrative**\n\n```typescript\nimport { generate, determinant } from '@autheur/generator';\n\ngenerate([determinant({ types: ['possessive'] })]); // notre\n```\n\n### `noun`\n\nGenerate a noun.\n\n- the noun generated will impose its form (gender + plurality) to the rest of the sentence.\n- by default the plurality is randomly chosen\n\n```typescript\nimport { generate, noun } from '@autheur/generator';\n\ngenerate([noun()]); // allumette\n```\n\nYou can force the plurality with a parameter\n\n```typescript\nimport { generate, determinant } from '@autheur/generator';\n\ngenerate([noun({ isPlural: true })]); // animaux\ngenerate([noun({ isPlural: false })]); // ampoule\n```\n\n### `comma`\n\nGenerate a comma.\n\n```typescript\nimport { generate, comma } from '@autheur/generator';\n\ngenerate([comma()]); // ,\n```\n\n### `adverb`\n\nGenerate an adverb.\n\n```typescript\nimport { generate, adverb } from '@autheur/generator';\n\ngenerate([adverb()]); // suffisamment\n```\n\n### `word`\n\nGenerate an word that you specify.\n\n```typescript\nimport { generate, word } from '@autheur/generator';\n\ngenerate([word('foobar')]); // foobar\n```\n\nYou can specify if your word is preceded or followed by a space if their is another word\n\n```typescript\nimport { generate, word } from '@autheur/generator';\n\ngenerate([word(\"l'\", { noSpaceAfter: true }), word('arbre')]); // l'arbre\ngenerate([word(\"l'\"), word('arbre', { noSpaceBefore: true })]); // l'arbre\n```\n\n### `subject`\n\nGenerate an subject to be used with a verb.\n\n```typescript\nimport { generate, subject } from '@autheur/generator';\n\ngenerate([subject()]); // je\n```\n\nYou can specify the gender and/or the plurality\n\n```typescript\nimport { generate, subject } from '@autheur/generator';\n\ngenerate([subject({ isPlural: true })]); // nous, vous, ils, elles\ngenerate([subject({ isPlural: false })]); // je, tu, il, elle, on\n\ngenerate([subject({ isFeminine: true })]); // je, tu, on, elle, nous, vous, elles\ngenerate([subject({ isFeminine: false })]); // je, tu, on, il, nous, vous, ils\n\ngenerate([subject({ isFeminine: false, isPlural: false })]); // je, tu, on, elle\n```\n\n### `oneOf`\n\nGet a random word/sentence from a list that you specify.\n\n```typescript\nimport { generate, oneOf } from '@autheur/generator';\n\ngenerate([oneOf(['foobar', 'yolo'])]); // yolo\n```\n\n## Packages\n\nThis is a monorepo with the following packages:\n\n| Package                                       | Description                                                  |\n| --------------------------------------------- | ------------------------------------------------------------ |\n| [`@autheur/dataset`](./packages/datasets/)    | Dataset of sorted french words broke down by categories      |\n| [`@autheur/generator`](./packages/generator/) | The generator itself with they logic                         |\n| [`@autheur/operators`](./packages/operators/) | Utilities to manipulate words (ex: pluralize, feminize, ...) |\n\n## Credits\n\nCoded with ❤️ by [Corentin Thomasset](//corentin-thomasset.fr).\n\n## License\n\nThis project is under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Fautheur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorentinth%2Fautheur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Fautheur/lists"}