JP2931934B2 - Numeric search device - Google Patents

Numeric search device

Info

Publication number
JP2931934B2
JP2931934B2 JP3253102A JP25310291A JP2931934B2 JP 2931934 B2 JP2931934 B2 JP 2931934B2 JP 3253102 A JP3253102 A JP 3253102A JP 25310291 A JP25310291 A JP 25310291A JP 2931934 B2 JP2931934 B2 JP 2931934B2
Authority
JP
Japan
Prior art keywords
numerical
data
text
condition
numerical data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP3253102A
Other languages
Japanese (ja)
Other versions
JPH0561918A (en
Inventor
貴久 白川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Home Electronics Ltd
Original Assignee
NEC Home Electronics Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Home Electronics Ltd filed Critical NEC Home Electronics Ltd
Priority to JP3253102A priority Critical patent/JP2931934B2/en
Publication of JPH0561918A publication Critical patent/JPH0561918A/en
Application granted granted Critical
Publication of JP2931934B2 publication Critical patent/JP2931934B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、バッファメモリ等に蓄
積されたテキストデータについて所定の数値条件を満た
す数値データを検索する数値検索装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a numerical value search device for searching numerical data satisfying a predetermined numerical condition from text data stored in a buffer memory or the like.

【0002】[0002]

【従来の技術】文書検索の1つのモードとして、所定の
数値条件を満たす数値を検索する場合がある。この種の
数値検索を行うための従来の方式としては、 予めテキスト(文書)全体をサーチして、数値を検
出したなら、その数値をバイナリコードに変換して、全
数値についてテキスト内の位置とバイナリコードを対応
させたテーブルを作成しておき、数値条件が与えられた
ならば、その数値条件を示す条件数値とテーブル上の各
数値(バイナリコード)とを逐次比較して、数値条件を
満たす数値か否かを決定する方式(第1の従来方式)、 数値条件を満たす可能な全ての数値についての状態
遷移パスを有するオートマンを用いる方式(第2の従来
方式)、 数値条件を桁毎の数値条件に分割して、分割した数
値条件毎に別個のオートマンを用いて並列に照合処理を
行う方式(第3の従来方式)、が知られている。
2. Description of the Related Art One mode of document search is to search for a numerical value satisfying a predetermined numerical condition. As a conventional method for performing this kind of numerical value search, the entire text (document) is searched in advance, and if a numerical value is detected, the numerical value is converted to a binary code, and the position in the text is calculated for all numerical values. Create a table corresponding to the binary code, and if given a numerical condition, sequentially compare the numerical value indicating the numerical condition with each numerical value (binary code) on the table to satisfy the numerical condition A method of determining whether a value is a numerical value (first conventional method), a method of using an automan having state transition paths for all possible numerical values that satisfy numerical conditions (second conventional method), (Third conventional method) is known in which a matching process is performed in parallel by using a separate Automan for each of the divided numerical conditions.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記の
各従来方式には、次のような欠点があった。第1の従来
方式においては、予めテキスト全体をサーチして、全数
値についてテキスト内の位置とバイナリコードを対応さ
せたテーブルを作成しなければならず、この処理で相当
な時間がかかり、オーバヘッドが発生した。
However, each of the above conventional methods has the following disadvantages. In the first conventional method, the entire text must be searched in advance, and a table in which the positions in the text correspond to the binary codes for all numerical values must be created. This process takes a considerable amount of time, and the overhead is large. Occurred.

【0004】第2の従来方式においては、オートマンの
状態遷移テーブルが大規模なものとなり、このテーブル
生成の処理でオーバヘッドが生じた。
[0004] In the second conventional method, the state transition table of the Automan becomes large, and an overhead is generated in the processing of generating the table.

【0005】第3の従来方式は、第2の従来方式に比べ
れば、状態遷移テーブルが小型化され、オートマンが圧
縮されるが、それでもまだ比較的大きな容量の検索用作
業バッファを必要とし、オーバヘッドのおそれもあっ
た。
In the third conventional method, the state transition table is reduced in size and the automan is compressed as compared with the second conventional method, but still requires a relatively large capacity search work buffer. There was also a risk of overhead.

【0006】本発明は、かかる問題点に鑑みてなされた
もので、検索用作業バッファの所要容量を少なくし、か
つ検索速度を向上させることができる数値検索装置を提
供することを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and has as its object to provide a numerical value search device capable of reducing the required capacity of a search work buffer and improving the search speed.

【0007】[0007]

【課題を解決するための手段】上記の目的を達成するた
めに、本発明の数値検索装置は、所定の数値条件を示す
条件数値データを保持する条件数値データ保持手段と、
前記条件数値データ保持手段より前記条件数値データを
構成する各数字データを最上位の桁から一桁分ずつ読み
出す条件数値データ読出手段と、テキストデータを構成
するテキストコードを所定の順序で一文字分ずつ探査す
るテキストコード探査手段と、前記テキストコード探査
手段によって探査されたテキストコードが数字コードか
否かを識別するテキストコード識別手段と、テキストコ
ード探査手段によって探査され、かつテキストコード識
別手段によって識別された数字コードと、条件数値デー
タ読出手段により条件数値データ保持手段から読み出さ
れた数字データとを比較する数字比較手段と、前記数字
比較手段の比較結果、前記条件数値データ読出手段の読
出結果、前記テキストコード探査手段の探査結果または
前記テキストコード識別手段の識別結果に応じて、前記
テキストデータに含まれる各数値データが前記所定の数
値条件を満たすか否かを判定する判定手段とを具備する
構成とした。
In order to achieve the above object, a numerical value retrieval apparatus according to the present invention comprises a condition numerical data holding means for holding condition numerical data indicating a predetermined numerical condition,
Condition numerical data reading means for reading each numerical data constituting the conditional numerical data from the uppermost digit by one digit from the condition numerical data holding means, and text codes constituting the text data for one character in a predetermined order Text code searching means to be searched, text code identifying means for identifying whether the text code searched by the text code searching means is a numeric code, and text code searching means for searching and being identified by the text code identifying means. Numerical comparison means for comparing the numeric code read with the numeric data read from the conditional numeric data holding means by the conditional numeric data reading means, a comparison result of the numeric comparison means, a read result of the conditional numeric data reading means, The search result of the text code search means or the text code search Depending on the identification result of the identifying means, the numerical data contained in the text data is configured to and a judgment means for judging whether the predetermined numerical condition is satisfied.

【0008】また、検索速度を一層向上させるために、
前記数字比較手段の比較結果に応じて、前記条件数値デ
ータ保持手段から読み出されるべき後続の数字データ
を、条件的に前記テキスト中で得られる可能な一桁分の
最大数値よりも大きな所定の数値に置き換える手段を具
備する構成とした。
In order to further improve the search speed,
According to the comparison result of the numerical comparing means, the subsequent numerical data to be read from the conditional numerical data holding means is a predetermined numerical value which is conditionally larger than the maximum possible single digit value obtained in the text. It is configured to have a means for replacing with.

【0009】同様に、検索速度を一層向上させるため
に、前記数字比較手段の比較結果に応じて、前記条件数
値データ読出手段により前記条件数値データ保持手段か
ら読み出されるべき後続の数字データを、条件的に、一
桁分スキップさせる手段を具備する構成とした。
Similarly, in order to further improve the retrieval speed, the following numerical data to be read from the condition numerical data holding means by the condition numerical data reading means is stored in a condition based on the comparison result of the numerical comparing means. In this case, a means for skipping one digit is provided.

【0010】[0010]

【作用】所与のテキストコード中に一桁または二桁以上
の数字コードからなる数値データが含まれていて、その
一連の数字コードの先頭(最上位桁)の数字コードがテ
キストコード探査手段によって探査され、次いでテキス
トコード識別手段によって識別されると、条件数値デー
タ読出手段は条件数値データ保持手段から条件数値デー
タの最上位桁の数字データを読み出す。そして、数字比
較手段は、最上位桁の数字コードTと最上位桁の数字デ
ータXとを比較し、両者の大小関係を判定する。次に、
上記と同様にして、テキストコードの数値データと条件
数値データの各2番目の次の桁について数字コードTと
数字データXとの比較が行われる。
In a given text code, numerical data consisting of one or more digit codes is included, and the first (most significant) digit code of the series of numeric codes is determined by the text code search means. After being searched and then identified by the text code identification means, the condition numerical data reading means reads the numerical data of the most significant digit of the condition numerical data from the condition numerical data holding means. The number comparing means compares the most significant digit code T with the most significant digit data X to determine the magnitude relationship between the two. next,
In the same manner as above, the numerical code T and the numerical data X are compared for the second next digit of each of the numerical data of the text code and the conditional numerical data.

【0011】このように各々の最上位桁の数字コード、
数字データの比較を始めに、テキストコードの数字コー
ドと条件数値データの数字データとが各桁ずつ比較され
る。このような比較において、テキストコードの数値デ
ータの桁数が条件数値データの桁数よりも小さいとき
は、条件数値データ読出手段より読出不可の読出結果が
出される前に、テキストコード探査手段より探査不可の
探査結果またはテキストコード識別手段より非数字コー
ド識別の識別結果が出される。また、反対に、テキスト
コードの数値データの桁数が条件数値データの桁数より
も大きいときは、条件数値データ読出手段より読出不可
の読出結果が早めに出される。
[0011] Thus, the numerical code of each most significant digit,
Beginning with the comparison of numeric data, the numeric code of the text code and the numeric data of the conditional numeric data are compared digit by digit. In such a comparison, when the number of digits of the numeric data of the text code is smaller than the number of digits of the conditional numeric data, the search is performed by the text code searching means before the condition numeric data reading means outputs an unreadable read result. An impossible search result or a non-numeric code identification result is issued by the text code identification means. On the other hand, when the number of digits of the numerical data of the text code is larger than the number of digits of the conditional numerical data, the condition numerical data reading means outputs an unreadable readout earlier.

【0012】したがって、判定手段は、上記のような数
字比較手段の比較結果、条件数値データ読出手段の読出
結果、テキストコード探査手段の探査結果またはテキス
トコード識別手段の識別結果に応じて、当該テキストデ
ータに含まれる各数値データが所定の数値条件を満たす
か否かを判定することができる。
[0012] Therefore, the judging means determines the text in accordance with the comparison result of the numeric comparing means, the reading result of the condition numerical data reading means, the search result of the text code searching means or the identification result of the text code identifying means. It can be determined whether each numerical data included in the data satisfies a predetermined numerical condition.

【0013】また、数字比較手段より、テキストコード
の数字コードTと条件数値データの数字データXとが一
致しないとの比較結果(T>XまたはT<X)が出され
た場合は、条件数値データ保持手段から読み出されるべ
き後続の数字データをテキスト中で得られる可能な一桁
分の最大数値(たとえば「9」)よりも大きな所定の数
値(たとえば4ビット・データにおいて値「A」)の例
外処理用の数字データに置き換えることにより、後続の
桁の比較処理を簡易・単時間に済まして、テキストコー
ドの数値データの桁数と条件数値データの桁数との比較
判定処理を迅速に行うことができる。
If the comparison result (T> X or T <X) that the numeric code T of the text code does not match the numeric data X of the conditional numeric data is output from the numeric comparing means, the conditional numeric value is output. Subsequent numeric data to be read from the data holding means has a predetermined numeric value (eg, "A" in 4-bit data) larger than the maximum possible single digit number (eg, "9") obtained in the text. By replacing with numeric data for exception handling, the subsequent digit comparison process can be simplified and in a short time, and the comparison and determination process of the number of digits of text code numeric data and the number of conditional numeric data can be performed quickly. be able to.

【0014】また、数字比較手段より、たとえば、テキ
ストコードの数字コードTのほうが条件数値データの数
字データXよりも大きいとの比較結果(T>X)が出さ
れた場合は、条件数値データ保持手段から読み出される
べき後続の数字データを一桁分スキップさせることで、
条件数値データの桁数をより早期に知ることができ、桁
数の比較判定処理を早期・迅速に行うことができる。
If the comparison result (T> X) that the numeric code T of the text code is larger than the numeric data X of the conditional numeric data is output from the numeric comparing means, the conditional numeric data is held. By skipping the subsequent numeric data to be read from the means by one digit,
The number of digits of the condition numerical data can be known earlier, and the comparison determination process of the number of digits can be performed quickly and promptly.

【0015】[0015]

【実施例】以下、添付図を参照して本発明の実施例を説
明する。図1は、本発明の一実施例による数値検索装置
の構成を示すブロック図である。この数値検索装置は、
たとえばワードプロセッサやパーソナルコンピュータに
おける1つの機能としてマイクロコンピュータ(CP
U、ROM、RAM、入出力装置、ソフトウェア)で実
現される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the accompanying drawings. FIG. 1 is a block diagram showing a configuration of a numerical value search device according to one embodiment of the present invention. This numerical search device
For example, as one function in a word processor or a personal computer, a microcomputer (CP
U, ROM, RAM, input / output device, software).

【0016】テキストコード探査部10は、バッファメ
モリ(図示せず)に蓄積されているテキストデータの中
から、テキストコードを所定の順序(普通はテキスト文
字の配列順序)で一文字分ずつ探査する。テキストコー
ド識別部12は、テキストコード探査部10によって探
査(抽出)されたテキストコードが数字コードであるの
か、それとも非数字コード(かな、漢字、記号等のコー
ド)であるのかを識別する。テキストコード識別部12
で識別された数字コードは、数字比較部14に与えられ
る。
The text code search unit 10 searches the text data stored in a buffer memory (not shown) one by one in a predetermined order (usually an arrangement order of text characters). The text code identification unit 12 identifies whether the text code searched (extracted) by the text code search unit 10 is a numeric code or a non-numeric code (a code such as a kana, a kanji, or a symbol). Text code identification unit 12
The numeric code identified by is given to the numeric comparing unit 14.

【0017】条件数値データ保持部16は、数値条件
(検索したい範囲)を示す条件数値データをセットされ
る。スタックとして動作する場合、条件数値データ保持
部16には条件数値データを構成する各数字データが最
下位の桁から一桁分ずつ書き込まれる。条件数値データ
読出部18は、条件数値データ保持部16から条件数値
データを構成する各数字データを最上位の桁から一桁分
ずつ読み出し、その読み出した数字データを数字比較部
14に与える。条件数値データ読出部18による条件数
値データ保持部16からの数字データの読出しは、所定
のタイミングで、つまりテキストコード識別手段12で
数字コードが識別されたことに応答して行われる。
The condition numerical data holding unit 16 is set with condition numerical data indicating a numerical condition (a range to be searched). In the case of operating as a stack, the numeric data constituting the conditional numeric data is written into the conditional numeric data holding unit 16 one digit from the least significant digit. The condition numerical data reading unit 18 reads each numerical data constituting the condition numerical data from the condition numerical data holding unit 16 by one digit from the most significant digit, and supplies the read numerical data to the number comparing unit 14. The reading of numeric data from the conditional numeric data holding unit 16 by the conditional numeric data reading unit 18 is performed at a predetermined timing, that is, in response to the text code identifying unit 12 identifying the numeric code.

【0018】数字比較部14は、テキストコード識別部
12から受け取ったテキストデータの数字コードTと条
件数値データ読出部18から受け取った条件数値データ
の数字データXとを比較し、両者T,Xの大小関係を判
定する。この数字比較部14からの比較判定結果は、テ
キストコード探査部10、条件数値スキップ部22、条
件数値置換部24および判定部20に与えられる。
The numeric comparing section 14 compares the numeric code T of the text data received from the text code identifying section 12 with the numeric data X of the conditional numeric data received from the conditional numeric data reading section 18, and compares both T and X. Determine the magnitude relationship. The comparison determination result from the numeric comparing unit 14 is given to the text code searching unit 10, the conditional numerical value skipping unit 22, the conditional numerical value replacing unit 24, and the determining unit 20.

【0019】条件数値スキップ部22は、テキストコー
ドの数字コードTが条件数値データの数字データXより
も大きいときに作動し、条件数値データ保持部16から
次に読み出されるべき数字データを1桁分スキップさせ
る。条件数値スキップ部22は、テキストデータの数字
コードTと条件数値データの数字データXとが同じ値で
ないときに作動し、条件数値データ保持部16より次に
読み出されるべき数字データを、テキスト中で得られる
可能な一桁分の最大数値(通常のテキストでは「9」)
よりも大きな所定の数値、たとえば4ビット・データに
おいて値「A」をもつ例外処理用の数字データ《A》に
置き換える。テキストコード探査部10は、数字比較部
14で比較判定が終了し、かつ上記のような条件数値ス
キップ部22または条件数値置換部24による条件的な
処理が行われた後に、次のテキストコードを探査する。
The conditional numerical value skip unit 22 operates when the numeric code T of the text code is larger than the numerical data X of the conditional numerical data, and stores one digit of numeric data to be read next from the conditional numerical data holding unit 16. Let me skip. The conditional numerical value skip unit 22 is activated when the numerical code T of the text data and the numerical data X of the conditional numerical data are not the same value, and stores the numerical data to be read next from the conditional numerical data holding unit 16 in the text. Maximum possible single digit value ("9" for normal text)
Is replaced with a numerical value << A >> for exceptional processing having a value "A" in a predetermined numerical value larger than, for example, 4-bit data. The text code search unit 10 converts the next text code after the comparison judgment is completed by the numeric comparing unit 14 and the conditional processing is performed by the conditional numerical value skip unit 22 or the conditional numerical value replacing unit 24 as described above. Explore.

【0020】判定部20は、数字比較部14の比較結
果、条件数値データ読出部18の読出結果、テキストデ
ータ探査部10の探査結果またはテキストコード識別部
12の識別結果に応じて、当該テキストデータに含まれ
る各数値データが所定の数値条件を満たすか否かを判定
する。
The judging section 20 determines the text data according to the comparison result of the numeric comparing section 14, the reading result of the conditional numerical data reading section 18, the search result of the text data searching section 10 or the identification result of the text code identifying section 12. It is determined whether or not each numerical data included in the satisfies a predetermined numerical condition.

【0021】次に、図2のフローチャートにつき、本実
施例の数値検索装置の動作を説明する。一例として、
「…林檎が57個、蜜柑が389個、梨が4261個
…」という文節を含むテキストに対して、数値条件『K
≦387』が与えられた場合の数値検索について説明す
る。
Next, the operation of the numerical value retrieval apparatus of this embodiment will be described with reference to the flowchart of FIG. As an example,
For a text containing the phrase "... 57 apples, 389 tangerines, 4261 pears ...", the numerical condition "K
<387 ”will be described.

【0022】図2において、数値検索が開始されると、
スタックメモリとしての条件数値データ保持部16に
は、条件数字「387」を構成する各数字「3」,
「8」,「7」が下位の桁から順に(「7」,「8」,
「3」の順に)書き込まれる(100)。
In FIG. 2, when a numerical search is started,
The condition numeric data holding unit 16 as a stack memory stores numbers “3”,
"8" and "7" are in order from the lower digit ("7", "8",
(In the order of "3") (100).

【0023】一方、テキストコード探査部10は当該テ
キストデータを格納したバッファメモリをアクセスして
テキストデータを1つずつ探査する。テキストコード識
別部12は、探査されたテキストデータが数字コードか
否かを識別する(102,104)。
On the other hand, the text code search unit 10 accesses the buffer memory storing the text data and searches the text data one by one. The text code identification unit 12 identifies whether the searched text data is a numeric code (102, 104).

【0024】この例の場合、「林檎が」に続く数字
「5」に対応したテキストデータ《5》は数字コードで
ある。この数字コード《5》がテキストコード識別部1
2によって識別されて数字比較部14に与えられると、
条件数値データ読出部18は、スタック先頭の文字デー
タ、つまり数値条件「387」の最上位の桁の数字デー
タ《3》を条件数値データ保持部16から読み出して、
この数字データ《3》を比較部に与える(106,10
8)。
In the case of this example, the text data << 5 >> corresponding to the number "5" following "ringa" is a numeric code. This numeric code << 5 >> is the text code identification unit 1.
2 and given to the number comparison unit 14,
The condition numerical data reading unit 18 reads the character data at the top of the stack, that is, the numerical data << 3 >> of the highest digit of the numerical condition “387” from the condition numerical data holding unit 16,
This numeric data << 3 >> is given to the comparison unit (106, 10
8).

【0025】数字比較部110は、テキストコード識別
部12からの数字コード《5》と条件数値データ読出部
18からの数字データ《3》とを比較し、前者《5》が
後者《3》よりも大きいとの比較結果を出す。条件数値
スキップ部22は、このような比較結果(T>X)が出
されると、スタック先頭にある数字データ《8》を捨て
て(スキップして)、次の桁の数字データ《7》をスタ
ック先頭の数字データに移す。この例の場合、スキップ
された数字データが存在したので(114)、条件数値
置換部24はスタック先頭になった数字データ《7》を
例外処理用の数字データ《A》に置き換える(11
6)。
The numeric comparing unit 110 compares the numeric code << 5 >> from the text code identifying unit 12 with the numeric data << 3 >> from the conditional numeric data reading unit 18, and the former << 5 >> is replaced by the latter << 3 >> Gives a comparison result that is also large. When such a comparison result (T> X) is output, the conditional numerical value skip unit 22 discards (skips) the numeric data << 8 >> at the top of the stack, and replaces the numeric data << 7 >> of the next digit. Move to the numeric data at the top of the stack. In the case of this example, since there is skipped numeric data (114), the condition numeric replacement unit 24 replaces the numeric data << 7 >> at the top of the stack with numeric data << A >> for exception processing (11).
6).

【0026】置換処理(116)が終了すると、テキス
トコード探査部10は次のテキストコードとして《7》
を探査する(118)。このテキストコード《7》はテ
キストコード識別部10において数字コードであると識
別される(120)。そうすると、条件数値データ読出
部18は、条件数値データ保持部16より先頭スタック
の数字データ《A》を読み出し、この数字データ《A》
を数字比較部14へ与える(106,108,11
0)。
When the replacement process (116) is completed, the text code search unit 10 sets << 7 >> as the next text code.
(118). This text code << 7 >> is identified by the text code identification unit 10 as a numeric code (120). Then, the condition numerical data reading unit 18 reads the numerical data << A >> of the top stack from the condition numerical data holding unit 16 and reads the numerical data << A >>
Is given to the number comparing section 14 (106, 108, 11).
0).

【0027】数字比較部14は、テキストデータの数字
コード《7》よりも数値条件の数字データ《A》のほう
が大きいとの比較結果(T<X)を出すことになる。そ
うすると置換処理116に移り、数値条件置換部24
は、スタック先頭の数字データを例外処理用の数字デー
タ《A》に置換しようとするが、しかしこのときは先頭
スタックの数字データがもはや存在しないので、実質的
に置換処理116は行われないことになる。
The numeric comparing section 14 outputs a comparison result (T <X) that the numeric data << A >> of the numerical condition is larger than the numeric code << 7 >> of the text data. Then, the process proceeds to the replacing process 116, where the numerical condition replacing unit 24
Attempts to replace the numeric data at the top of the stack with numeric data for exception processing << A >>, but at this time, since the numeric data at the top of the stack no longer exists, the replacement process 116 is not substantially performed. become.

【0028】次に、テキストコード探査部10はテキス
トコードとして《個》を探査するが(118)、このテ
キストコード《個》はテキストコード識別部10におい
て非数字コードであると識別される(120)。この識
別結果を受けて、判定部20は、当該数値「57」は数
値条件『N≦387』を満たす数字Nであるとの判定結
果Qを出す(122)。
Next, the text code searching unit 10 searches for "individual" as a text code (118). This text code "individual" is identified by the text code identifying unit 10 as a non-numeric code (120). ). Upon receiving this identification result, the determination unit 20 issues a determination result Q that the numerical value “57” is a number N that satisfies the numerical condition “N ≦ 387” (122).

【0029】次に、「、蜜柑が」の各非数字文字につい
ては、テキストコード探査部10およびテキストコード
識別部12においてテキストコード探査および識別処理
(102,104)が繰り返される。そして、「389
個」の先頭数字「3」に対応する数字コード《3》が探
査され、かつ識別されると、条件数値データ読出部18
は、スタック先頭の文字データ、つまり数値条件「38
7」の最上位の桁の数字データ《3》を条件数値データ
保持部16から読み出して、この数字データ《3》を比
較部に与える(106,108,110)。
Next, the text code search and identification processing (102, 104) is repeated in the text code search unit 10 and the text code identification unit 12 for each non-numeric character of ", tangerine". And "389
When the numeric code << 3 >> corresponding to the leading numeral "3" of the "number" is searched for and identified, the condition numerical data reading unit 18
Is the character data at the top of the stack, that is, the numerical condition "38
Numerical data << 3 >> of the highest digit of "7" is read from the condition numerical data holding unit 16, and this numerical data << 3 >> is given to the comparing unit (106, 108, 110).

【0030】数字比較部110は、テキストコード識別
部12からの数字コード《3》と条件数値データ読出部
18からの数字データ《3》とを比較し、両者が等しい
との比較結果を出す。このような比較結果(T=X)が
出されると、直ちに、テキストコード探査部10は次の
テキストコード《8》を探査する(118)。このテキ
ストコード《8》はテキストコード識別部10において
数字コードであると識別される(120)。そうする
と、条件数値データ読出部18は、条件数値データ保持
部16より先頭スタックの数字データ《8》を読み出
し、この数字データ《8》を数字比較部14へ与える
(106,108,110)。
Numeral comparing section 110 compares numeric code << 3 >> from text code identifying section 12 with numeric data << 3 >> from conditional numeric data reading section 18 and outputs a comparison result that both are equal. As soon as such a comparison result (T = X) is issued, the text code search unit 10 searches for the next text code << 8 >> (118). The text code << 8 >> is identified by the text code identification unit 10 as a numeric code (120). Then, the condition numerical data reading unit 18 reads the numerical data << 8 >> of the top stack from the condition numerical data holding unit 16 and supplies the numerical data << 8 >> to the numerical comparing unit 14 (106, 108, 110).

【0031】数字比較部14は、テキストデータの数字
コード《8》と数値条件の数字データ《8》の両者は等
しいとの比較結果(T=X)を出すことになる。この比
較結果(T=X)が出されると、再びテキストコード探
査部10は次のテキストコード《9》を探査し(11
8)、テキストコード識別部10はそのテキストコード
《9》を数字コードであると識別する(120)。そう
すると、条件数値データ読出部18は、先頭スタックの
数字データ《7》を読み出し、この数字データ《7》を
数字比較部14へ与える(106,108,110)。
The numeric comparing section 14 outputs a comparison result (T = X) that both the numeric code << 8 >> of the text data and the numeric data << 8 >> under the numerical condition are equal. When the comparison result (T = X) is issued, the text code search unit 10 searches again for the next text code << 9 >> (11).
8), the text code identification unit 10 identifies the text code << 9 >> as a numeric code (120). Then, the condition numerical data reading unit 18 reads the numerical data << 7 >> of the top stack, and supplies the numerical data << 7 >> to the numerical comparing unit 14 (106, 108, 110).

【0032】数字比較部110は、テキストコード識別
部12からの数字コード《9》が条件数値データ読出部
18からの数字データ《7》よりも大きいとの比較結果
を出す。この比較結果(T>X)が出されると、条件数
値スキップ部22は、スタック先頭にある数字データを
捨てようとする(112,114)。しかし、この場
合、条件数値データ保持部16のスタックには先頭の数
字データがなくなっているので、読出不可となる(11
4)。このスタック空状態は、条件数値データ読出部1
8より判定部20に通知される。そうすると、判定部2
0は、当該数値「57」は数値条件『N≦387』を満
たさない数字であるとの判定結果Pを出す(115、1
24)。
Numerical comparison section 110 gives a comparison result indicating that numeric code << 9 >> from text code identification section 12 is larger than numeric data << 7 >> from conditional numeric data reading section 18. When the comparison result (T> X) is issued, the condition value skip unit 22 attempts to discard the numeric data at the top of the stack (112, 114). However, in this case, since the leading numeric data is not present in the stack of the conditional numeric data holding unit 16, reading becomes impossible (11).
4). This stack empty state is stored in the condition numerical data reading unit 1
8, the determination unit 20 is notified. Then, the judgment unit 2
0 gives a determination result P that the numerical value “57” does not satisfy the numerical condition “N ≦ 387” (115, 1
24).

【0033】次に、「、梨が」の各非数字文字について
は、テキストコード探査部10およびテキストコード識
別部12においてテキストコード探査および識別処理
(102,104)が繰り返される。そして、「426
1個」の先頭数字「4」に対応する数字コード《4》が
探査され、かつ識別されると、条件数値データ読出部1
8は、スタック先頭の文字データ、つまり数値条件「3
87」の最上位の桁の数字データ《3》を条件数値デー
タ保持部16から読み出して、この数字データ《3》を
比較部に与える(106,108,110)。
Next, the text code search and identification processing (102, 104) is repeated in the text code search section 10 and the text code identification section 12 for each non-numeric character ", pear ga". Then, "426
When the numerical code << 4 >> corresponding to the leading digit "4" of "1" is searched and identified, the condition numerical data reading unit 1
8 is the character data at the top of the stack, that is, the numerical condition "3
Numerical data << 3 >> of the highest digit of "87" is read from the condition numerical data holding unit 16, and this numerical data << 3 >> is given to the comparing unit (106, 108, 110).

【0034】数字比較部110は、テキストコード識別
部12からの数字コード《4》と条件数値データ読出部
18からの数字データ《3》とを比較し、前者《4》が
後者《3》よりも大きいとの比較結果を出す。条件数値
スキップ部22は、このような比較結果(T>X)が出
されると、スタック先頭にある数字データ《8》を捨て
て(スキップして)、次の桁の数字データ《7》をスタ
ック先頭の数字データに移す。この例の場合、スキップ
された数字データが存在したので(114)、条件数値
置換部24はスタック先頭になった数字データ《7》を
例外処理用の数字データ《A》に置き換える(11
6)。
The numeric comparing section 110 compares the numeric code << 4 >> from the text code identifying section 12 with the numeric data << 3 >> from the conditional numeric data reading section 18, and the former << 4 >> is replaced by the latter << 3 >> Gives a comparison result that is also large. When such a comparison result (T> X) is output, the conditional numerical value skip unit 22 discards (skips) the numeric data << 8 >> at the top of the stack, and replaces the numeric data << 7 >> of the next digit. Move to the numeric data at the top of the stack. In the case of this example, since there is skipped numeric data (114), the condition numeric replacement unit 24 replaces the numeric data << 7 >> at the top of the stack with numeric data << A >> for exception processing (11).
6).

【0035】置換処理(116)が終了すると、テキス
トコード探査部10は次のテキストコードとして《2》
を探査する(118)。このテキストコード《2》はテ
キストコード識別部10において数字コードであると識
別される(120)。そうすると、条件数値データ読出
部18は、条件数値データ保持部16より先頭スタック
の数字データ《A》を読み出し、この数字データ《A》
を数字比較部14へ与える(106,108,11
0)。
When the replacement process (116) is completed, the text code search unit 10 sets << 2 >> as the next text code.
(118). This text code << 2 >> is identified by the text code identification unit 10 as a numeric code (120). Then, the condition numerical data reading unit 18 reads the numerical data << A >> of the top stack from the condition numerical data holding unit 16 and reads the numerical data << A >>
Is given to the number comparing section 14 (106, 108, 11).
0).

【0036】数字比較部14は、テキストデータの数字
コード《2》よりも数値条件の数字データ《A》のほう
が大きいとの比較結果(T<X)を出すことになる。そ
うすると置換処理116に移り、数値条件置換部24
は、スタック先頭の数字データを例外処理用の数字デー
タ《A》に置換しようとするが、しかしこのときは先頭
スタックの数字データがもはや存在しないので、実質的
に置換処理116は行われないことになる。
The numeric comparing section 14 outputs a comparison result (T <X) that the numeric data << A >> of the numerical condition is larger than the numeric code << 2 >> of the text data. Then, the process proceeds to the replacing process 116, where the numerical condition replacing unit 24
Attempts to replace the numeric data at the top of the stack with numeric data for exception processing << A >>, but at this time, since the numeric data at the top of the stack no longer exists, the replacement process 116 is not substantially performed. become.

【0037】次に、テキストコード探査部10はテキス
トコードとして《1》を探査し(118)、このテキス
トコード《1》はテキストコード識別部10において数
字コードであると識別される(120)。この識別結果
を受けて、条件数値データ読出部18は、条件数値デー
タ保持部16より先頭スタックの数字データを読み出そ
うとするが、すでに先頭スタックの数字データはなくな
っているので、読出不可となる。この読出結果を受け
て、判定部20は、当該数値「4261」は数値条件
『N≦387』を満たさない数字であるとの判定結果P
を出す(109、124)。
Next, the text code search unit 10 searches for << 1 >> as a text code (118), and the text code << 1 >> is identified by the text code identification unit 10 as a numeric code (120). In response to the identification result, the condition numerical data reading unit 18 attempts to read the numerical data of the top stack from the condition numerical data holding unit 16, but since the numerical data of the top stack is already gone, it is impossible to read. Become. In response to the read result, the determination unit 20 determines that the numerical value “4261” is a number that does not satisfy the numerical condition “N ≦ 387”.
(109, 124).

【0038】図3は、上述した実施例の作用に対応した
状態遷移図である。この状態遷移図において、は図2
中のステップ102,104の処理段階における状態、
〜は図2中のステップ106〜120の処理段階に
おける状態、は図2で結果Pが出された状態を示す。
また、細い実線のベクトルS1 は数字比較処理110よ
り両数字T,Xが等しいとの比較判定結果(T=X)が
出された場合の状態遷移を示し、一点鎖線のベクトルS
2 はテキストコードの数字コードTよりも条件数値デー
タの数字データXのほうが大きいとの比較判定結果(T
<X)が出された場合の状態遷移を示し、太い実線のベ
クトルS3 はテキストコードの数字コードTのほうが条
件数値データの数字データXよりも大きいとの比較判定
結果(T>X)が出された場合の状態遷移を示し、点線
のベクトルS4 はスタックから一桁分の数字データXが
読み出された場合の状態遷移を示す。なお、状態に達
する前の途中段階で、探査すべきテキストコードが中断
または終了した場合、または非数字コードが識別された
場合は、この状態遷移図から脱け出して、結果Qが出さ
れる(118,120,122)。
FIG. 3 is a state transition diagram corresponding to the operation of the above embodiment. In this state transition diagram, FIG.
State at the processing stage of steps 102 and 104 in
Indicates a state in the processing stage of steps 106 to 120 in FIG. 2, and indicates a state in which the result P is output in FIG.
Further, a thin solid line vector S1 indicates a state transition when a comparison determination result (T = X) that both numbers T and X are equal is output from the number comparison processing 110, and a one-dot chain line vector S1
2 is a comparison result (T) that the numeric data X of the conditional numeric data is larger than the numeric code T of the text code.
<X) indicates a state transition when a large solid line vector S3 indicates a comparison result (T> X) that the numeric code T of the text code is larger than the numeric data X of the conditional numeric data. A dotted line vector S4 indicates a state transition when one digit of numeric data X is read from the stack. If the text code to be searched is interrupted or terminated or a non-numeric code is identified in the middle stage before the state is reached, the state transition diagram is escaped and the result Q is output ( 118, 120, 122).

【0039】上述した例のテキスト「…林檎が57個、
蜜柑が389個、梨が4261個…」において、数値
「57」のときは→→と状態遷移してで抜け出
て結果Qが出され、数値「389」のときは→→
→→と状態遷移して結果Pが出され、数値「326
1」のときは→→→と状態遷移して結果Pが出
される。なお、条件数値の桁数が増えるにつれて、状態
遷移図は横方向に延びて遷移状態の数、状態遷移ベクト
ルの数も増える。
In the above example, the text "... 57 apples,
In the case of 389 tangerines and 4261 pears ... ", when the numerical value is" 57 ", the state transitions to →→, and the result Q is output, and when the numerical value is" 389 ", →→
The state is changed to →→, and the result P is output.
In the case of "1", the state transitions from → to →, and the result P is output. As the number of digits of the condition value increases, the state transition diagram extends in the horizontal direction, and the number of transition states and the number of state transition vectors also increase.

