pax_global_header00006660000000000000000000000064140354541440014516gustar00rootroot0000000000000052 comment=7618493a715852ee701cb8c9d48d31c52aa0a7af irregular-plurals-3.3.0/000077500000000000000000000000001403545414400151755ustar00rootroot00000000000000irregular-plurals-3.3.0/.editorconfig000066400000000000000000000002571403545414400176560ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 irregular-plurals-3.3.0/.gitattributes000066400000000000000000000000231403545414400200630ustar00rootroot00000000000000* text=auto eol=lf irregular-plurals-3.3.0/.github/000077500000000000000000000000001403545414400165355ustar00rootroot00000000000000irregular-plurals-3.3.0/.github/workflows/000077500000000000000000000000001403545414400205725ustar00rootroot00000000000000irregular-plurals-3.3.0/.github/workflows/main.yml000066400000000000000000000007021403545414400222400ustar00rootroot00000000000000name: CI on: - push - pull_request jobs: test: name: Node.js ${{ matrix.node-version }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: node-version: - 14 - 12 - 10 - 8 steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test irregular-plurals-3.3.0/.gitignore000066400000000000000000000000271403545414400171640ustar00rootroot00000000000000node_modules yarn.lock irregular-plurals-3.3.0/.npmrc000066400000000000000000000000231403545414400163100ustar00rootroot00000000000000package-lock=false irregular-plurals-3.3.0/index.d.ts000066400000000000000000000002741403545414400171010ustar00rootroot00000000000000import irregularPluralsJson = require('./irregular-plurals.json'); declare const irregularPlurals: ReadonlyMap< keyof typeof irregularPluralsJson, string >; export = irregularPlurals; irregular-plurals-3.3.0/index.js000066400000000000000000000003501403545414400166400ustar00rootroot00000000000000'use strict'; const irregularPlurals = require('./irregular-plurals.json'); // Ensure nobody can modify each others Map Object.defineProperty(module, 'exports', { get() { return new Map(Object.entries(irregularPlurals)); } }); irregular-plurals-3.3.0/index.test-d.ts000066400000000000000000000003451403545414400200550ustar00rootroot00000000000000import {expectType} from 'tsd'; import irregularPluralsJson = require('./irregular-plurals.json'); import irregularPlurals = require('.'); expectType>( irregularPlurals ); irregular-plurals-3.3.0/irregular-plurals.json000066400000000000000000000061511403545414400215470ustar00rootroot00000000000000{ "addendum": "addenda", "aircraft": "aircraft", "alga": "algae", "alumna": "alumnae", "alumnus": "alumni", "amoeba": "amoebae", "analysis": "analyses", "antenna": "antennae", "antithesis": "antitheses", "apex": "apices", "appendix": "appendices", "automaton": "automata", "axis": "axes", "bacillus": "bacilli", "bacterium": "bacteria", "barracks": "barracks", "basis": "bases", "beau": "beaux", "bison": "bison", "buffalo": "buffalo", "bureau": "bureaus", "cactus": "cacti", "calf": "calves", "carp": "carp", "census": "censuses", "chassis": "chassis", "cherub": "cherubim", "child": "children", "château": "châteaus", "cod": "cod", "codex": "codices", "concerto": "concerti", "corpus": "corpora", "crisis": "crises", "criterion": "criteria", "curriculum": "curricula", "datum": "data", "deer": "deer", "diagnosis": "diagnoses", "die": "dice", "dwarf": "dwarfs", "echo": "echoes", "elf": "elves", "elk": "elk", "ellipsis": "ellipses", "embargo": "embargoes", "emphasis": "emphases", "erratum": "errata", "faux pas": "faux pas", "fez": "fezes", "firmware": "firmware", "fish": "fish", "focus": "foci", "foot": "feet", "formula": "formulae", "fungus": "fungi", "gallows": "gallows", "genus": "genera", "goose": "geese", "graffito": "graffiti", "grouse": "grouse", "half": "halves", "hero": "heroes", "hoof": "hooves", "hovercraft": "hovercraft", "hypothesis": "hypotheses", "index": "indices", "kakapo": "kakapo", "knife": "knives", "larva": "larvae", "leaf": "leaves", "libretto": "libretti", "life": "lives", "loaf": "loaves", "locus": "loci", "louse": "lice", "man": "men", "matrix": "matrices", "means": "means", "medium": "media", "media": "media", "memorandum": "memoranda", "millennium": "millennia", "minutia": "minutiae", "moose": "moose", "mouse": "mice", "nebula": "nebulae", "nemesis": "nemeses", "neurosis": "neuroses", "news": "news", "nucleus": "nuclei", "oasis": "oases", "offspring": "offspring", "opus": "opera", "ovum": "ova", "ox": "oxen", "paralysis": "paralyses", "parenthesis": "parentheses", "person": "people", "phenomenon": "phenomena", "phylum": "phyla", "pike": "pike", "polyhedron": "polyhedra", "potato": "potatoes", "prognosis": "prognoses", "quiz": "quizzes", "radius": "radii", "referendum": "referenda", "salmon": "salmon", "scarf": "scarves", "self": "selves", "series": "series", "sheep": "sheep", "shelf": "shelves", "shrimp": "shrimp", "soliloquy": "soliloquies", "spacecraft": "spacecraft", "species": "species", "spectrum": "spectra", "squid": "squid", "stimulus": "stimuli", "stratum": "strata", "swine": "swine", "syllabus": "syllabi", "symposium": "symposia", "synopsis": "synopses", "synthesis": "syntheses", "tableau": "tableaus", "that": "those", "thesis": "theses", "thief": "thieves", "this": "these", "tomato": "tomatoes", "tooth": "teeth", "trout": "trout", "tuna": "tuna", "vertebra": "vertebrae", "vertex": "vertices", "veto": "vetoes", "vita": "vitae", "vortex": "vortices", "watercraft": "watercraft", "wharf": "wharves", "wife": "wives", "wolf": "wolves", "woman": "women" } irregular-plurals-3.3.0/license000066400000000000000000000021251403545414400165420ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. irregular-plurals-3.3.0/package.json000066400000000000000000000013431403545414400174640ustar00rootroot00000000000000{ "name": "irregular-plurals", "version": "3.3.0", "description": "Map of nouns to their irregular plural form", "license": "MIT", "repository": "sindresorhus/irregular-plurals", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts", "irregular-plurals.json" ], "keywords": [ "word", "words", "list", "map", "hash", "json", "irregular", "plural", "plurals", "noun", "nouns" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.2", "xo": "^0.24.0" }, "tsd": { "compilerOptions": { "resolveJsonModule": true } } } irregular-plurals-3.3.0/readme.md000066400000000000000000000015111403545414400167520ustar00rootroot00000000000000# irregular-plurals > Map of nouns to their irregular plural form > An irregular plural in this library is defined as a noun that cannot be made plural by applying these rules: > - If the noun ends in an "s", "x", "z", "ch" or "sh", add "es" > - If the noun ends in a "y" and is preceded by a consonant, drop the "y" and add "ies" > - If the noun ends in a "y" and is preceded by a vowel, add "s" The list is just a [JSON file](irregular-plurals.json) and can be used anywhere. ## Install ``` $ npm install irregular-plurals ``` ## Usage ```js const irregularPlurals = require('irregular-plurals'); console.log(irregularPlurals.get('cactus')); //=> 'cacti' console.log(irregularPlurals); /* Map { [addendum, 'addenda'], [alga, 'algae'], … } */ ``` ## Related - [plur](https://github.com/sindresorhus/plur) - Pluralize a word irregular-plurals-3.3.0/test.js000066400000000000000000000005751403545414400165210ustar00rootroot00000000000000import test from 'ava'; import irregularPlurals from '.'; test('main', t => { t.true(irregularPlurals.has('calf')); t.is(irregularPlurals.get('calf'), 'calves'); }); test('isolated', t => { const fresh1 = require('.'); const fresh2 = require('.'); fresh1.delete('calf'); t.false(fresh1.has('calf')); t.true(fresh2.has('calf')); t.true(irregularPlurals.has('calf')); });