JPS63284676A - Character string processor - Google Patents

Character string processor

Info

Publication number
JPS63284676A
JPS63284676A JP62118105A JP11810587A JPS63284676A JP S63284676 A JPS63284676 A JP S63284676A JP 62118105 A JP62118105 A JP 62118105A JP 11810587 A JP11810587 A JP 11810587A JP S63284676 A JPS63284676 A JP S63284676A
Authority
JP
Japan
Prior art keywords
character
numeric
character string
numeral
characters
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.)
Pending
Application number
JP62118105A
Other languages
Japanese (ja)
Inventor
Masako Bosu
雅子 望主
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP62118105A priority Critical patent/JPS63284676A/en
Publication of JPS63284676A publication Critical patent/JPS63284676A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To effectively process numerals by recognizing the whole of a character string as a numeral in case said character string consists of numeric characters and auxiliary numeric characters such as prefixes or suffixes. CONSTITUTION:A numeric character table 20 stores Arabic numerals, Chinese numeric characters, numeric characters showing digits, the equivalent characters of the Chinese numeric characters, and flags showing the sections of these numeric characters. An auxiliary numeric prefix table 22 stores the auxiliary numeric prefixes like 'OYOSO', 'ZU', 'DAI', etc., and an auxiliary numeric suffix table 24 stores the auxiliary numeric suffixes like 'KAI', 'KO', etc. When the characters corresponding to these prefixes and suffixes are inputted, the auxiliary numeric prefixes and suffixes are regarded as a group and undergo the analysis of numerals through a numeral processing part 14. While such words as 'ICHININ MAE', 'GORI MUCHU', etc., are stored in an inhibition table 26 and undergo no analysis of numerals through the part 14.

Description

【発明の詳細な説明】 技術分野 本発明は文字列処理装置、特に数詞を含む文字列を処理
する装置に関する。
TECHNICAL FIELD The present invention relates to a character string processing device, and more particularly to a device for processing character strings including numerals.

従来技術 日本語の文字列を翻訳等のために解析する場合には、形
態素解析や構文解析の前処理として、数詞を解析する処
理が必要となる。
BACKGROUND ART When analyzing Japanese character strings for purposes such as translation, it is necessary to analyze numerals as preprocessing for morphological analysis and syntactic analysis.

従来の装置においては、l、2、三等の数字は解析でき
たが、数字を含む文字列、例えば「表1」に対しては、
rlJのみを数詞として認識し、1表1」全体を数詞と
して認識することができなかった。同様に「二億円」の
「億」や「数十人」の「数」を数詞として認識すること
ができないため、「二」と「億円」、「数」と「十人」
に分離して認識し、「二億円」、「数十人」全体を数詞
として認識することができなかった。
Conventional devices were able to analyze numbers such as l, 2, and 3, but they were unable to analyze character strings containing numbers, such as "Table 1."
Only ``rlJ'' was recognized as a number word, and the entire ``1 Table 1'' could not be recognized as a number word. Similarly, the ``billion'' in ``200 million yen'' and the ``number'' in ``several tens'' cannot be recognized as number words, so ``two'' and ``billion yen'' and ``number'' and ``junin'' are used as numbers.
He was unable to recognize the words ``200 million yen'' and ``several tens of people'' as whole numbers.

また、「円」を数詞の桁を表す語とともに辞書に登録し
ておくため、大きな辞書の容量を必要とした。
Furthermore, since ``yen'' was registered in the dictionary along with words representing the digits of number words, a large dictionary capacity was required.

さらに算用数字と漢数字の両方を含む表現の場合にはま
とめて数詞と認識できないため、適切な解析を行うこと
ができなかった。
Furthermore, expressions containing both arithmetic numerals and Chinese numerals could not be recognized as numerals at the same time, making it impossible to perform appropriate analysis.

目   的 本発明はこのような従来技術の欠点を解消し、日本語の
文字列において、数詞を効率良く検出することのできる
文字列処理装置を提供することを目的とする。
OBJECTS It is an object of the present invention to provide a character string processing device that can eliminate the drawbacks of the prior art and can efficiently detect numerals in Japanese character strings.

構  成 本発明は上記の目的を達成させるため、文字列を入力す
る入力手段と、数字および漢数字相当字を格納する数字
記憶手段と、数字とともに用いられることにより数詞を
構成する曲数文字を格納する曲数文字記憶手段と、入力
手段から入力された文字列について、数字記憶手段およ
び曲数文字記憶手段を検索し、文字列が数詞であるか否
かを判断する数詞処理手段とを有し、数詞処理手段は、
文字列が数字および曲数文字からなる場合にもこれを全
体として数詞と認識することを特徴としたものである。
Configuration In order to achieve the above object, the present invention includes an input means for inputting a character string, a number storage means for storing numbers and characters equivalent to Chinese numerals, and a number storage means for storing number characters that constitute a number word when used together with the numbers. and a number word processing means that searches the number storage means and the song number character storage means for a character string input from the input means and determines whether or not the character string is a number word. , the number word processing means is
Even if the character string consists of numbers and number letters, the character string is recognized as a number word as a whole.

