Tag Class

class Tag(val id: Int, val level: Int, val text: String?, val rect: RectF?) : Comparable<ScanLayout.Tag>

Identifies one recognised text item, so a region of the layout can be matched to the text it produced in ScanText.

Parameters

  • id — the item identifier, matching the one ScanText uses.
  • level — how deeply the item nests: block, line, or word.
  • text — the recognised text of this item.
  • rect — where the item sits on the page.

Constructors

Tag

constructor(id: Int, level: Int, text: String?, rect: RectF?)

Properties

id

@JvmField val id: Int

level

val level: Int

rect

val rect: RectF?

text

val text: String?

Functions

compareTo

open operator override fun compareTo(other: ScanLayout.Tag): Int

Orders tags by their position in the document.

equals

open operator override fun equals(other: Any?): Boolean

Two tags are equal when they identify the same text item.

hashCode

open override fun hashCode(): Int

Consistent with equals.

toString

open override fun toString(): String

A readable form of the tag, for logging.

Top