Class OcrUtils


  • public class OcrUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BARCODE_PSEUDO_FONT  
    • Constructor Summary

      Constructors 
      Constructor Description
      OcrUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> createFontSelectionList​(java.lang.String selectedFont, boolean addEmpty)
      Compose a font list of the system.
      static java.lang.String getConsolidatedPartsAlphabet​(java.util.function.Function<Part,​java.lang.Boolean> partFilter, java.lang.String stockAlphabet)
      From all the optionally filtered parts in the system, create the alphabet for OCR operation.
      static Part identifyDetectedPart​(SimpleOcr.OcrModel detectedOcrModel, Feeder feeder)
      Identify an OCR detected part.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • BARCODE_PSEUDO_FONT

        public static final java.lang.String BARCODE_PSEUDO_FONT
        See Also:
        Constant Field Values
    • Constructor Detail

      • OcrUtils

        public OcrUtils()
    • Method Detail

      • createFontSelectionList

        public static java.util.List<java.lang.String> createFontSelectionList​(java.lang.String selectedFont,
                                                                               boolean addEmpty)
        Compose a font list of the system. Always add the one currently selected, even if the system does not know it (yet), and optionally the empty selection.
        Parameters:
        selectedFont -
        addEmpty -
        Returns:
      • getConsolidatedPartsAlphabet

        public static java.lang.String getConsolidatedPartsAlphabet​(java.util.function.Function<Part,​java.lang.Boolean> partFilter,
                                                                    java.lang.String stockAlphabet)
        From all the optionally filtered parts in the system, create the alphabet for OCR operation.
        Parameters:
        partFilter - optional part filtering Function.
        stockAlphabet - TODO
        Returns:
      • identifyDetectedPart

        public static Part identifyDetectedPart​(SimpleOcr.OcrModel detectedOcrModel,
                                                Feeder feeder)
                                         throws java.lang.Exception
        Identify an OCR detected part. This will automatically fuse line breaks, determine whether spaces are allowed and allow for partial matches in the typical form *-pattern (for redundant package prefixes etc.), but checking for ambiguity.
        Parameters:
        detectedOcrModel -
        feeder -
        Returns:
        Throws:
        java.lang.Exception