📄 doublemetaphonetest.java
字号:
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.codec.language;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.commons.codec.EncoderException;
import org.apache.commons.codec.StringEncoder;
import org.apache.commons.codec.StringEncoderAbstractTest;
/**
* Tests {@link DoubleMetaphone}.
*
* @see "http://www.cuj.com/documents/s=8038/cuj0006philips/"
* @author Apache Software Foundation
* @version $Id: DoubleMetaphoneTest.java,v 1.9 2004/04/13 23:15:40 ggregory Exp $
*/
public class DoubleMetaphoneTest extends StringEncoderAbstractTest {
/**
* Test data from http://aspell.sourceforge.net/test/batch0.tab.
*
* "Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org). Verbatim copying
* and distribution of this entire article is permitted in any medium,
* provided this notice is preserved."
*
* Massaged the test data in the array below.
*/
private static final String[][] FIXTURE = { { "Accosinly", "Occasionally" }, {
"Ciculer", "Circler" }, {
"Circue", "Circle" }, {
"Maddness", "Madness" }, {
"Occusionaly", "Occasionally" }, {
"Steffen", "Stephen" }, {
"Thw", "The" }, {
"Unformanlly", "Unfortunately" }, {
"Unfortally", "Unfortunately" }, {
"abilitey", "ability" }, {
"abouy", "about" }, {
"absorbtion", "absorption" }, {
"accidently", "accidentally" }, {
"accomodate", "accommodate" }, {
"acommadate", "accommodate" }, {
"acord", "accord" }, {
"adultry", "adultery" }, {
"aggresive", "aggressive" }, {
"alchohol", "alcohol" }, {
"alchoholic", "alcoholic" }, {
"allieve", "alive" }, {
"alot", "a lot" }, {
"alright", "all right" }, {
"amature", "amateur" }, {
"ambivilant", "ambivalent" }, {
"amification", "amplification" }, {
"amourfous", "amorphous" }, {
"annoint", "anoint" }, {
"annonsment", "announcement" }, {
"annoyting", "anting" }, {
"annuncio", "announce" }, {
"anonomy", "anatomy" }, {
"anotomy", "anatomy" }, {
"antidesestablishmentarianism", "antidisestablishmentarianism" }, {
"antidisestablishmentarism", "antidisestablishmentarianism" }, {
"anynomous", "anonymous" }, {
"appelet", "applet" }, {
"appreceiated", "appreciated" }, {
"appresteate", "appreciate" }, {
"aquantance", "acquaintance" }, {
"aratictature", "architecture" }, {
"archeype", "archetype" }, {
"aricticure", "architecture" }, {
"artic", "arctic" }, {
"asentote", "asymptote" }, {
"ast", "at" }, {
"asterick", "asterisk" }, {
"asymetric", "asymmetric" }, {
"atentively", "attentively" }, {
"autoamlly", "automatically" }, {
"bankrot", "bankrupt" }, {
"basicly", "basically" }, {
"batallion", "battalion" }, {
"bbrose", "browse" }, {
"beauro", "bureau" }, {
"beaurocracy", "bureaucracy" }, {
"beggining", "beginning" }, {
"beging", "beginning" }, {
"behaviour", "behavior" }, {
"beleive", "believe" }, {
"belive", "believe" }, {
"benidifs", "benefits" }, {
"bigginging", "beginning" }, {
"blait", "bleat" }, {
"bouyant", "buoyant" }, {
"boygot", "boycott" }, {
"brocolli", "broccoli" }, {
"buch", "bush" }, {
"buder", "butter" }, {
"budr", "butter" }, {
"budter", "butter" }, {
"buracracy", "bureaucracy" }, {
"burracracy", "bureaucracy" }, {
"buton", "button" }, {
"byby", "by by" }, {
"cauler", "caller" }, {
"ceasar", "caesar" }, {
"cemetary", "cemetery" }, {
"changeing", "changing" }, {
"cheet", "cheat" }, {
"cicle", "circle" }, {
"cimplicity", "simplicity" }, {
"circumstaces", "circumstances" }, {
"clob", "club" }, {
"coaln", "colon" }, {
"cocamena", "cockamamie" }, {
"colleaque", "colleague" }, {
"colloquilism", "colloquialism" }, {
"columne", "column" }, {
"comiler", "compiler" }, {
"comitmment", "commitment" }, {
"comitte", "committee" }, {
"comittmen", "commitment" }, {
"comittmend", "commitment" }, {
"commerciasl", "commercials" }, {
"commited", "committed" }, {
"commitee", "committee" }, {
"companys", "companies" }, {
"compicated", "complicated" }, {
"comupter", "computer" }, {
"concensus", "consensus" }, {
"confusionism", "confucianism" }, {
"congradulations", "congratulations" }, {
"conibation", "contribution" }, {
"consident", "consistent" }, {
"consident", "consonant" }, {
"contast", "constant" }, {
"contastant", "constant" }, {
"contunie", "continue" }, {
"cooly", "coolly" }, {
"copping", "coping" }, {
"cosmoplyton", "cosmopolitan" }, {
"courst", "court" }, {
"crasy", "crazy" }, {
"cravets", "caveats" }, {
"credetability", "credibility" }, {
"criqitue", "critique" }, {
"croke", "croak" }, {
"crucifiction", "crucifixion" }, {
"crusifed", "crucified" }, {
"ctitique", "critique" }, {
"cumba", "combo" }, {
"custamisation", "customization" }, {
"dag", "dog" }, {
"daly", "daily" }, {
"danguages", "dangerous" }, {
"deaft", "draft" }, {
"defence", "defense" }, {
"defenly", "defiantly" }, {
"definate", "definite" }, {
"definately", "definitely" }, {
"dependeble", "dependable" }, {
"descrption", "description" }, {
"descrptn", "description" }, {
"desparate", "desperate" }, {
"dessicate", "desiccate" }, {
"destint", "distant" }, {
"develepment", "developments" }, {
"developement", "development" }, {
"develpond", "development" }, {
"devulge", "divulge" }, {
"diagree", "disagree" }, {
"dieties", "deities" }, {
"dinasaur", "dinosaur" }, {
"dinasour", "dinosaur" }, {
"direcyly", "directly" }, {
"discuess", "discuss" }, {
"disect", "dissect" }, {
"disippate", "dissipate" }, {
"disition", "decision" }, {
"dispair", "despair" }, {
"disssicion", "discussion" }, {
"distarct", "distract" }, {
"distart", "distort" }, {
"distroy", "destroy" }, {
"documtations", "documentation" }, {
"doenload", "download" }, {
"dongle", "dangle" }, {
"doog", "dog" }, {
"dramaticly", "dramatically" }, {
"drunkeness", "drunkenness" }, {
"ductioneery", "dictionary" }, {
"dur", "due" }, {
"duren", "during" }, {
"dymatic", "dynamic" }, {
"dynaic", "dynamic" }, {
"ecstacy", "ecstasy" }, {
"efficat", "efficient" }, {
"efficity", "efficacy" }, {
"effots", "efforts" }, {
"egsistence", "existence" }, {
"eitiology", "etiology" }, {
"elagent", "elegant" }, {
"elligit", "elegant" }, {
"embarass", "embarrass" }, {
"embarassment", "embarrassment" }, {
"embaress", "embarrass" }, {
"encapsualtion", "encapsulation" }, {
"encyclapidia", "encyclopedia" }, {
"encyclopia", "encyclopedia" }, {
"engins", "engine" }, {
"enhence", "enhance" }, {
"enligtment", "Enlightenment" }, {
"ennuui", "ennui" }, {
"enought", "enough" }, {
"enventions", "inventions" }, {
"envireminakl", "environmental" }, {
"enviroment", "environment" }, {
"epitomy", "epitome" }, {
"equire", "acquire" }, {
"errara", "error" }, {
"erro", "error" }, {
"evaualtion", "evaluation" }, {
"evething", "everything" }, {
"evtually", "eventually" }, {
"excede", "exceed" }, {
"excercise", "exercise" }, {
"excpt", "except" }, {
"excution", "execution" }, {
"exhileration", "exhilaration" }, {
"existance", "existence" }, {
"expleyly", "explicitly" }, {
"explity", "explicitly" }, {
"expresso", "espresso" }, {
"exspidient", "expedient" }, {
"extions", "extensions" }, {
"factontion", "factorization" }, {
"failer", "failure" }, {
"famdasy", "fantasy" }, {
"faver", "favor" }, {
"faxe", "fax" }, {
"febuary", "february" }, {
"firey", "fiery" }, {
"fistival", "festival" }, {
"flatterring", "flattering" }, {
"fluk", "flux" }, {
"flukse", "flux" }, {
"fone", "phone" }, {
"forsee", "foresee" }, {
"frustartaion", "frustrating" }, {
"fuction", "function" }, {
"funetik", "phonetic" }, {
"futs", "guts" }, {
"gamne", "came" }, {
"gaurd", "guard" }, {
"generly", "generally" }, {
"ghandi", "gandhi" }, {
"goberment", "government" }, {
"gobernement", "government" }, {
"gobernment", "government" }, {
"gotton", "gotten" }, {
"gracefull", "graceful" }, {
"gradualy", "gradually" }, {
"grammer", "grammar" }, {
"hallo", "hello" }, {
"hapily", "happily" }, {
"harrass", "harass" }, {
"havne", "have" }, {
"heellp", "help" }, {
"heighth", "height" }, {
"hellp", "help" }, {
"helo", "hello" }, {
"herlo", "hello" }, {
"hifin", "hyphen" }, {
"hifine", "hyphen" }, {
"higer", "higher" }, {
"hiphine", "hyphen" }, {
"hippie", "hippy" }, {
"hippopotamous", "hippopotamus" }, {
"hlp", "help" }, {
"hourse", "horse" }, {
"houssing", "housing" }, {
"howaver", "however" }, {
"howver", "however" }, {
"humaniti", "humanity" }, {
"hyfin", "hyphen" }, {
"hypotathes", "hypothesis" }, {
"hypotathese", "hypothesis" }, {
"hystrical", "hysterical" }, {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -