English (English)

Nearest functions

Nearest functions tell the program that, other things being equal, it must select the hypothesis that is nearest to a certain element or point on the image that is specified by the parameters of the Nearest function. In the Advanced pre-search relations section of the element, you can use only one Nearest function. After the function is applied, only one hypotheses from a group of several hypotheses is selected. The selection occurs when hypotheses are being generated for the element, i.e. before the code entered in the Advanced post-search relations section is executed. For details, see Using Nearest and FuzzyQuality to search for elements.

Nearest functions can be used to select hypotheses for any kind of elements except Groups, Repeating Groups, and Tables.

Parameter Description
Void NearestX( XCoordinate x )

Selects the hypothesis nearest to the vertical line which goes through the point ( x, 0 ).

E.g.

Void NearestY( YCoordinate y )

Selects the hypothesis nearest to the horizontal line which goes through the point ( 0, y ).

E.g.

Void Nearest( XInterval x, YInterval y )

Selects the hypothesis nearest to the rectangle Rect( x.Start, y.Start, x.End, y.End ).

E.g.

Void Nearest( PageEdge )

Selects the hypothesis on each page of the document that is nearest to one of the page edges - top, bottom, right or left.

Note.If several hypotheses are at the same distance from the specified boundary, several hypotheses may be selected.

E.g.

Void Nearest( Hypothesis hyp )

Selects the hypothesis nearest to the fuzzy rectangle hyp.Rect

E.g.

Void Nearest( HypothesisInstances ) Selects the hypothesis closest to the set of hypothesis for the specified Repeating Group element.

25.05.2023 7:55:03

Please leave your feedback about this article

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.