以下、本発明の一実施例に基づいて具体的に説明する。Hereinafter, a detailed explanation will be given based on one embodiment of the present invention.

第1図には本発明による文字列処理装置の一実施例が示
されている。
FIG. 1 shows an embodiment of a character string processing device according to the present invention.

本装置は入力部10を有し、日本語の漢字かな混じり文
字列が入力される。入力部lOは例えば、文字キーや機
能キー等を有するキーボード、紙に記録された日本語の
文字列を読み取る光学的文字読み取り装置(OCR)お
よび磁気ディスク等の記憶媒体に記憶された日本語文を
読み込むファイル記憶装置等を含んでよい。
This device has an input unit 10, into which a Japanese character string containing kanji and kana is input. For example, the input unit 1O may be a keyboard having character keys, function keys, etc., an optical character reader (OCR) that reads Japanese character strings recorded on paper, and Japanese text stored on a storage medium such as a magnetic disk. It may include a file storage device for reading, etc.

入力文字列ファイル12には入力部10から入力された
日本語の文字列が一時格納される。数詞処理部14は入
力文字列ファイル12から読み出された日本語の漢字か
な混じり文字列に含まれる数詞を、数字テーブル20、
曲数接頭辞テーブル22、曲数接尾辞テーブル24、禁
止テーブル26を参照することにより数詞処理し、数詞
の情報を付与して出力部IBへ出力する。
The input character string file 12 temporarily stores Japanese character strings input from the input unit 10. The numeral processing unit 14 converts the numerals included in the Japanese kanji/kana mixed character string read from the input character string file 12 into a number table 20,
Number words are processed by referring to the song number prefix table 22, the song number suffix table 24, and the prohibition table 26, and information on the number words is added and output to the output unit IB.

数字テーブル20に格納されるデータの例が第2図に示
されている。同図に示されるように、数字テーブル20
には、算用数字、漢数字、桁を表す漢数字、漢数字相当
字が格納され、それぞれに0〜3のフラグが立っている
。漢数字相当字とは、第2図に示されるように、何、数
、幾等のように数字の代わりに使用される文字である。
An example of data stored in the number table 20 is shown in FIG. As shown in the figure, the number table 20
Arithmetic numerals, Kanji numerals, Kanji numerals representing digits, and characters equivalent to Kanji numerals are stored in , and a flag of 0 to 3 is set for each. Kanji numeral equivalent characters are characters used in place of numbers, such as ``what'', ``number'', ``number'', etc., as shown in Figure 2.

曲数接頭辞テーブル22の例が第3図に示されている。An example of the song number prefix table 22 is shown in FIG.

同図に示されるように、曲数接頭辞テーブル22には数
字を含む数詞の先頭に用いられる文字が格納されている
As shown in the figure, the song number prefix table 22 stores characters used at the beginning of numerals including numbers.

曲数接尾辞テーブル24の例が第4図に示されている。An example of the song number suffix table 24 is shown in FIG.

同図に示されるように、曲数接尾辞テーブル24には数
詞の末尾に用いられる文字が格納されている。
As shown in the figure, the song number suffix table 24 stores characters used at the end of number words.

禁止テーブル26の例が第5図に示されている。An example of the prohibition table 26 is shown in FIG.

同図に示されるように、数字を含んだ文字列で独特の意
味を有する熟語または慣用表現となっているため、数詞
処理の対象としない方が良いものが登録yれている。禁
止テーブル28は後述する禁止処理の時にアクセスされ
る。
As shown in the figure, there are some strings of characters that are registered that are idioms or idiomatic expressions that have unique meanings and should not be subjected to number processing. The prohibition table 28 is accessed during prohibition processing, which will be described later.

数詞処理部14における数詞処理は、数詞部分を次の4
つのパターンに分類して行われる。
The number word processing in the number word processing unit 14 converts the number word part into the following four
It is classified into two patterns.

