|
Jazzy example source code file (Transformator.java)
The Jazzy Transformator.java source code
/*
Jazzy - a Java library for Spell Checking
Copyright (C) 2001 Mindaugas Idzelis
Full text of license can be found in LICENSE.txt
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package com.swabunga.spell.engine;
/**
* An interface for all Transformators - which take a dictionary word and converts into its
* phonetic hash. These phonetic hashs are useful for determining what other words are
* similiar to it, and then list those words as suggestsions.
*
* @author Robert Gustavsson (robert@lindesign.se)
*/
public interface Transformator {
/**
* Take the given word, and return the best phonetic hash for it.
*/
public String transform(String word);
/**
* gets the list of characters that should be swapped in to the misspelled word
* in order to try to find more suggestions.
* In general, this list represents all of the unique phonetic characters
* for this Tranformator.
* <p/>
* The replace list is used in the getSuggestions method.
* All of the letters in the misspelled word are replaced with the characters from
* this list to try and generate more suggestions, which implies l*n tries,
* if l is the size of the string, and n is the size of this list.
* <p/>
* In addition to that, each of these letters is added to the mispelled word.
* <p/>
* @return char[] misspelled words should try replacing with these characters to get more suggestions
*/
public char[] getReplaceList();
}
Other Jazzy examples (source code examples)Here is a short list of links related to this Jazzy Transformator.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.