ClassesClassesClassesClasses | | | | Operators

sort_regionsort_regionSortRegionsort_regionSortRegionSortRegion (Operator)

Name

sort_regionsort_regionSortRegionsort_regionSortRegionSortRegion — Sorting of regions with respect to their relative position.

Signature

sort_region(Regions : SortedRegions : SortMode, Order, RowOrCol : )

Herror sort_region(const Hobject Regions, Hobject* SortedRegions, const char* SortMode, const char* Order, const char* RowOrCol)

Herror T_sort_region(const Hobject Regions, Hobject* SortedRegions, const Htuple SortMode, const Htuple Order, const Htuple RowOrCol)

Herror sort_region(Hobject Regions, Hobject* SortedRegions, const HTuple& SortMode, const HTuple& Order, const HTuple& RowOrCol)

HRegionArray HRegionArray::SortRegion(const HTuple& SortMode, const HTuple& Order, const HTuple& RowOrCol) const

void SortRegion(const HObject& Regions, HObject* SortedRegions, const HTuple& SortMode, const HTuple& Order, const HTuple& RowOrCol)

HRegion HRegion::SortRegion(const HString& SortMode, const HString& Order, const HString& RowOrCol) const

HRegion HRegion::SortRegion(const char* SortMode, const char* Order, const char* RowOrCol) const

void HOperatorSetX.SortRegion(
[in] IHUntypedObjectX* Regions, [out] IHUntypedObjectX*SortedRegions, [in] VARIANT SortMode, [in] VARIANT Order, [in] VARIANT RowOrCol)

IHRegionX* HRegionX.SortRegion(
[in] BSTR SortMode, [in] BSTR Order, [in] BSTR RowOrCol)

static void HOperatorSet.SortRegion(HObject regions, out HObject sortedRegions, HTuple sortMode, HTuple order, HTuple rowOrCol)

HRegion HRegion.SortRegion(string sortMode, string order, string rowOrCol)

Description

The operator sort_regionsort_regionSortRegionsort_regionSortRegionSortRegion sorts the regions with respect to their relative position. All sorting methods with the exception of 'character'"character""character""character""character""character" use one point of the region. With the help of the parameter RowOrColRowOrColRowOrColRowOrColRowOrColrowOrCol = 'row'"row""row""row""row""row" these points will be sorted according to their row and then according to their column. By using 'column'"column""column""column""column""column", the column value will be used first. The following values are available for the parameter SortModeSortModeSortModeSortModeSortModesortMode:

'character'"character""character""character""character""character"

The regions will be treated like characters in a row and will be sorted according to their order in the line: If two regions overlap horizontally, they will be sorted with respect to their column values, otherwise they will be sorted with regard to their row values. To be able to sort a line correctly, all regions in the line must overlap each other vertically. Furthermore, the regions in adjacent rows must not overlap.

'first_point'"first_point""first_point""first_point""first_point""first_point"

The point with the lowest column value in the first row of the region.

'last_point'"last_point""last_point""last_point""last_point""last_point"

The point with the highest column value in the last row of the region.

'upper_left'"upper_left""upper_left""upper_left""upper_left""upper_left"

Upper left corner of the surrounding rectangle.

'upper_right'"upper_right""upper_right""upper_right""upper_right""upper_right"

Upper right corner of the surrounding rectangle.

'lower_left'"lower_left""lower_left""lower_left""lower_left""lower_left"

Lower left corner of the surrounding rectangle.

'lower_right'"lower_right""lower_right""lower_right""lower_right""lower_right"

Lower right corner of the surrounding rectangle.

The parameter OrderOrderOrderOrderOrderorder determines whether the sorting order is increasing or decreasing: using 'true'"true""true""true""true""true" the order will be increasing, using 'false'"false""false""false""false""false" the order will be decreasing.

Parallelization

Parameters

RegionsRegionsRegionsRegionsRegionsregions (input_object)  region-array objectHRegionHRegionHRegionArrayHRegionXHobject

Regions to be sorted.

SortedRegionsSortedRegionsSortedRegionsSortedRegionsSortedRegionssortedRegions (output_object)  region-array objectHRegionHRegionHRegionArrayHRegionXHobject *

Sorted regions.

SortModeSortModeSortModeSortModeSortModesortMode (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Kind of sorting.

Default value: 'first_point' "first_point" "first_point" "first_point" "first_point" "first_point"

List of values: 'character'"character""character""character""character""character", 'first_point'"first_point""first_point""first_point""first_point""first_point", 'last_point'"last_point""last_point""last_point""last_point""last_point", 'lower_left'"lower_left""lower_left""lower_left""lower_left""lower_left", 'lower_right'"lower_right""lower_right""lower_right""lower_right""lower_right", 'upper_left'"upper_left""upper_left""upper_left""upper_left""upper_left", 'upper_right'"upper_right""upper_right""upper_right""upper_right""upper_right"

OrderOrderOrderOrderOrderorder (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Increasing or decreasing sorting order.

Default value: 'true' "true" "true" "true" "true" "true"

List of values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

RowOrColRowOrColRowOrColRowOrColRowOrColrowOrCol (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Sorting first with respect to row, then to column.

Default value: 'row' "row" "row" "row" "row" "row"

List of values: 'column'"column""column""column""column""column", 'row'"row""row""row""row""row"

Result

If the parameters are correct, the operator sort_regionsort_regionSortRegionsort_regionSortRegionSortRegion returns the value 2 (H_MSG_TRUE). Otherwise an exception will be raised.

Possible Successors

do_ocr_multido_ocr_multiDoOcrMultido_ocr_multiDoOcrMultiDoOcrMulti, do_ocr_singledo_ocr_singleDoOcrSingledo_ocr_singleDoOcrSingleDoOcrSingle

Module

Foundation


ClassesClassesClassesClasses | | | | Operators