(a)曲数接頭辞+数字+曲数接尾辞 例:第5回、約120年 (b)数字+曲数接尾辞 例=15人、数百台 (C)曲数接頭辞+数字 例:表1、図2 (d)数字 例二六、1900 したがって、数詞処理部14は数字または曲数接頭辞を
検出した場合に数詞処理に入り、数字は続く限り読みと
ばし、数字のなくなったところまでを数字部とする。そ
の直後に曲数接尾辞があれば、ここまでを数詞部分とし
てまとめる。また、数詞を含む熟語でひとまとまりに扱
った方が良いものは禁止テーブル26を参照することに
よって、数詞解析しないようにしている。
(a) Song number prefix + number + song number suffix example: 5th, approximately 120 years (b) Number + song number suffix example = 15 people, several hundred (C) Song number prefix + number example : Table 1, Figure 2 (d) Number example 26, 1900 Therefore, when the number word processing unit 14 detects a number or a song number prefix, it enters number word processing, skips reading as many numbers as they last, and reads the numbers when there are no more numbers. up to the number part. If there is a song number suffix immediately after that, it will be summarized as a number part. Further, by referring to the prohibition table 26 for phrases that include number words that should be treated as a group, the number words are not analyzed.

出力部16は例えばプリンタ、ディスプレイ、および磁
気ディスク等のファイル記憶装置を含む。
The output unit 16 includes, for example, a printer, a display, and a file storage device such as a magnetic disk.

次に第6図(a) (b)のフローチャートにより、数
詞処理部14における数詞処理の動作を説明する。
Next, the operation of number word processing in the number word processing section 14 will be explained with reference to the flowcharts shown in FIGS. 6(a) and 6(b).

解析を行う文字列の先頭箇所を示すポインタPと数字部
の先頭箇所Qを初期化しく102) 、文字列があるか
ないかを調べ(104) 、なければ処理を終了する。
The pointer P indicating the beginning of the character string to be analyzed and the beginning Q of the numeric part are initialized (102), and the presence or absence of the character string is checked (104), and if not, the process is terminated.

文字列がある場合には、禁止処理を行う(106)。す
なわち、禁止テーブル26を検索し、数詞を含む熟語が
先頭にあるか否かを検査する。この禁止処理の詳細につ
いては後述する。
If there is a character string, prohibition processing is performed (106). That is, the prohibition table 26 is searched to check whether an idiom containing a number word is at the beginning. Details of this prohibition processing will be described later.

禁止処理の結果、解析できない、すなわち数詞処理して
はならないひとまとまりの熟語の場合にはに=Oを返し
、解析できる、すなわち数詞処理できる場合にはに=1
を返す。次にKがOであるか否かを判断しく+08) 
、 K = Oの場合には数詞処理を行わずに、ステッ
プ104に戻り、次の文字に進む。K=0でない場合に
は、数詞処理を行う。
As a result of the prohibition process, if it cannot be parsed, that is, it is a group of idioms that should not be processed with number words, it returns =O, and if it can be analyzed, that is, it can be processed with number words, it returns =1.
return it. Next, determine whether K is O or not +08)
, K = O, the process returns to step 104 without performing numeral processing and proceeds to the next character. If K=0, numeral processing is performed.

まず、数字テーブル20を調べることにより、文字列の
先頭に数字があるか否かを判断する(110)。
First, by checking the number table 20, it is determined whether or not there is a number at the beginning of the character string (110).

文字列の先頭が数字である場合には、ここからを数詞部
分とみなし、この位置を示すポインタPの値をHに保存
しく124) 、  ステップ128に進む。
If the beginning of the character string is a number, this part is regarded as a numeral part, the value of pointer P indicating this position is stored in H (124), and the process proceeds to step 128.

文字列の先頭が数字でない場合には、文字列の先頭に曲
数接頭辞があるか否かを判断しく+12)、曲数接頭辞
がない場合には次の文字にポインタを進め(114) 
、ステップ104に戻る。
If the beginning of the string is not a number, determine whether there is a song number prefix at the beginning of the string (+12), and if there is no song number prefix, advance the pointer to the next character (114).
, return to step 104.

曲数接頭辞がある場合には、数詞部分の先頭とみなし、
この位置を示すポインタPの値をHに保存する(11B
)。接頭辞の長さだけポインタを進め(118) 、ポ
インタを進めた結果先頭となる文字の位置をQに保存す
る(120)。この先頭の文字が数字か否かを判断しく
122) 、数字でなければ、数詞部分ではないと認め
、先頭となる文字の位置Qを初期化し、ポインタPを1
つ進めて次の文字へ進み(12B) 、  ステップ1
04に戻る。
If there is a song number prefix, it is considered the beginning of the number part,
Save the value of pointer P indicating this position in H (11B
). The pointer is advanced by the length of the prefix (118), and the position of the first character resulting from advancing the pointer is stored in Q (120). The first character is determined whether it is a number or not (122), and if it is not a number, it is recognized that it is not a numeral part, the position Q of the first character is initialized, and the pointer P is set to 1.
Advance one character to the next character (12B), Step 1
Return to 04.

先頭の文字が数字の場合には、ポインタPを1つ進め、
次の文字に進む(128)。また、ステップ124にお
いてポインタPの値をHに保存した後も、同様にポイン
タPを1つ進め(128) 、次の文字に進む。
If the first character is a number, advance the pointer P by one,
Proceed to the next character (128). Further, even after the value of pointer P is stored in H in step 124, pointer P is similarly advanced by one (128) to proceed to the next character.

次の文字が数字か否かを、数字テーブル20を調べるこ
とにより判断しく130) 、数字であればステップ1
28に戻り、ポインタPを1つ進めて次の文字へ進み、
同様に数字か否かを調べる(130)。
Determine whether the next character is a number by checking the number table 20 (130); if it is a number, step 1
Return to 28, advance pointer P by one, advance to the next character,
Similarly, it is checked whether it is a number or not (130).

数字でなくなった場合に、ループを抜け、その文字が曲
数接尾辞であるか否かを、曲数接尾辞テーブル24を検
索することにより判断する(132)。曲数接尾辞であ
る場合には、Q>Hであるか否かを判断しく134) 
、 Q>Hの場合には先頭位置を保存したHからQ−1
までを接頭辞、数字部分の先頭位置Qからp−iまでを
数字部分、接尾辞の先頭部分のPから最後までを接尾辞
と認識する(13B)。すなわち、前記の(a)のパタ
ーンの数詞を認識する。
If the character is no longer a number, the loop is exited, and whether or not that character is a song number suffix is determined by searching the song number suffix table 24 (132). If it is a song number suffix, determine whether Q>H or not.134)
, If Q>H, move from H to Q-1 with the starting position saved.
is recognized as a prefix, the number part from the first position Q to pi is recognized as a number part, and the part from the first position P of the suffix to the end is recognized as a suffix (13B). That is, the number words in the pattern (a) above are recognized.

Q>Hでない場合には接頭辞がないので、数詞部分の先
頭位置を保存したHからP−1までが数字部分、Pから
後を接尾辞と認識する(13B)。この場合には前記の
(b)のパターンの数詞を認識する。
If Q>H, there is no prefix, so the part from H to P-1, where the first position of the numeral part is saved, is recognized as the numeric part, and the part after P is recognized as the suffix (13B). In this case, the number words in the pattern (b) above are recognized.

ステップ132において曲数接尾辞がない場合には、Q
>Hであるか否かを判断しく140) 、 Q>Hの場
合には先頭位置を保存したHからQ−1までを接頭辞、
数字部分の先頭位置QからP−1までを数字部分と認識
する(13B)。すなわち、前記の(C)のパターンの
数詞を認識する。
If there is no song number suffix in step 132, then Q
>H or not (140), if Q>H, the prefix is from H to Q-1 where the starting position is saved,
The part from the beginning position Q of the number part to P-1 is recognized as the number part (13B). That is, the number words in the pattern (C) above are recognized.

Q>Hでない場合には接頭辞がないので、数詞部分の先
頭位置を保存したHからP−1までを数字部分と認識す
る(138)。この場合には前記の(d)のパターンの
数詞を認識する。
If Q>H, there is no prefix, so the area from H to P-1, where the leading position of the numeral part is saved, is recognized as the numeric part (138). In this case, the number words in the pattern (d) above are recognized.

このようにして数詞部分が検出された後、接尾辞があっ
たステップ138 、138の後にはポインタを接尾辞
の先頭部分のPから接尾辞の長さ分だけ進め、再びステ
ップ104に戻る。ステップ142.144の後はその
ままステップ104に戻る。
After the numeral part is detected in this way, after steps 138 and 138 where the suffix was present, the pointer is advanced from P at the beginning of the suffix by the length of the suffix, and the process returns to step 104 again. After steps 142 and 144, the process directly returns to step 104.

次に、ステップ10Bの禁止処理について第7図のフロ
ーチャートにより説明する。
Next, the prohibition process in step 10B will be explained with reference to the flowchart of FIG.

禁止処理は、数詞部分を検出する前に、漢数字や漢数字
相当字で熟語をなしていてひとまとまりに扱った方がよ
いものを検出し、数詞処理しないようにするものである
。このような数詞処理しない方がよいものとしては、例
えば「四面楚歌」「五里霧中」 「白髪三千丈」等があ
る。
The prohibition process detects, before detecting the number word part, phrases that are made up of Chinese numerals or characters equivalent to Chinese numerals and should be treated as a group, and prevents them from being processed as a number word. Examples of words that should not be processed in this way include ``Shimen Souka'', ``Gori Kirinchu'', and ``Shiragami Sanzenjo''.

入力された文字列に対し、数詞処理を行ってはならない
、すなわち解析禁止となるのは、次の4つのパターンに
該当する場合である。
Number processing must not be performed on the input character string, that is, analysis is prohibited in the following four patterns.

(1)漢数字孔当字で直後に数字か曲数接尾辞がある・
・・・・・解析可能 例:焼入、数十(2)漢数字孔当
字で直後に数字か曲数接尾辞がなく、漢数字孔当字もな
い・・・・・・解析禁止例:数、何処、幾何 (3)漢数字相当室以外の数字で禁止テーブルにある・
・・・・・解析禁止 例:四面楚歌(4)漢数字相当室
以外の数字で禁止テーブルにない・・・・・・解析可能
 例:四面、五人第7図において、まず文字列の先頭が
「何」「数」等の漢数字孔当字であるか否かを、数字テ
ーブル20を調べて判断しく202) 、漢数字孔当字
である場合にはポインタを1つすすめる(204)。
(1) A kanji character with a number or song number suffix immediately after it.
...Analysis possible Example: Quenching, number tens (2) Kanji numeral kanji with no numeral or song number suffix immediately after, and no kanji numeral kanji... Example where analysis is prohibited :Number, where, geometry (3) Numbers other than those in the room corresponding to Chinese numerals are on the prohibited table.
...Analysis prohibited Example: Shimen sanka (4) Numbers other than the Chinese numeral equivalent room and not in the prohibition table...Analysis possible Example: In the figure 7 for four men and five people, the beginning of the character string is The number table 20 is checked to determine whether or not the character is a Chinese numeral character such as "what" or "number" (202), and if it is a Chinese numeral character, the pointer is advanced by one (204).

次の文字が曲数接尾辞であるか否かを、曲数接尾辞テー
ブル24を調べて判断しく20El) 、曲数接尾辞で
あれば解析可能と判断してポインタを1つ戻しく210
) 、解析可能であることを表すに=1を返す(212
)。
Check the song number suffix table 24 to determine whether the next character is a song number suffix (20El), and if it is a song number suffix, determine that it can be analyzed, and move the pointer back by one 210
), returns =1 to indicate that it can be analyzed (212
).

ステップ206において曲数接尾辞でなければ、漢数字
孔当字であるか否かを、数字テーブルのフラグにより調
べ(208) 、漢数字孔当字であれば解析可能と判断
してポインタを1つ戻しく210) 、解析可能である
ことを表すに=1を返す(212)。
If it is not a song number suffix in step 206, it is checked by the flag of the number table whether it is a Chinese numeral or not. 210), returns =1 to indicate that it can be analyzed (212).

漢数字孔当字でない場合には、解析禁止と判断してポイ
ンタを1つ進め(214) 、解析禁止であることを表
すに=Oを返す(21B)。
If it is not a Chinese numeral, it is determined that analysis is prohibited, the pointer is advanced by one (214), and =O is returned to indicate that analysis is prohibited (21B).

ステップ202において文字列の先頭が漢数字孔当字で
ない場合には、この文字列が禁止テーブル2Bにあるか
否かを調べ(21B) 、禁止テーブル26にない場合
にはポインタはそのままで、解析可能であることを表す
に=1を返す(220)。
In step 202, if the beginning of the character string is not a kanji kanji character, it is checked whether this character string exists in the prohibition table 2B (21B), and if it is not in the prohibition table 26, the pointer is left as is and the analysis is performed. =1 is returned to indicate that it is possible (220).

禁止テーブル2Gにある場合には解析禁止であるから、
ポインタを禁止テーブル26にあった文字列の長さ分だ
け進め(222) 、解析禁止であることを表すに=O
を返す(224)。
If it is in the prohibition table 2G, analysis is prohibited, so
The pointer is advanced by the length of the character string in the prohibition table 26 (222), and =O indicates that analysis is prohibited.
is returned (224).

このようにして禁止処理を行う。In this way, prohibition processing is performed.

次に具体例を挙げて本装置の動作を説明する。Next, the operation of this device will be explained by giving a specific example.

入力文として第8図に示すような「私は第25回の・・
・」という文が入力された場合に、ます、ポインタPを
1とし、Qを0に初期化する(102)。
The input sentence is ``I am the 25th...'' as shown in Figure 8.
When the sentence "・" is input, the pointer P is set to 1 and the pointer Q is initialized to 0 (102).

文字列があるから(104) 、第7図の禁止処理に移
り、「私Jは漢数字孔当字ではなく (202) 、禁
止テーブルにもないから(2+8) 、解析可能である
(220) 。$ 6図(a)の7o−に戻って、K=
Oでなく(+08)、先頭が数字でなく (+10) 
、曲数接頭辞でもないので(112) 、ポインタを1
つ進め(+14) 、次の文字「は」に進む(114)
Since there is a character string (104), we move on to the prohibition processing in Figure 7 and write, ``I J is not a Chinese numeral konduji (202), and it is not in the prohibition table (2+8), so it can be analyzed (220) .$ 6 Return to 7o- in Figure (a), K=
Not an O (+08), not a number at the beginning (+10)
, since it is not a song number prefix (112), the pointer is set to 1.
Advance one step (+14), advance to the next character "wa" (114)
.

「は」も「私」と同様に処理して、次の文字「第」に進
む(+14) 、禁止処理10Bにおいて第7図に移り
、「第」は漢数字孔当字でな((202)、禁止テーブ
ルにもないから(218) 、解析可能である(220
) 、第6図(a)のフローに戻って、K=0でなく 
(108) 、先頭が数字でなく (110) 、曲数
接頭辞であるから(112) 、 この位置を示すポイ
ンタPの伯をHに保存する(116)。すなわちH=3
とされる。次にポインタを接頭辞の長さ分だけ進める(
+18)。この場合接頭辞「第」は1文字であるから、
ポインタPを1つだけ進める。
``Ha'' is also processed in the same way as ``Washi'' and proceeds to the next character ``No.'' (+14). In prohibition processing 10B, the process moves to Figure 7, and ``No.'' is a Chinese numeral konduji ((202) ), it is not in the prohibited table (218), so it can be analyzed (220
), returning to the flow in Figure 6(a), if K=0 instead of
(108), since the beginning is not a number (110) but a song number prefix (112), the number of pointer P indicating this position is stored in H (116). That is, H=3
It is said that Then advance the pointer by the length of the prefix (
+18). In this case, the prefix "No." is a single character, so
Advance pointer P by one.

ポインタを進めた結果先頭となる文字「二」の位置4を
Qに保存する(120)。この先頭となる文字「二」は
数字なので(122) 、ポインタを1つ進め(12,
8) 、次の文字に進む。次の「十」は数字なので(1
30) 、次の文字に進み(128)、「五」も数字な
ので(130) 、次の文字に進む(12B)。ポイン
タが7となり「回」の文字にくると、数字ではないので
(130) 、このループを抜け、「回」は曲数接尾辞
であるから(132) 、ステップ134に進みQとH
とを比較する。この場合、Q=4、H=3であり、Q>
Hであるから、前記(a)のパターンである(13B)
As a result of advancing the pointer, position 4 of the character "2" which becomes the first character is stored in Q (120). The first character "2" is a number (122), so the pointer advances by one (12,
8) , move on to the next character. The next “ten” is a number (1
30), proceed to the next character (128), and since "five" is also a number (130), proceed to the next character (12B). When the pointer reaches 7 and reaches the character ``times'', it is not a number (130), so we exit this loop, and since ``times'' is a song number suffix (132), we proceed to step 134 and select Q and H.
Compare with. In this case, Q=4, H=3, and Q>
Since it is H, it is the pattern of (a) above (13B)
.

したがって、接頭辞はHからQ−1まで、すなわち3か
ら4−1までとなり、ポインタ3の「第」のみが接頭辞
となる。数字部分はQからP−1まで、すなわち4から
7−1までとなり、ポインタ4から6の「二十五」が数
字部分となる。接尾辞はPから、すなわち7からであり
、ポインタ7の「回」からが接尾辞となる。
Therefore, the prefixes are from H to Q-1, that is, from 3 to 4-1, and only the "th" of pointer 3 is the prefix. The numerical part is from Q to P-1, that is, from 4 to 7-1, and "25" from pointers 4 to 6 is the numerical part. The suffix starts from P, that is, from 7, and the suffix starts from "time" of pointer 7.

これにより、数詞部分を検出したのでポインタを接尾辞
の長さ分だけ進め(14B) 、次のポインタ8の「の
」について同様の処理を行う。
As a result, the numeral part is detected, so the pointer is advanced by the length of the suffix (14B), and the same process is performed for the next pointer 8, "no".

次に、入力文として第9図に示すような[彼は幾何を勉
強する。」という文が入力された場合について説明する
Next, the input sentence as shown in Figure 9 is [He studies geometry]. ” will be explained below.

「彼は」は、前記の例の「私は」と同様に、第7図の禁
止処理において、漢数字相当字ではなく(202) 、
禁止テーブルにもないから(218) 、解析可能であ
り(220) 、第6図(a)のに= On’なく(+
08) 、先頭が数字でなく(110) 、曲数接頭辞
でもないので(112) 、ポインタを1つ進め(11
4)、次の文字「幾」に進む(114)。
"He" is not a Chinese numeral equivalent (202) in the prohibition process in Figure 7, similar to "I am" in the above example.
Since it is not in the prohibition table (218), it is analyzable (220), and in Figure 6 (a), = On' is not (+
08), since the beginning is not a number (110) nor is it a song number prefix (112), the pointer is advanced by one (11).
4), proceed to the next character "Iku" (114).

「幾」は第7図の禁止処理において、漢数字相当字であ
るから(202) 、ポインタを1つ進め(204) 
、次の文字「何」を見ると、曲数接尾辞ではなく (2
0Ei) 、漢数字相当字でもないので(208) 、
解析禁止と判断してポインタを進めて次の文字に進み(
214) 、 K = Oを返す(218)。$6図(
a)に戻り、K=Oなので(10B) 、数詞解析を行
わす、次の文字を処理する(104)。
In the prohibition process in Figure 7, "Iku" is a character equivalent to a Chinese numeral (202), so the pointer is advanced by one (204).
, if you look at the next character "what", you will see that it is not a song number suffix but (2
0Ei), since it is not a kanji numeral equivalent (208),
Determines that parsing is prohibited and advances the pointer to the next character (
214), returns K=O (218). Figure $6 (
Returning to a), since K=O (10B), numeral analysis is performed and the next character is processed (104).

本実施例によれば、数詞を含む文字列に対して数詞特有
のパターンを考慮した解析を行うことができる。すなわ
ち、従来数字として扱わなかった接頭辞および接尾辞、
例えば漢数字相当字や桁を表す漢数字を数詞の一部とし
て扱うことにより、これらと数字からなる文字列全体を
数詞として認識することができ、適切な数詞の処理を行
うことができる。したがって、漢数字相当字や桁を表す
漢数字を個別に辞書に登録しておく必要もなく、辞書の
容量も小さくてすむ。
According to this embodiment, it is possible to analyze a character string including a numeral in consideration of patterns specific to numerals. In other words, prefixes and suffixes that were not traditionally treated as numbers,
For example, by treating characters equivalent to Chinese numerals and Chinese numerals representing digits as part of number words, the entire string of characters consisting of these and numbers can be recognized as a number word, and appropriate number words can be processed. Therefore, there is no need to individually register characters corresponding to Chinese numerals or Chinese numerals representing digits in the dictionary, and the dictionary capacity can be reduced.

さらに、算用数字と漢数字の混合された文字列も正しく
解析することができる。
Furthermore, character strings containing a mixture of arithmetic numerals and Chinese numerals can be correctly analyzed.

また、数詞や数字部分を含んだ熟語や慣用表現等のよう
な、ひとまとまりにして扱った方がよいと思われるもの
は禁止処理で検出し、数詞解析を行わないようにしてい
るから、このような慣用表現等を、誤って数詞として処
理することもない。
In addition, the prohibition process detects words that should be treated as a group, such as idioms and idiomatic expressions that include number words or number parts, and prevents number word analysis. It also prevents idiomatic expressions such as verbs from being mistakenly treated as numerals.

効  果 本発明によれば、文字列が数字と接頭辞または接尾辞等
の曲数文字からなる場合にも、この文字列全体を数詞と
認識することができる。したがって、効率的に数詞を処
理することができる。
Effects According to the present invention, even when a character string consists of numbers and number characters such as prefixes or suffixes, the entire character string can be recognized as a number word. Therefore, number words can be processed efficiently.

また、漢数字相当字や桁を表す漢数字を個別に辞書に登
録しておく必要がないため、辞書の容量を小さくするこ
とができる。
Furthermore, since it is not necessary to individually register characters corresponding to Chinese numerals and Chinese numerals representing digits in the dictionary, the capacity of the dictionary can be reduced.

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

第1図は本発明による文字列処理装置の一実施例を示す
機能ブロック図、 第2図は第1図の数字テーブルに格納されるデータの一
例を示す図、 第3図は第1図の曲数接頭辞テーブルに格納されるデー
タの一例を示す図、 第4図は第1図の曲数接尾辞テーブルに格納されるデー
タの一例を示す図、 第5図は第1図の禁止テーブルに格納されるデータの一
例を示す図、 第6図(a) (b)は第1図の装置の動作を示すフロ
ーチャート、 第7図は第6図(a)の禁止処理の動作を示すフローチ
ャート、 第8図は第1図の装置に入力される入力文の一例を示す
図、 第9図は第1図の装置に入力される入力文の他の例を示
す図である。 主要部分の符号の説明 10、、、入力部 12、 、 、入力文字列ファイル 14、、、数詞処理部 16、、、出力部 20、、、数字テーブル 22、、、曲数接頭辞テーブル 24、、、曲数接尾辞テーブル 2B、、、禁止テーブル
FIG. 1 is a functional block diagram showing an embodiment of a character string processing device according to the present invention, FIG. 2 is a diagram showing an example of data stored in the number table shown in FIG. 1, and FIG. Figure 4 is a diagram showing an example of data stored in the song number prefix table. Figure 4 is a diagram showing an example of data stored in the song number suffix table in Figure 1. Figure 5 is the prohibition table in Figure 1. 6(a) and 6(b) are flowcharts showing the operation of the device in FIG. 1, and FIG. 7 is a flowchart showing the operation of the prohibition process in FIG. 6(a). , FIG. 8 is a diagram showing an example of an input sentence inputted into the device shown in FIG. 1, and FIG. 9 is a diagram showing another example of an input sentence inputted into the device shown in FIG. 1. Explanation of symbols of main parts 10, Input section 12, Input character string file 14, Number processing section 16, Output section 20, Number table 22, Song number prefix table 24, ,, Song number suffix table 2B, , Prohibited table

Claims (1)

【特許請求の範囲】 1、文字列を入力する入力手段と、 数字および漢数字相当字を格納する数字記憶手段と、 前記数字とともに用いられることにより数詞を構成する
助数文字を格納する助数文字記憶手段と、 前記入力手段から入力された文字列について、前記数字
記憶手段および前記助数文字記憶手段を検索し、前記文
字列が数詞であるか否かを判断する数詞処理手段とを有
し、 該数詞処理手段は、前記文字列が前記数字および前記助
数文字からなる場合にもこれを全体として数詞と認識す
ることを特徴とする文字列処理装置。
[Scope of Claims] 1. An input means for inputting a character string; a numeric storage means for storing numbers and characters equivalent to Chinese numerals; and an arbiter for storing an arbiter character that constitutes a numeral when used together with the numerals. character storage means; and numeral word processing means for searching the numeral storage means and the arbiter character storage means for the character string input from the input means and determining whether or not the character string is a numeral word. A character string processing device characterized in that the numeral processing means recognizes the character string as a numeral as a whole even when the character string consists of the numeral and the fractional character.
JP62118105A 1987-05-16 1987-05-16 Character string processor Pending JPS63284676A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62118105A JPS63284676A (en) 1987-05-16 1987-05-16 Character string processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62118105A JPS63284676A (en) 1987-05-16 1987-05-16 Character string processor

Publications (1)

Publication Number Publication Date
JPS63284676A true JPS63284676A (en) 1988-11-21

Family

ID=14728138

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62118105A Pending JPS63284676A (en) 1987-05-16 1987-05-16 Character string processor

Country Status (1)

Country Link
JP (1) JPS63284676A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06325076A (en) * 1993-03-03 1994-11-25 Internatl Business Mach Corp <Ibm> Method for dividing input text in word

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06325076A (en) * 1993-03-03 1994-11-25 Internatl Business Mach Corp <Ibm> Method for dividing input text in word

Similar Documents

Publication Publication Date Title
US5890103A (en) Method and apparatus for improved tokenization of natural language text
Palmer Tokenisation and sentence segmentation
WO1997004405A9 (en) Method and apparatus for automated search and retrieval processing
US7212963B2 (en) System for distinguishing names in Asian writing systems
US7136805B2 (en) System for distinguishing names of organizations in Asian writing systems
JPH06259424A (en) Document display device and document summary device and digital copying device
JPS63284676A (en) Character string processor
JP2792147B2 (en) Character processing method and device
Garabík et al. Naïve Terminological Annotation of Legal Texts in Slovak–Can it Be Useful
JP2621999B2 (en) Document processing device
Sedlácek et al. Automatic Processing of Czech Inflectional and Derivative Morphology
JP2973369B2 (en) Japanese dictionary construction device for Japanese sentence morphological analysis
JPH0477857A (en) Improper expression detecting device
JPS63163956A (en) Document preparation and correction supporting device
Garabík et al. Naivno terminološko označivanje zakonskih tekstova u slovačkom–može li biti korisno?
JP3045886B2 (en) Character processing device with handwriting input function
Lewi et al. Computer Documentation System for Small-and Medium-Sized Information Collections
JPS595335A (en) Japanese language input device
JPH07200592A (en) Text processor
Takemoto et al. NEC Corporation and University of Sheffield:“Description of NEC/Sheffleld System Used For MET Japanese”
JPH0468466A (en) Kana / kanji converting device
JPH06289890A (en) Natural language processor
JPH0424867A (en) Document preparing device
JPS63136264A (en) Mechanical translating device
JPH02110771A (en) Electronic translation device