【0040】上述した例では、片側に限界をもつ数値条
件『N≦387』が与えられた場合について説明した
が、両側に限界をもつ数値条件、たとえば『145≦N
≦548』が与えられた場合には、『145≦N』の数
値条件を満たす数値データと、『N≦548』の数値条
件を満たす数値データとをそれぞれ検索し、両検索結果
の論理積をとることによって目的の数値条件『145≦
N≦548』を満たす数値を検索することができる。
In the above example, the case where the numerical condition “N ≦ 387” having a limit on one side is given, but the numerical condition having a limit on both sides, for example, “145 ≦ N”
If ≤548, numerical data satisfying the numerical condition of "145≤N" and numerical data satisfying the numerical condition of "N≤548" are respectively searched, and the logical product of both search results is obtained. By taking the target numerical condition “145 ≦
N ≦ 548 ”can be searched.

【0041】なお、上述した実施例では、条件数値スキ
ップ部22および条件数値置換部24を設け、数字比較
部14の比較判定結果に応じて、条件的に、条件数値デ
ータ保持部16のスタックの先頭数字データをスキップ
したり、スタックの先頭数字データを例外処理用の数字
データ《A》に置換することにより、数字比較処理の簡
易化・高速化および桁数比較処理の高速化を図ったが、
これらの条件数値スキップ部22および条件数値置換部
24を省略することも可能である。その場合は数字比較
部14において各比較判定結果を蓄積して、全桁の比較
判定結果を判定部20に与えるようにしてよい。
In the above-described embodiment, the condition numerical value skip unit 22 and the condition numerical value replacing unit 24 are provided. By skipping the leading numeric data and replacing the leading numeric data of the stack with numeric data for exception processing << A >>, the numerical comparison processing has been simplified and speeded up, and the digit number comparison processing has been speeded up. ,
The condition value skip unit 22 and condition value replacement unit 24 can be omitted. In this case, the comparison results may be accumulated in the numeric comparing unit 14 and the comparison results of all digits may be provided to the determining unit 20.

【0042】[0042]

【発明の効果】本発明は、上述したような構成を有する
ことにより、以下のような効果を奏する。請求項1の数
値検索装置によれば、各々の最上位桁の数字コード、数
字データの比較を始めに、テキストコードの数字コード
と条件数値データの数字データとを各桁ずつ比較し、そ
の比較結果、条件数値データ読出の結果、テキストコー
ド探査の結果またはテキストコード識別の結果に基づい
て、当該テキストデータに含まれる各数値データが所定
の数値条件を満たすか否かを判定するようにしたので、
数値データの可能な各値に対するオートマンを作成する
手間がなく、作業バッファメモリの容量を少なくし、高
速な数値検索を行うことができる。
According to the present invention having the above-described structure, the following effects can be obtained. According to the numerical value search device of the first aspect, the numerical code of the most significant digit and the numerical data of the numerical data are first compared, and the numerical code of the text code and the numerical data of the conditional numerical data are compared digit by digit. As a result, it is determined whether or not each numerical data included in the text data satisfies a predetermined numerical condition based on a result, a result of reading out conditional numerical data, a result of text code search or a result of text code identification. ,
There is no need to create an automan for each possible value of numerical data, the capacity of the work buffer memory is reduced, and a high-speed numerical search can be performed.

【0043】請求項2の数値検索装置によれば、テキス
トコードの数字コードと条件数値データの数字データと
の比較結果に応じて、条件数値保持手段から読み出され
るべき後続の数字データを、条件的にテキストコード中
で得られる可能な一桁分の最大数値よりも大きな所定の
数値に置き換えることで、後続の桁の比較処理を簡易・
単時間に済まして、テキストコードの数値データの桁数
と条件数値データの桁数との比較判定処理を迅速に行
い、ひいては数値検索処理を高速に行うことができる。
According to the numerical value retrieval device of the present invention, the subsequent numerical data to be read from the condition numerical value holding means is conditionally determined according to the comparison result between the numerical code of the text code and the numerical data of the conditional numerical value data. By replacing with a predetermined numerical value that is larger than the maximum possible single-digit value obtained in the text code,
In a short time, the number of digits of the numerical data of the text code and the number of digits of the condition numerical data can be compared and determined quickly, and the numerical value search process can be performed at high speed.

【0044】請求項3の数値検索装置によれば、テキス
トコードの数字コードと条件数値データの数字データと
の比較結果に応じて、条件数値データ保持手段から読み
出されるべき後続の数字データを、条件的に、一桁分ス
キップさせることで、条件数値データの桁数をより早期
に判別し、桁数の比較判定処理を早期・迅速に行い、ひ
いては数値検索処理を高速に行うことができる。
According to the numerical value retrieval device of the third aspect, the subsequent numerical data to be read from the conditional numerical data holding means is converted into the conditional numerical data according to the comparison result between the numerical code of the text code and the numerical data of the conditional numerical data. More specifically, by skipping one digit, the number of digits of the condition numerical data can be determined earlier, the comparison determination process of the number of digits can be performed quickly and quickly, and the numerical value search process can be performed at high speed.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施例による数値検索装置の構成を
示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a numerical value search device according to one embodiment of the present invention.

【図2】実施例による数値検索装置の動作を示すフロー
チャートである。
FIG. 2 is a flowchart showing an operation of the numerical value search device according to the embodiment.

【図3】図2のフローチャートに対応した実施例による
状態遷移図である。
FIG. 3 is a state transition diagram according to an embodiment corresponding to the flowchart of FIG. 2;

【符号の説明】[Explanation of symbols]

