Beispiel #1
0
        internal EnglishPluralizationService()
        {
            this.Culture = new CultureInfo("en");

            this._userDictionary = new BidirectionalDictionary <string, string>();

            this._irregularPluralsPluralizationService =
                new StringBidirectionalDictionary(this._irregularPluralsDictionary);
            this._assimilatedClassicalInflectionPluralizationService =
                new StringBidirectionalDictionary(this._assimilatedClassicalInflectionDictionary);
            this._oSuffixPluralizationService =
                new StringBidirectionalDictionary(this._oSuffixDictionary);
            this._classicalInflectionPluralizationService =
                new StringBidirectionalDictionary(this._classicalInflectionDictionary);
            this._wordsEndingWithSePluralizationService =
                new StringBidirectionalDictionary(this._wordsEndingWithSeDictionary);
            this._wordsEndingWithSisPluralizationService =
                new StringBidirectionalDictionary(this._wordsEndingWithSisDictionary);
            this._wordsEndingWithSusPluralizationService =
                new StringBidirectionalDictionary(this._wordsEndingWithSusDictionary);
            this._wordsEndingWithInxAnxYnxPluralizationService =
                new StringBidirectionalDictionary(this._wordsEndingWithInxAnxYnxDictionary);

            // verb
            this._irregularVerbPluralizationService =
                new StringBidirectionalDictionary(this._irregularVerbList);

            this._knownSingluarWords = new List <string>(
                _irregularPluralsDictionary.Keys
                .Concat(_assimilatedClassicalInflectionDictionary.Keys)
                .Concat(_oSuffixDictionary.Keys)
                .Concat(_classicalInflectionDictionary.Keys)
                .Concat(_irregularVerbList.Keys)
                .Concat(_irregularPluralsDictionary.Keys)
                .Concat(_wordsEndingWithSeDictionary.Keys)
                .Concat(_wordsEndingWithSisDictionary.Keys)
                .Concat(_wordsEndingWithSusDictionary.Keys)
                .Concat(_wordsEndingWithInxAnxYnxDictionary.Keys)
                .Concat(_uninflectiveWordList)
                .Except(this._knownConflictingPluralList)); // see the _knowConflictingPluralList comment above

            this._knownPluralWords = new List <string>(
                _irregularPluralsDictionary.Values
                .Concat(_assimilatedClassicalInflectionDictionary.Values)
                .Concat(_oSuffixDictionary.Values)
                .Concat(_classicalInflectionDictionary.Values)
                .Concat(_irregularVerbList.Values)
                .Concat(_irregularPluralsDictionary.Values)
                .Concat(_wordsEndingWithSeDictionary.Values)
                .Concat(_wordsEndingWithSisDictionary.Values)
                .Concat(_wordsEndingWithSusDictionary.Values)
                .Concat(_wordsEndingWithInxAnxYnxDictionary.Values)
                .Concat(_uninflectiveWordList));
        }
        internal EnglishPluralizationService()
        {
            Dictionary <string, string> strs = new Dictionary <string, string>()
            {
                { "am", "are" },
                { "are", "are" },
                { "is", "are" },
                { "was", "were" },
                { "were", "were" },
                { "has", "have" },
                { "have", "have" }
            };

            this._irregularVerbList = strs;
            List <string> strs1 = new List <string>()
            {
                "I",
                "we",
                "you",
                "he",
                "she",
                "they",
                "it",
                "me",
                "us",
                "him",
                "her",
                "them",
                "myself",
                "ourselves",
                "yourself",
                "himself",
                "herself",
                "itself",
                "oneself",
                "oneselves",
                "my",
                "our",
                "your",
                "his",
                "their",
                "its",
                "mine",
                "yours",
                "hers",
                "theirs",
                "this",
                "that",
                "these",
                "those",
                "all",
                "another",
                "any",
                "anybody",
                "anyone",
                "anything",
                "both",
                "each",
                "other",
                "either",
                "everyone",
                "everybody",
                "everything",
                "most",
                "much",
                "nothing",
                "nobody",
                "none",
                "one",
                "others",
                "some",
                "somebody",
                "someone",
                "something",
                "what",
                "whatever",
                "which",
                "whichever",
                "who",
                "whoever",
                "whom",
                "whomever",
                "whose"
            };

            this._pronounList = strs1;
            Dictionary <string, string> strs2 = new Dictionary <string, string>()
            {
                { "brother", "brothers" },
                { "child", "children" },
                { "cow", "cows" },
                { "ephemeris", "ephemerides" },
                { "genie", "genies" },
                { "money", "moneys" },
                { "mongoose", "mongooses" },
                { "mythos", "mythoi" },
                { "octopus", "octopuses" },
                { "ox", "oxen" },
                { "soliloquy", "soliloquies" },
                { "trilby", "trilbys" },
                { "crisis", "crises" },
                { "synopsis", "synopses" },
                { "rose", "roses" },
                { "gas", "gases" },
                { "bus", "buses" },
                { "axis", "axes" },
                { "memo", "memos" },
                { "casino", "casinos" },
                { "silo", "silos" },
                { "stereo", "stereos" },
                { "studio", "studios" },
                { "lens", "lenses" },
                { "alias", "aliases" },
                { "pie", "pies" },
                { "corpus", "corpora" },
                { "viscus", "viscera" },
                { "hippopotamus", "hippopotami" },
                { "trace", "traces" },
                { "person", "people" },
                { "chilli", "chillies" },
                { "analysis", "analyses" },
                { "basis", "bases" },
                { "neurosis", "neuroses" },
                { "oasis", "oases" },
                { "synthesis", "syntheses" },
                { "thesis", "theses" },
                { "pneumonoultramicroscopicsilicovolcanoconiosis", "pneumonoultramicroscopicsilicovolcanoconioses" },
                { "status", "statuses" },
                { "prospectus", "prospectuses" },
                { "change", "changes" },
                { "lie", "lies" },
                { "calorie", "calories" },
                { "freebie", "freebies" },
                { "case", "cases" },
                { "house", "houses" },
                { "valve", "valves" },
                { "cloth", "clothes" }
            };

            this._irregularPluralsList = strs2;
            Dictionary <string, string> strs3 = new Dictionary <string, string>()
            {
                { "alumna", "alumnae" },
                { "alga", "algae" },
                { "vertebra", "vertebrae" },
                { "codex", "codices" },
                { "murex", "murices" },
                { "silex", "silices" },
                { "aphelion", "aphelia" },
                { "hyperbaton", "hyperbata" },
                { "perihelion", "perihelia" },
                { "asyndeton", "asyndeta" },
                { "noumenon", "noumena" },
                { "phenomenon", "phenomena" },
                { "criterion", "criteria" },
                { "organon", "organa" },
                { "prolegomenon", "prolegomena" },
                { "agendum", "agenda" },
                { "datum", "data" },
                { "extremum", "extrema" },
                { "bacterium", "bacteria" },
                { "desideratum", "desiderata" },
                { "stratum", "strata" },
                { "candelabrum", "candelabra" },
                { "erratum", "errata" },
                { "ovum", "ova" },
                { "forum", "fora" },
                { "addendum", "addenda" },
                { "stadium", "stadia" },
                { "automaton", "automata" },
                { "polyhedron", "polyhedra" }
            };

            this._assimilatedClassicalInflectionList = strs3;
            Dictionary <string, string> strs4 = new Dictionary <string, string>()
            {
                { "albino", "albinos" },
                { "generalissimo", "generalissimos" },
                { "manifesto", "manifestos" },
                { "archipelago", "archipelagos" },
                { "ghetto", "ghettos" },
                { "medico", "medicos" },
                { "armadillo", "armadillos" },
                { "guano", "guanos" },
                { "octavo", "octavos" },
                { "commando", "commandos" },
                { "inferno", "infernos" },
                { "photo", "photos" },
                { "ditto", "dittos" },
                { "jumbo", "jumbos" },
                { "pro", "pros" },
                { "dynamo", "dynamos" },
                { "lingo", "lingos" },
                { "quarto", "quartos" },
                { "embryo", "embryos" },
                { "lumbago", "lumbagos" },
                { "rhino", "rhinos" },
                { "fiasco", "fiascos" },
                { "magneto", "magnetos" },
                { "stylo", "stylos" }
            };

            this._oSuffixList = strs4;
            Dictionary <string, string> strs5 = new Dictionary <string, string>()
            {
                { "stamen", "stamina" },
                { "foramen", "foramina" },
                { "lumen", "lumina" },
                { "anathema", "anathemata" },
                { "enema", "enemata" },
                { "oedema", "oedemata" },
                { "bema", "bemata" },
                { "enigma", "enigmata" },
                { "sarcoma", "sarcomata" },
                { "carcinoma", "carcinomata" },
                { "gumma", "gummata" },
                { "schema", "schemata" },
                { "charisma", "charismata" },
                { "lemma", "lemmata" },
                { "soma", "somata" },
                { "diploma", "diplomata" },
                { "lymphoma", "lymphomata" },
                { "stigma", "stigmata" },
                { "dogma", "dogmata" },
                { "magma", "magmata" },
                { "stoma", "stomata" },
                { "drama", "dramata" },
                { "melisma", "melismata" },
                { "trauma", "traumata" },
                { "edema", "edemata" },
                { "miasma", "miasmata" },
                { "abscissa", "abscissae" },
                { "formula", "formulae" },
                { "medusa", "medusae" },
                { "amoeba", "amoebae" },
                { "hydra", "hydrae" },
                { "nebula", "nebulae" },
                { "antenna", "antennae" },
                { "hyperbola", "hyperbolae" },
                { "nova", "novae" },
                { "aurora", "aurorae" },
                { "lacuna", "lacunae" },
                { "parabola", "parabolae" },
                { "apex", "apices" },
                { "latex", "latices" },
                { "vertex", "vertices" },
                { "cortex", "cortices" },
                { "pontifex", "pontifices" },
                { "vortex", "vortices" },
                { "index", "indices" },
                { "simplex", "simplices" },
                { "iris", "irides" },
                { "clitoris", "clitorides" },
                { "alto", "alti" },
                { "contralto", "contralti" },
                { "soprano", "soprani" },
                { "basso", "bassi" },
                { "crescendo", "crescendi" },
                { "tempo", "tempi" },
                { "canto", "canti" },
                { "solo", "soli" },
                { "aquarium", "aquaria" },
                { "interregnum", "interregna" },
                { "quantum", "quanta" },
                { "compendium", "compendia" },
                { "lustrum", "lustra" },
                { "rostrum", "rostra" },
                { "consortium", "consortia" },
                { "maximum", "maxima" },
                { "spectrum", "spectra" },
                { "cranium", "crania" },
                { "medium", "media" },
                { "speculum", "specula" },
                { "curriculum", "curricula" },
                { "memorandum", "memoranda" },
                { "stadium", "stadia" },
                { "dictum", "dicta" },
                { "millenium", "millenia" },
                { "trapezium", "trapezia" },
                { "emporium", "emporia" },
                { "minimum", "minima" },
                { "ultimatum", "ultimata" },
                { "enconium", "enconia" },
                { "momentum", "momenta" },
                { "vacuum", "vacua" },
                { "gymnasium", "gymnasia" },
                { "optimum", "optima" },
                { "velum", "vela" },
                { "honorarium", "honoraria" },
                { "phylum", "phyla" },
                { "focus", "foci" },
                { "nimbus", "nimbi" },
                { "succubus", "succubi" },
                { "fungus", "fungi" },
                { "nucleolus", "nucleoli" },
                { "torus", "tori" },
                { "genius", "genii" },
                { "radius", "radii" },
                { "umbilicus", "umbilici" },
                { "incubus", "incubi" },
                { "stylus", "styli" },
                { "uterus", "uteri" },
                { "stimulus", "stimuli" },
                { "apparatus", "apparatus" },
                { "impetus", "impetus" },
                { "prospectus", "prospectus" },
                { "cantus", "cantus" },
                { "nexus", "nexus" },
                { "sinus", "sinus" },
                { "coitus", "coitus" },
                { "plexus", "plexus" },
                { "status", "status" },
                { "hiatus", "hiatus" },
                { "afreet", "afreeti" },
                { "afrit", "afriti" },
                { "efreet", "efreeti" },
                { "cherub", "cherubim" },
                { "goy", "goyim" },
                { "seraph", "seraphim" },
                { "alumnus", "alumni" }
            };

            this._classicalInflectionList = strs5;
            List <string> strs6 = new List <string>()
            {
                "they",
                "them",
                "their",
                "have",
                "were",
                "yourself",
                "are"
            };

            this._knownConflictingPluralList = strs6;
            Dictionary <string, string> strs7 = new Dictionary <string, string>()
            {
                { "house", "houses" },
                { "case", "cases" },
                { "enterprise", "enterprises" },
                { "purchase", "purchases" },
                { "surprise", "surprises" },
                { "release", "releases" },
                { "disease", "diseases" },
                { "promise", "promises" },
                { "refuse", "refuses" },
                { "whose", "whoses" },
                { "phase", "phases" },
                { "noise", "noises" },
                { "nurse", "nurses" },
                { "rose", "roses" },
                { "franchise", "franchises" },
                { "supervise", "supervises" },
                { "farmhouse", "farmhouses" },
                { "suitcase", "suitcases" },
                { "recourse", "recourses" },
                { "impulse", "impulses" },
                { "license", "licenses" },
                { "diocese", "dioceses" },
                { "excise", "excises" },
                { "demise", "demises" },
                { "blouse", "blouses" },
                { "bruise", "bruises" },
                { "misuse", "misuses" },
                { "curse", "curses" },
                { "prose", "proses" },
                { "purse", "purses" },
                { "goose", "gooses" },
                { "tease", "teases" },
                { "poise", "poises" },
                { "vase", "vases" },
                { "fuse", "fuses" },
                { "muse", "muses" },
                { "slaughterhouse", "slaughterhouses" },
                { "clearinghouse", "clearinghouses" },
                { "endonuclease", "endonucleases" },
                { "steeplechase", "steeplechases" },
                { "metamorphose", "metamorphoses" },
                { "intercourse", "intercourses" },
                { "commonsense", "commonsenses" },
                { "intersperse", "intersperses" },
                { "merchandise", "merchandises" },
                { "phosphatase", "phosphatases" },
                { "summerhouse", "summerhouses" },
                { "watercourse", "watercourses" },
                { "catchphrase", "catchphrases" },
                { "compromise", "compromises" },
                { "greenhouse", "greenhouses" },
                { "lighthouse", "lighthouses" },
                { "paraphrase", "paraphrases" },
                { "mayonnaise", "mayonnaises" },
                { "racecourse", "racecourses" },
                { "apocalypse", "apocalypses" },
                { "courthouse", "courthouses" },
                { "powerhouse", "powerhouses" },
                { "storehouse", "storehouses" },
                { "glasshouse", "glasshouses" },
                { "hypotenuse", "hypotenuses" },
                { "peroxidase", "peroxidases" },
                { "pillowcase", "pillowcases" },
                { "roundhouse", "roundhouses" },
                { "streetwise", "streetwises" },
                { "expertise", "expertises" },
                { "discourse", "discourses" },
                { "warehouse", "warehouses" },
                { "staircase", "staircases" },
                { "workhouse", "workhouses" },
                { "briefcase", "briefcases" },
                { "clubhouse", "clubhouses" },
                { "clockwise", "clockwises" },
                { "concourse", "concourses" },
                { "playhouse", "playhouses" },
                { "turquoise", "turquoises" },
                { "boathouse", "boathouses" },
                { "cellulose", "celluloses" },
                { "epitomise", "epitomises" },
                { "gatehouse", "gatehouses" },
                { "grandiose", "grandioses" },
                { "menopause", "menopauses" },
                { "penthouse", "penthouses" },
                { "racehorse", "racehorses" },
                { "transpose", "transposes" },
                { "almshouse", "almshouses" },
                { "customise", "customises" },
                { "footloose", "footlooses" },
                { "galvanise", "galvanises" },
                { "princesse", "princesses" },
                { "universe", "universes" },
                { "workhorse", "workhorses" }
            };

            this._wordsEndingWithSeList = strs7;
            Dictionary <string, string> strs8 = new Dictionary <string, string>()
            {
                { "analysis", "analyses" },
                { "crisis", "crises" },
                { "basis", "bases" },
                { "atherosclerosis", "atheroscleroses" },
                { "electrophoresis", "electrophoreses" },
                { "psychoanalysis", "psychoanalyses" },
                { "photosynthesis", "photosyntheses" },
                { "amniocentesis", "amniocenteses" },
                { "metamorphosis", "metamorphoses" },
                { "toxoplasmosis", "toxoplasmoses" },
                { "endometriosis", "endometrioses" },
                { "tuberculosis", "tuberculoses" },
                { "pathogenesis", "pathogeneses" },
                { "osteoporosis", "osteoporoses" },
                { "parenthesis", "parentheses" },
                { "anastomosis", "anastomoses" },
                { "peristalsis", "peristalses" },
                { "hypothesis", "hypotheses" },
                { "antithesis", "antitheses" },
                { "apotheosis", "apotheoses" },
                { "thrombosis", "thromboses" },
                { "diagnosis", "diagnoses" },
                { "synthesis", "syntheses" },
                { "paralysis", "paralyses" },
                { "prognosis", "prognoses" },
                { "cirrhosis", "cirrhoses" },
                { "sclerosis", "scleroses" },
                { "psychosis", "psychoses" },
                { "apoptosis", "apoptoses" },
                { "symbiosis", "symbioses" }
            };

            this._wordsEndingWithSisList = strs8;
            base.Culture         = new CultureInfo("en");
            this._userDictionary = new BidirectionalDictionary <string, string>();
            this._irregularPluralsPluralizationService = new StringBidirectionalDictionary(this._irregularPluralsList);
            this._assimilatedClassicalInflectionPluralizationService = new StringBidirectionalDictionary(this._assimilatedClassicalInflectionList);
            this._oSuffixPluralizationService             = new StringBidirectionalDictionary(this._oSuffixList);
            this._classicalInflectionPluralizationService = new StringBidirectionalDictionary(this._classicalInflectionList);
            this._wordsEndingWithSePluralizationService   = new StringBidirectionalDictionary(this._wordsEndingWithSeList);
            this._wordsEndingWithSisPluralizationService  = new StringBidirectionalDictionary(this._wordsEndingWithSisList);
            this._irregularVerbPluralizationService       = new StringBidirectionalDictionary(this._irregularVerbList);
            this._knownSingluarWords = new List <string>(this._irregularPluralsList.Keys.Concat <string>(this._assimilatedClassicalInflectionList.Keys).Concat <string>(this._oSuffixList.Keys).Concat <string>(this._classicalInflectionList.Keys).Concat <string>(this._irregularVerbList.Keys).Concat <string>(this._uninflectiveWords).Except <string>(this._knownConflictingPluralList));
            this._knownPluralWords   = new List <string>(this._irregularPluralsList.Values.Concat <string>(this._assimilatedClassicalInflectionList.Values).Concat <string>(this._oSuffixList.Values).Concat <string>(this._classicalInflectionList.Values).Concat <string>(this._irregularVerbList.Values).Concat <string>(this._uninflectiveWords));
        }