Java Doc for Soundex.java in  » Library » Apache-common-codec » org » apache » commons » codec » language » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache common codec » org.apache.commons.codec.language 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.codec.language.Soundex

Soundex
public class Soundex implements StringEncoder(Code)
Encodes a string into a Soundex value. Soundex is an encoding used to relate similar names, but can also be used as a general purpose scheme to find word with similar phonemes.
author:
   Apache Software Foundation
version:
   $Id: Soundex.java,v 1.26 2004/07/07 23:15:24 ggregory Exp $


Field Summary
final public static  SoundexUS_ENGLISH
     An instance of Soundex using the US_ENGLISH_MAPPING mapping.
final public static  char[]US_ENGLISH_MAPPING
     This is a default mapping of the 26 letters used in US English.
final public static  StringUS_ENGLISH_MAPPING_STRING
     This is a default mapping of the 26 letters used in US English.

Constructor Summary
public  Soundex()
    
public  Soundex(char[] mapping)
     Creates a soundex instance using the given mapping.

Method Summary
public  intdifference(String s1, String s2)
     Encodes the Strings and returns the number of characters in the two encoded Strings that are the same.
public  Objectencode(Object pObject)
     Encodes an Object using the soundex algorithm.
public  Stringencode(String pString)
     Encodes a String using the soundex algorithm.
public  intgetMaxLength()
     Returns the maxLength.
public  voidsetMaxLength(int maxLength)
     Sets the maxLength.
public  Stringsoundex(String str)
     Retreives the Soundex code for a given String object.

Field Detail
US_ENGLISH
final public static Soundex US_ENGLISH(Code)
An instance of Soundex using the US_ENGLISH_MAPPING mapping.
See Also:   Soundex.US_ENGLISH_MAPPING



US_ENGLISH_MAPPING
final public static char[] US_ENGLISH_MAPPING(Code)
This is a default mapping of the 26 letters used in US English. A value of 0 for a letter position means do not encode.
See Also:   Soundex.Soundex(char[])



US_ENGLISH_MAPPING_STRING
final public static String US_ENGLISH_MAPPING_STRING(Code)
This is a default mapping of the 26 letters used in US English. A value of 0 for a letter position means do not encode.

(This constant is provided as both an implementation convenience and to allow Javadoc to pick up the value for the constant values page.)


See Also:   Soundex.US_ENGLISH_MAPPING




Constructor Detail
Soundex
public Soundex()(Code)
Creates an instance using US_ENGLISH_MAPPING
See Also:   Soundex.Soundex(char[])
See Also:   Soundex.US_ENGLISH_MAPPING



Soundex
public Soundex(char[] mapping)(Code)
Creates a soundex instance using the given mapping. This constructor can be used to provide an internationalized mapping for a non-Western character set. Every letter of the alphabet is "mapped" to a numerical value. This char array holds the values to which each letter is mapped. This implementation contains a default map for US_ENGLISH
Parameters:
  mapping - Mapping array to use when finding the corresponding code for a given character




Method Detail
difference
public int difference(String s1, String s2) throws EncoderException(Code)
Encodes the Strings and returns the number of characters in the two encoded Strings that are the same. This return value ranges from 0 through 4: 0 indicates little or no similarity, and 4 indicates strong similarity or identical values.
Parameters:
  s1 - A String that will be encoded and compared.
Parameters:
  s2 - A String that will be encoded and compared. The number of characters in the two encoded Strings that are the same from 0 to 4.
See Also:   SoundexUtils.difference(StringEncoderStringString)
See Also:    MS * T-SQL DIFFERENCE
throws:
  EncoderException - if an error occurs encoding one of the strings
since:
   1.3



encode
public Object encode(Object pObject) throws EncoderException(Code)
Encodes an Object using the soundex algorithm. This method is provided in order to satisfy the requirements of the Encoder interface, and will throw an EncoderException if the supplied object is not of type java.lang.String.
Parameters:
  pObject - Object to encode An object (or type java.lang.String) containing the soundex code which corresponds to the Stringsupplied.
throws:
  EncoderException - if the parameter supplied is not of type java.lang.String
throws:
  IllegalArgumentException - if a character is not mapped



encode
public String encode(String pString)(Code)
Encodes a String using the soundex algorithm.
Parameters:
  pString - A String object to encode A Soundex code corresponding to the String supplied
throws:
  IllegalArgumentException - if a character is not mapped



getMaxLength
public int getMaxLength()(Code)
Returns the maxLength. Standard Soundex int



setMaxLength
public void setMaxLength(int maxLength)(Code)
Sets the maxLength.
Parameters:
  maxLength - The maxLength to set



soundex
public String soundex(String str)(Code)
Retreives the Soundex code for a given String object.
Parameters:
  str - String to encode using the Soundex algorithm A soundex code for the String supplied
throws:
  IllegalArgumentException - if a character is not mapped



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.