10 テキストコード探査部 12 テキストコード識別部 14 数字比較部 16 条件数値データ保持部 18 条件数値データ読出部 20 判定部 22 条件数値スキップ部 24 条件数値置換部 10 Text Code Search Unit 12 Text Code Identification Unit 14 Numeric Comparison Unit 16 Condition Numeric Data Storage Unit 18 Condition Numeric Data Read Unit 20 Judgment Unit 22 Condition Numeric Skip Unit 24 Condition Numeric Replacement Unit

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06F 17/30 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 6 , DB name) G06F 17/30

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 所与のテキストデータについて所定の数
値条件を満たす数値データを検索する数値検索装置にお
いて、 前記所定の数値条件を示す条件数値データを保持する条
件数値データ保持手段と、 前記条件数値データ保持手段より前記条件数値データを
構成する各数字データを最上位の桁から一桁分ずつ読み
出す条件数値データ読出手段と、 前記テキストデータを構成するテキストコードを所定の
順序で一文字分ずつ探査するテキストコード探査手段
と、 前記テキストコード探査手段によって探査されたテキス
トコードが数字コードか否かを識別するテキストコード
識別手段と、 前記テキストコード探査手段によって探査され、かつ前
記テキストコード識別手段によって識別された数字コー
ドと、前記条件数値データ読出手段により前記条件数値
データ保持手段から読み出された数字データとを比較す
る数字比較手段と、 前記数字比較手段の比較結果、前記条件数値データ読出
手段の読出結果、前記テキストコード探査手段の探査結
果または前記テキストコード識別手段の識別結果に応じ
て、前記テキストデータに含まれる各数値データが前記
所定の数値条件を満たすか否かを判定する判定手段と、
を具備したことを特徴とする数値検索装置。
1. A numerical value search device for searching numerical data satisfying a predetermined numerical condition for given text data, a condition numerical data holding means for storing condition numerical data indicating the predetermined numerical condition, Conditional numerical data reading means for reading each numerical data constituting the conditional numerical data from the most significant digit one by one from a data holding means, and searching for text codes constituting the text data one character at a time in a predetermined order. Text code search means, Text code identification means for identifying whether the text code searched by the text code search means is a numeric code, Searched by the text code search means, and identified by the text code identification means By the numerical code and the condition numerical data reading means. Numerical comparison means for comparing the numerical data read from the condition numerical data holding means, a comparison result of the numerical comparison means, a read result of the condition numerical data reading means, a search result of the text code searching means or the text Determining means for determining whether each numerical data included in the text data satisfies the predetermined numerical condition, according to an identification result of the code identifying means;
A numerical value search device comprising:
【請求項2】 前記数字比較手段の比較結果に応じて、
前記条件数値データ保持手段から読み出されるべき後続
の数字データを、条件的に、前記テキスト中で得られる
可能な一桁分の最大数値よりも大きな所定の数値をもつ
数字データに置き換える手段を具備したことを特徴とす
る請求項1に記載の数値検索装置。
2. According to a comparison result of said numeral comparing means,
Means for conditionally replacing subsequent numerical data to be read from the conditional numerical data holding means with numerical data having a predetermined numerical value larger than the maximum possible single digit value obtained in the text. The numerical value search device according to claim 1, wherein:
【請求項3】 前記数字比較手段の比較結果に応じて、
前記条件数値データ読出手段により前記条件数値データ
保持手段から読み出されるべき後続の数字データを、条
件的に、一桁分スキップさせる手段を具備したことを特
徴とする請求項1または2に記載の数値検索装置。
3. According to the comparison result of the numeral comparing means,
3. The numerical value according to claim 1, further comprising a unit that conditionally skips the next numerical data to be read from the conditional numerical data holding unit by one digit by the conditional numerical data reading unit. Search device.
JP3253102A 1991-09-04 1991-09-04 Numeric search device Expired - Lifetime JP2931934B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3253102A JP2931934B2 (en) 1991-09-04 1991-09-04 Numeric search device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3253102A JP2931934B2 (en) 1991-09-04 1991-09-04 Numeric search device

Publications (2)

Publication Number Publication Date
JPH0561918A JPH0561918A (en) 1993-03-12
JP2931934B2 true JP2931934B2 (en) 1999-08-09

Family

ID=17246522

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3253102A Expired - Lifetime JP2931934B2 (en) 1991-09-04 1991-09-04 Numeric search device

Country Status (1)

Country Link
JP (1) JP2931934B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4707198B2 (en) * 2006-10-19 2011-06-22 富士通株式会社 INFORMATION SEARCH PROGRAM, RECORDING MEDIUM CONTAINING THE PROGRAM, INFORMATION SEARCH METHOD, AND INFORMATION SEARCH DEVICE

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
志村隆則ほか,「文書検索向き数値検索方式の提案」,情報処理学会第42回(平成3年前期)全国大会講演論文集p3−314(平成3年3月12日)

Also Published As

Publication number Publication date
JPH0561918A (en) 1993-03-12

Similar Documents

Publication Publication Date Title
EP0380294B1 (en) String matching
US4959785A (en) Character processing system with spelling check function that utilizes condensed word storage and indexed retrieval
CA1085056A (en) Multipass sorter for arranging an input list into numerical order
US5440753A (en) Variable length string matcher
EP0884688A2 (en) Sparse index search method
GB1563620A (en) Multistage sorter with concurrent access to interstage buffer memories
JPH0225536B2 (en)
JPH0128412B2 (en)
US4679139A (en) Method and system for determination of data record order based on keyfield values
US5138669A (en) Range-conditional character string retrieving method and system
CN112434085B (en) Roaring Bitmap-based user data statistical method
JP2931934B2 (en) Numeric search device
US4327407A (en) Data driven processor
EP0649106B1 (en) Compactly stored word groups
JP3073208B2 (en) Data selection device
JP2540899B2 (en) Sorter memory management method
JPS63187334A (en) Character-string pattern matching device
JPH0752450B2 (en) Dictionary data retrieval device
JPH07319888A (en) Index retrieval system
JPH06139278A (en) Character string retrieving device quipped with character code converting function
JP3121401B2 (en) Recognition dictionary and character recognition device
CN113449073A (en) Keyword selection method and system
JP3720060B2 (en) Method and system for obtaining related words
JPS6266326A (en) Array processing system for japanese data
JPH04223566A (en) Numeric value retrieval apparatus