面積運算
| Function | Description |
|---|---|
Area Max( Area a1, Area a2 ) | 回傳 a1 與 a2 中較大的值。 |
Area Min( Area a1, Area a2 ) | 回傳 a1 與 a2 中較小的值。 |
Area ObjectsArea( Rect, ImageObjectType ) | 回傳在指定矩形區域內,指定類型物件的面積。以全域座標運作。 |
Area ObjectsIntersectionArea( Rect, ImageObjectType ) | 回傳在指定矩形區域內,指定類型物件的面積。若物件的面積超出指定矩形區域,則回傳該物件面積與指定矩形區域的交集面積。以全域座標運作。 |
距離型別的運算
| 函式 | 說明 |
|---|---|
Distance Abs( Distance ) | 傳回距離的絕對值。 |
Distance AverageInterLineInterval() | 傳回頁面上文字行的平均高度。只有在文件中的頁面數最大值與最小值皆設定為 1 時才能使用此函式。對於多頁文件,請使用 Page 型別的對應方法:Page( N ).AverageLineHeight。 |
Distance AverageLineHeight() | 傳回頁面上文字行之間的平均距離。只有在文件中的頁面數最大值與最小值皆設定為 1 時才能使用此函式。對於多頁文件,請使用 Page 型別的對應方法:Page( N ).AverageInterLineInterval。 |
Distance Min( Distance d1, Distance d2 ) | 傳回 d1 與 d2 中較小的值。 |
Distance Max( Distance d1, Distance d2 ) | 傳回 d1 與 d2 中較大的值。 |
數值資料型別的運算
| Function | Description |
|---|---|
Int abs( Int ) | 傳回數值的絕對值。 |
Int Ceil( Real ) | 傳回不小於參數值的最小整數。 |
Int Floor( Real ) | 傳回不大於參數值的最大整數。 |
Int Max( Int n1, Int n2 ) | 傳回 n1、n2 中的最大值。 |
Int Min( Int n1, Int n2 ) | 傳回 n1、n2 中的最小值。 |
Int Round( Real ) | 傳回最接近參數值的整數。 |
Real Min( Real d1, Real d2 ) | 傳回 d1、d2 中的最小值。 |
Real Max( Real d1, Real d2 ) | 傳回 d1、d2 中的最大值。 |
矩形與區域的操作
| Function | Description |
|---|---|
Rect DocumentRect() | 傳回整個文件的矩形(以全域座標表示)。 |
Rect PageRect() | 傳回整個影像的矩形。只有在文件中的頁面最小與最大數量都設定為 1 時,才能使用此函式。 |
Region FormRegion( RectArray included, RectArray excluded ) | 建立一個區域,此區域包含 included 陣列中的矩形,並排除 excluded 陣列中的矩形。 |
字串運算
| Function | Description | |
|---|---|---|
String Chr( Int ) | 傳回使用指定 Unicode 字元代碼(代碼必須以十進位表示)所組成的字串。 | |
String LCase( String ) | 傳回由指定字串轉換而來、將其所有字元變為小寫後的字串。 | |
String RealToStrVariants( Real value, String fractionalPartSeparators, Int maxDigitsCountInFractionalPart = 2 ) | 建立指定實數 value 的多種字串表示形式,並以垂直線 ( | ) 分隔;每種表示會使用 fractionalPartSeparators 中不同的小數分隔符號,且小數部分的最大位數為指定的值。 |
String Str( ... ) | 資料型別的字串表示。適用於 Int、Logic、Real、XInterval、YInterval、DistInterval、FuzzyRect、Hypothesis、RectArray、Region、Area、Quality、Distance、PageInterval。 | |
String RemoveSpaces( String ) | 傳回由指定字串移除所有空白字元後所取得的字串。 | |
String UCase( String ) | 傳回由指定字串轉換而來、將其所有字元變為大寫後的字串。 |
存取 XML 檔案
| Function | Description |
|---|---|
StringArray ReadFromXML( String filename, String xPathQuery ) | 從 XML 檔案 “filename” 中讀取字串陣列。這些字串是透過執行傳入的 xPath 查詢 “xPathQuery” 取得。如需有關使用 XML 檔案的更多資訊,請參閱 User Dictionaries(使用者字典)。**注意:**為了讓程式碼更清晰,您可以為常用的 xPath 查詢定義具有可替換參數的常數,並在函式呼叫中使用這些常數。 |
String ReadSingleStringFromXML( String filename, String xPathQuery ) | 從 XML 檔案 “filename” 中讀取單一字串。此字串是透過執行傳入的 xPath 查詢 “xPathQuery” 取得。如需有關使用 XML 檔案的更多資訊,請參閱 User Dictionaries(使用者字典)。 |
型別轉換與檢查
| Function | Description |
|---|---|
Logic IsReal( String numberString, String separators = ".,", Logic isStrictMode = false ) | 檢查 inputString 字串是否可以安全地轉換為實數。允許使用的小數點分隔符號列表由 “separators” 參數設定。 |
Logic IsRealFuzzy( String, String separators = defaultDecimalSeparators, Logic isStrictMode = false ) | 檢查字串 inputString 在考慮字串中可能的辨識錯誤時,是否仍可安全地轉換為實數。 |
Logic IsInt( String inputString, Logic isStrictMode = false ) | 檢查 inputString 字串是否可以安全地轉換為整數。 |
Logic IsIntFuzzy( String inputString, Logic isStrictMode = false ) | 檢查字串 inputString 在考慮字串中可能的辨識錯誤時,是否仍可安全地轉換為整數。 |
Real StrToRealFuzzy( String, String separators = defaultDecimalSeparators, Logic isStrictMode = false ) | 傳回在考慮可能的辨識錯誤時,將字串 inputString 的值轉換為實數的結果。 |
Real StrToReal( String numberString, String separators = ".,", Logic isStrictMode = false ) | 傳回將 inputString 字串轉換為實數的結果。會忽略空白字元。 |
Int StrToInt( String inputString, Logic isStrictMode = false ) | 傳回將 inputString 字串值轉換為整數的結果。會忽略空白字元。 |
Int StrToIntFuzzy( String, Logic isStrictMode = false ) | 傳回在考慮可能的辨識錯誤時,將字串 inputString 的值轉換為整數的結果。 |
Int LogicToInt( Logic value ) | 如果值為 true 則傳回 “1”,如果值為 false 則傳回 “0”。 |
座標運算
| Function | Description |
|---|---|
XCoordinate Min( XCoordinate x1, XCoordinate x2 ) | 傳回 x1、x2 中的最小值。 |
XCoordinate Max( XCoordinate x1, XCoordinate x2 ) | 傳回 x1、x2 中的最大值。 |
XCoordinate MiddleBetween( XCoordinate x1, XCoordinate x2 ) | 傳回以 ( x1 + x2 ) / 2 計算的 X 座標。 |
XCoordinate Between( XCoordinate x1, XCoordinate x2, Real ratio ) | 傳回以 x1 + ( x2 – x1 ) * ratio 計算的 X 座標。 |
YCoordinate Min( YCoordinate y1, YCoordinate y2 ) | 傳回 y1、y2 中的最小值。 |
YCoordinate Max( YCoordinate y1, YCoordinate y2 ) | 傳回 y1、y2 中的最大值。 |
YCoordinate MiddleBetween( YCoordinate y1, YCoordinate y2 ) | 傳回以 ( y1 + y2 ) / 2 計算的 YInterval。 |
YCoordinate Between( YCoordinate y1, YCoordinate y2, Real ratio ) | 傳回以 y1 + ( y2 – y1 ) * ratio 計算的 YInterval。 |
XInterval MiddleBetween( Xinterval x1, XInterval x2 ) | 傳回以 ( x1 + x2 ) / 2 計算的 XInterval。 |
XInterval Between( Xinterval x2, Xinterval x2, Real ratio ) | 傳回以 x1 + ( x2 – x1 ) * ratio 計算的 XInterval。 |
YInterval MiddleBetween( Yinterval y1, Yinterval y2 ) | 傳回以 ( y1 + y2 ) / 2 計算的 YInterval。 |
YInterval Between( Yinterval y1, Yinterval y2, Real ratio ) | 傳回以 y1 + ( y2 – y1 ) * ratio 計算的 YInterval。 |
存取資料目錄
| Function | Description |
|---|---|
Logic TestAccessToCatalog( String catalogParameterName ) | 測試是否能存取由 catalogParameterName Parameter 所參照的資料目錄。 |
Logic TestCatalogSearchCriteria( String catalogParameterName, StringArray searchColumns, NamedValueArray searchCriteria ) | 檢查為資料目錄設定的搜尋條件是否有效。搜尋條件是使用 NamedValue 陣列來設定,其中每個 NamedValue 代表一個欄位名稱及其預期值。searchColumns 陣列指定在回應中要包含資料目錄紀錄中的哪些欄位。 |
StringArray FieldNamesOfCatalog( String catalogParameterName ) | 傳回由 catalogParameterName Parameter 所參照之資料目錄中所有欄位名稱的清單。欄位會依索引號以遞增順序排列。 |
StringArray FieldNamesOfCatalog( String catalogParameterName, StringArray searchColumnNames ) | 傳回出現在 searchColumnNames 陣列中的資料目錄欄位名稱清單(不區分大小寫)。欄位會依索引號以遞增順序排列。可使用此方法來判斷欄位索引。 |
Int RecordCountOfCatalog( String catalogParameterName, StringArray searchColumns, NamedValueArray searchCriteria = EmptyNamedValueArray ) | 傳回在資料目錄中符合指定搜尋條件的紀錄數量。 |
Void PrepareRecordsetOfCatalog( String catalogParameterName, StringArray searchColumns, NamedValueArray searchCriteria = EmptyNamedValueArray, Int maxRecordsCount = 1000 ) | 擷取符合搜尋條件的資料目錄紀錄。 |
StringArray RecordOfCatalog( String catalogParameterName, StringArray searchColumns, NamedValueArray searchCriteria = EmptyNamedValueArray, Int rowIndex ) | 傳回一筆符合搜尋條件的資料目錄紀錄。 |
Quality ValidateByCatalog( String word, String catalogParameterName, Int columnIndex, NamedValueArray searchCriteria = EmptyNamedValueArray, Int maxErrors, Rational maxErrorsPart, Logic ignoreSpaces = true, Int maxRecordsCount = 1000 ) | 透過比對資料目錄中索引為 columnIndex 的欄位值來檢查指定的 word 字串。傳回指定字串與資料目錄欄位中最佳相符值之間的比對品質。 |
Int GetCatalogColumnIndex( String catalogParameterName, String columnName ) | 傳回在由 catalogParameterName Parameter 所參照之資料目錄中,第一個具有指定名稱之欄位的索引。欄位名稱不區分大小寫。 |
IntArray GetCatalogColumnIndices( String catalogParameterName, String columnName ) | 傳回在由 catalogParameterName Parameter 所參照之資料目錄中,所有具有指定名稱之欄位的索引。欄位名稱不區分大小寫。 |
存取 Text 類型的技能 Parameter
| Function | Description |
|---|---|
Logic NamedParameterStringExists( String parameterName ) | 檢查 skill 中是否存在具有指定名稱的 Text 類型 Parameter。Parameter 名稱區分大小寫。 |
String GetNamedParameterString( String parameterName ) | 傳回具有指定名稱的 Text 類型 Parameter 的值。Parameter 名稱區分大小寫。 |
其他
| Function | Description |
|---|---|
InputFieldArray InputFields() | 傳回物件集合——在上一階段文件處理過程中於文件中找到的欄位。 |
Int PagesCount() | 傳回文件中的頁數。 |
Page Page( Int PageNumber ) | 傳回代表指定頁碼之頁面的 Page 物件。 |
Logic IsOnSameLine( Hypothesis, Hypothesis ) | 檢查兩個假設在垂直方向上是否相交。 |
