Module NewOCR

Class DatabaseCharacter

  • All Implemented Interfaces:
    java.lang.Comparable<Character>

    public class DatabaseCharacter
    extends Character
    Used for storage of data to go into our from the database.
    Since:
    April 25, 2019
    • Constructor Detail

      • DatabaseCharacter

        public DatabaseCharacter​(char letter)
        Creates a DatabaseCharacter from the given character with a modifier of 0.
        Parameters:
        letter - The letter of the object
      • DatabaseCharacter

        public DatabaseCharacter​(char letter,
                                 int modifier)
        Creates a DatabaseCharacter from the given character.
        Parameters:
        letter - The letter of the object
        modifier - The modifier of the character
    • Method Detail

      • getData

        public double[] getData()
        Gets the 16 sectioned percentages for the stored character.
        Returns:
        An array of percentages <= 1 with a length of 17
      • addDataPoint

        public void addDataPoint​(int index,
                                 double data)
        Sets a percentage value to the data.
        Parameters:
        index - The index of the data to set
        data - The percentage of filled in pixels found
      • setData

        public void setData​(double avgWidth,
                            double avgHeight,
                            double minCenter,
                            double maxCenter)
        Sets multiple used data points.
        Parameters:
        avgWidth - The average width across all used characters in the font sizes
        avgHeight - The average height across all used characters in the font sizes
        minCenter - The minimum relative center value in the training ste for this character and font size
        maxCenter - The maximum relative center value in the training ste for this character and font size
      • getAvgWidth

        public double getAvgWidth()
        Gets the average width of the character.
        Returns:
        The average width of the character
      • getAvgHeight

        public double getAvgHeight()
        Gets the average height of the character.
        Returns:
        The average height of the character
      • getMinCenter

        public double getMinCenter()
        Gets the minimum relative center value from the top of the character found in the training set for this font size.
        Returns:
        The minimum relative center value from the top of the character found in the training set for this font size
      • getMaxCenter

        public double getMaxCenter()
        Gets the maximum relative center value from the top of the character found in the training set for this font size.
        Returns:
        The maximum relative center value from the top of the character found in the training set for this font size
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Character