类 TableObjectUtils

java.lang.Object
com.walker.openocr.util.TableObjectUtils

public class TableObjectUtils extends Object
  • 构造器详细资料

    • TableObjectUtils

      public TableObjectUtils()
  • 方法详细资料

    • containTableKeyNot

      public static final boolean containTableKeyNot(List<TextBlock> dataList, List<String> tableKeysNot)
      给定文本集合中,是否包含应该排除的关键词。
           1) 例如:标题中不能包含:中油联合,如果包含了则返回true
       
      参数:
      dataList -
      tableKeysNot -
      返回:
    • formatText

      public static final String formatText(String text)
      格式化识别文本,把必要的中文符号转成英文。
      参数:
      text -
      返回:
    • isInSameRow

      public static final boolean isInSameRow(CellObject source, CellObject target, int cellTolerance)
      两个单元格是否在一行
      参数:
      source -
      target -
      cellTolerance - 位置像素容差值
      返回:
    • sortColumnCellList

      public static final void sortColumnCellList(List<CellObject> list)
    • findNextRowInfo

      public static List<CellObject> findNextRowInfo(CellObject current, List<CellObject> others, int lineHeight, int cellTolerance)
      找到当前单元格下一行单元格集合
      参数:
      current - 当前单元格(已经匹配配置项)
      others - 给定集合
      lineHeight - 定义的每行高度
      返回:
    • findNextRowCell

      public static final CellObject findNextRowCell(CellObject current, List<CellObject> others, int lineHeight, int cellTolerance)
      搜索下一行某个确定单元格(列),如:五羊-本田WH125T-9A两 / 轮摩托车
      参数:
      current - 该单元格不一定是匹配过的,也可能仅是一个存在值的单元格。
      others -
      lineHeight -
      cellTolerance -
      返回:
      精确返回一个单元格
    • parseSplitTitleAndValue

      public static final String parseSplitTitleAndValue(CellObject cellObject, boolean splitTitleValue)
    • parseFullRowTwoLineValue

      public static final String parseFullRowTwoLineValue(List<CellObject> rowData, CellObject current, List<CellObject> nextLineCells)
      解析整行单元格值数据,可能包含两行。不包含:多行数据(单独方法处理)
      参数:
      rowData - 标题行(有多列)
      current - 当前标题单元格
      nextLineCells - 下一行信息
      返回:
    • parseCellTwoLineValue

      public static final String parseCellTwoLineValue(CellObject currentValue, CellObject nextLineValue, boolean splitTitleValue)
      解析两行文本块对应的值。
      参数:
      currentValue - 给定当前值单元格
      nextLineValue - 找到的下一行同列单元格值
      返回: