This bundle does not look at the repository. It finds numbers in a given text and returns them along with the words written next to each number. If Zio.text answers “Is this character the same as that one?” then this side answers “What numbers are written in this text?”
A 10% might be a value sought in one industry and discarded in another. In construction management, an operating profit of about 10 % is not progress, but in accounting it is that exact figure.
Therefore this function does not choose. It returns the number together with a label, and the caller decides what it means. If the engine chooses, it will match one industry but be wrong for all others.
Method
Description
Zio.utils.numbers(text, near=None, kinds=None)
Finds all numbers in the text and returns them as a list. If there are multiple lines, it looks line by line—because labels do not cross lines.
Zio.utils.number(text, near=None, kinds=None)
Returns the first of those. If none, returns None.
8/7 is read as three possibilities — August 7, the 8th of 7 items, or 8 out of 7. Choosing one will silently fail for the other two, and from then on this function becomes unreliable.
The parser returns all interpretations; the caller decides based on context. Amounts are similar — 2억 3천 is 200,003,000 but if the word pattern omits 만, it means 230,000,000. It provides both value and maybe.
Returning only numbers makes them applicable everywhere. The words written next to them allow the caller to infer meaning. Therefore, the rule for extracting labels is the most carefully crafted part of this bundle.
Original
Label
Rule
진척률 : 약 90%
진척률
: marks the left side as the label. It is opposite to other delimiters.
( 매출 194,132,600원 / 영업 이익 약 10% )
매출, 영업 이익
Parentheses and slashes separate fields. The comma in 194,132,600 does not split.
장비 발주(8/7)
장비 발주
If the parentheses contain only a number, look one token further left.
영업 이익 약 9%
영업 이익, about
Words like 약, 총, 최대 are removed from the label; their meaning remains.
numbers()first finds everything. If some cannot be found, the caller has no way to handle them, but if many are found it can be narrowed by near and kinds. The words put into near are always supplied by the caller — putting a word like 진척률 inside the SDK makes it no longer a generic tool.