net.sourceforge.javaocr.matcher
Class FreeSpacesMatcher

java.lang.Object
  extended by net.sourceforge.javaocr.matcher.FreeSpacesMatcher
All Implemented Interfaces:
Matcher

public class FreeSpacesMatcher
extends Object
implements Matcher

classify by amount of free spaces. accepts only one feature

Author:
Konstantin Pribluda

Field Summary
private  Map<Integer,Set<Character>> counts
           
 
Constructor Summary
FreeSpacesMatcher()
           
 
Method Summary
 List<Match> classify(double[] features)
          create list of matches (sorted)
 List<FreeSpacesContainer> getContainers()
          extract list of configuration beans for serialisation
 Map<Integer,Set<Character>> getCounts()
           
 void setContainers(List<FreeSpacesContainer> containers)
          configure matcher with external configuration data - just train it
 void train(char c, int i)
          train certain character occurence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

counts

private Map<Integer,Set<Character>> counts
Constructor Detail

FreeSpacesMatcher

public FreeSpacesMatcher()
Method Detail

classify

public List<Match> classify(double[] features)
create list of matches (sorted)

Specified by:
classify in interface Matcher
Parameters:
features - features to be matched. we accept only 1 value (must be integer, will be cast there)
Returns:
list of matches without ordering

train

public void train(char c,
                  int i)
train certain character occurence

Parameters:
c - character
i - amount of free spaces

getCounts

public Map<Integer,Set<Character>> getCounts()

getContainers

public List<FreeSpacesContainer> getContainers()
extract list of configuration beans for serialisation

Returns:

setContainers

public void setContainers(List<FreeSpacesContainer> containers)
configure matcher with external configuration data - just train it

Parameters:
containers -


Copyright © -2012. All Rights Reserved.