JP6668855B2 - Search device, search method and program - Google Patents
Search device, search method and program Download PDFInfo
- Publication number
- JP6668855B2 JP6668855B2 JP2016052786A JP2016052786A JP6668855B2 JP 6668855 B2 JP6668855 B2 JP 6668855B2 JP 2016052786 A JP2016052786 A JP 2016052786A JP 2016052786 A JP2016052786 A JP 2016052786A JP 6668855 B2 JP6668855 B2 JP 6668855B2
- Authority
- JP
- Japan
- Prior art keywords
- search
- index
- category
- text
- unit
- 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.)
- Active
Links
Images
Description
本発明は、検索装置、検索方法及びプログラムに関する。 The present invention relates to a search device, a search method, and a program.
電子文書の増大に伴い、大規模な文書データベースから所望の電子文書を効率良く検索する技術の重要性が高まっている。 As the number of electronic documents increases, the importance of technology for efficiently searching for a desired electronic document from a large-scale document database has increased.
例えば、特許文献1及び特許文献2は、Nグラムを用いた検索技術を開示している。具体的に説明すると、特許文献1は、検索対象の辞書データのテキストを見出し語カテゴリと本文カテゴリとに分類し、見出し語カテゴリに属するテキストを前方一致検索し、見出し語カテゴリに属するテキストと本文カテゴリに属するテキストとを部分一致検索するテキスト検索装置を開示している。また、特許文献2は、検索文字列が少し誤って入力されても所望の文書を探し出すことができる曖昧検索技術を開示している。
For example,
上記のようなNグラムを用いた電子文書の検索において、検索の効率を向上させ、検索時間を短縮することが望まれている。 In searching for an electronic document using the N-gram as described above, it is desired to improve the search efficiency and shorten the search time.
本発明は、以上のような課題を解決するためのものであり、Nグラムを用いた電子文書の検索において、検索時間を短縮することが可能な検索装置、検索方法及びプログラムを提供することを目的とする。 An object of the present invention is to provide a search device, a search method, and a program that can reduce a search time in a search for an electronic document using an N-gram. Aim.
上記目的を達成するため、本発明に係る検索装置は、
検索対象の電子文書のうちの第1のカテゴリに属するテキストに含まれる複数のNグラムと、前記第1のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第1のインデックス、及び、前記電子文書のうちの第2のカテゴリに属するテキストに含まれる複数のNグラムと、前記第2のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第2のインデックスを記憶する記憶手段と、
検索キーワードを取得する取得手段と、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記第1のカテゴリに属するテキストから前記検索キーワードを検索する第1の検索手段と、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックス及び前記第2のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記電子文書から前記検索キーワードを検索する第2の検索手段と、
少なくとも前記第1の検索手段と前記第2の検索手段の一方による検索結果を出力する出力手段と、
を備えることを特徴とする。
In order to achieve the above object, a search device according to the present invention comprises:
A first N-gram in which a plurality of N-grams included in the text belonging to the first category in the electronic document to be searched are associated with the appearance positions of the plurality of N-grams in the text belonging to the first category; An index, and a plurality of N-grams included in the text belonging to the second category of the electronic document, and an appearance position of the plurality of N-grams in the text belonging to the second category. Storage means for storing the second index;
Acquisition means for acquiring a search keyword;
The search keywords are retrieved from the text belonging to the first category by reading the appearance positions of the plurality of N-grams included in the search keywords from the first index and evaluating the continuity of the read appearance positions. First search means;
The search keywords are retrieved from the electronic document by reading the appearance positions of a plurality of N-grams included in the search keywords from the first index and the second index and evaluating the continuity of the read appearance positions. Second search means for performing
Output means for outputting a search result by at least one of the first search means and the second search means;
It is characterized by having.
本発明によれば、Nグラムを用いた電子文書の検索において、検索時間を短縮させることができる。 According to the present invention, in an electronic document search using an N-gram, the search time can be reduced.
以下、本発明の実施形態について、図面を参照して説明する。なお、図中同一又は相当する部分には同一符号を付す。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding portions are denoted by the same reference numerals.
図1に、本発明の実施形態に係る検索装置100の外観を示す。検索装置100は、一例として、電子辞書である。図1に示すように、検索装置100は、ユーザの操作に応じて検索キーワードの入力を受け付けるキーボード100iと、検索キーワードに基づいて辞書を検索した検索結果を表示するLCD(Liquid Crystal Display)100hと、を備える。
FIG. 1 shows an appearance of a
図2に示すように、検索装置100は、CPU(Central Processing Unit)100a、ROM(Read Only Memory)100b、RAM(Random Access Memory)100c、ハードディスク100d、メディアコントローラ100e、ビデオカード100g、及びスピーカ100jをその内部に備える。これら各部は、LCD100h及びキーボード100iとバスを介して接続されている。
As shown in FIG. 2, the
CPU100aは、例えばマイクロプロセッサ等であって、様々な処理及び演算を実行する中央演算処理部である。CPU100aは、中央処理装置、中央演算装置又はプロセッサ等とも呼ばれる。CPU100aは、命令及びデータを転送するための伝送経路であるシステムバスを介して検索装置100の各部と接続され、検索装置100全体を統括制御する。CPU100aは、ROM100b又はハードディスク100dに保存されたプログラムを実行するにより、下記の検索処理を含む各種の処理を実行する。RAM100cは、CPU100aによるプログラムの実行時において、処理対象とするデータを一時的に記憶する等、作業領域として用いられる。
The
ハードディスク100dは、各種のデータを保存したテーブルと、英和辞書、国語辞典又は百科事典等の辞書データと、を記憶する不揮発性の記憶部である。なお、検索装置100は、ハードディスク100dの代わりに、フラッシュメモリを備えても良い。
The
メディアコントローラ100eは、フラッシュメモリ、CD(Compact Disc)、DVD(Digital Versatile Disc)、及びブルーレイディスク(Blu-ray Disc)(登録商標)を含む記録媒体から各種のデータ及びプログラムを読み出す。
The
ビデオカード100gは、CPU100aから出力されたデジタル信号に基づいて画像を描画(つまり、レンダリング)すると共に、描画された画像を表す画像信号を出力する。LCD100hは、ビデオカード100gから出力された画像信号に従って画像を表示する表示デバイスである。なお、検索装置100は、LCD100hの代わりに、PDP(Plasma Display Panel)若しくはEL(Electroluminescence)ディスプレイを備えても良い。スピーカ100jは、CPU100aから出力された信号に基づいて音声を出力する。
The
図3に示すように、検索装置100は、機能的に、生成部120と、取得部130と、検索部140と、評価部150と、出力部160と、表示部170と、を備える。CPU100aは、ROM100bに記憶されたプログラムをRAM100cに読み出して、そのプログラムを実行して制御することにより、これら各部として機能する。また、検索装置100は、機能的に、データ記憶部110と、表示部170と、を備える。データ記憶部110は、RAM100c又はハードディスク100dの記憶領域に構築される。表示部170は、LCD100h等の表示デバイスである。
As illustrated in FIG. 3, the
データ記憶部110は、検索対象の電子文書の一例である辞書データを記憶する。この辞書データは、図4に示すように、見出し語を表すテキスト(以下、「見出し語テキスト」という。)と、見出し語の説明を表すテキスト(以下、「説明テキスト」という。)と、例えば、例文、成句又は複合語等(以下、「イディオム」という。)といった見出し語の用例を表すテキスト(以下、「用例テキスト」という。)と、を含んでいる。
The
以下では、説明テキストと用例テキストとを合わせて本文テキストと言う。言い換えれば、辞書データに含まれるテキストは、見出し語カテゴリに属するテキスト(見出し語テキスト)と、本文カテゴリに属するテキスト(本文テキスト)と、に分類される。見出し語カテゴリを第1のカテゴリといい、本文カテゴリを第2のカテゴリという。また、辞書データのうち、見出し語テキストが占める部分を見出し部、説明テキストが占める部分を説明部、用例テキストが占める部分を用例部という。 Hereinafter, the description text and the example text are collectively referred to as a body text. In other words, the text included in the dictionary data is classified into a text belonging to the headword category (headword text) and a text belonging to the body text category (body text). The headword category is called a first category, and the body category is called a second category. In the dictionary data, a portion occupied by the headword text is referred to as a heading portion, a portion occupied by the explanation text is referred to as an explanation portion, and a portion occupied by the example text is referred to as an example portion.
辞書データは、見出し部と説明部と用例部との組を一つの構成単位として、この構成単位が連なって構成されている。各構成単位は、例えば、辞書データが英和辞典であれば、見出し語テキストのアルファベット順に並べられている。各構成単位において、見出し部の直後にその見出し語を説明する説明部が配置されており、その直後にその見出し語の用例を表す用例部が配置されている。 The dictionary data is composed of a set of a heading part, a description part, and an example part as one constituent unit, and these constituent units are connected to each other. For example, if the dictionary data is an English-Japanese dictionary, the constituent units are arranged in alphabetical order of the headword text. In each of the constituent units, an explanation part for explaining the headword is arranged immediately after the heading part, and an example part showing an example of the headword is arranged immediately after the heading part.
辞書データには、複数の説明部が、電子辞書の編集者が定めた並び順に従って配置されている。具体的に説明すると、見出し語のより一般的な意味内容を説明する説明部の方が、見出し語のより特殊な意味内容を説明する説明部よりも先の位置に格納されている。或いは、より使用頻度の高い意味内容を説明する説明部の方が、より使用頻度の低い意味内容を説明する説明部よりも後の位置に格納されているとしても良い。用例部については、説明部に対応する用例が記載された用例部が該当する説明部毎に記載されている場合と、1つの説明部の後に複数の用例部がまとめて記載されている場合とがある。 In the dictionary data, a plurality of explanation units are arranged according to the arrangement order determined by the editor of the electronic dictionary. More specifically, the explanation section for explaining the more general meaning content of the headword is stored at a position earlier than the explanation section for explaining the more specific meaning content of the headword. Alternatively, the explanation unit that explains the meaning content that is used more frequently may be stored at a position after the explanation unit that explains the meaning content that is used less frequently. As for the example section, there are cases where an example section in which an example corresponding to the explanation section is described is described for each corresponding explanation section, and a case where a plurality of example sections are described collectively after one explanation section. There is.
生成部120は、検索対象の電子文書である辞書データに含まれる複数のNグラムと、辞書データにおけるこの複数のNグラムの出現位置と、を対応付けた検索インデックスを生成する。Nグラムとは、連続したN文字の文字列(Nは自然数)である。例えば、Nが1の場合のNグラムをモノグラム、Nが2の場合のNグラムをバイグラム、Nが3の場合のNグラムをトライグラムという。生成部120は、CPU100aがRAM100c又はハードディスク100d等と協働することによって実現される。生成部120は、生成手段として機能する。また、生成部120は、検索インデックスを生成することで検索インデックスを取得するインデックス取得手段として機能する。
The
生成部120は、検索インデックスを生成するために、再配置データ生成部121と検索インデックス生成部122との機能を備えている。
The
再配置データ生成部121は、データ記憶部110に記憶された辞書データを読み出し、辞書データに含まれるテキストを再配置することによって、再配置データを生成する。具体的に説明すると、辞書データは、図4左側に示したように、見出し語毎に、その説明部と用例部とが交互に配置されている。再配置データ生成部121は、交互に配置された説明部と用例部とを、それぞれまとまって配置されるように並び替えて、図4右側に示す再配置データを生成する。
The rearrangement
検索インデックス生成部122は、再配置データ生成部121によって生成された再配置データから検索インデックスを生成する。具体的に説明すると、検索インデックス生成部122は、再配置データに含まれるNグラムを順に抽出し、抽出した各Nグラムとその出現位置とを対応付けたテーブルを、検索インデックスとして生成する。検索インデックス生成部122は、Nグラムとして、モノグラムとバイグラムとを用いる。
The search
図5及び図6に、検索インデックスの構成を示す。図5に示すように、検索インデックスは、見出し部インデックス、説明部インデックス、用例部インデックスを含んでいる。 5 and 6 show the structure of the search index. As shown in FIG. 5, the search index includes a heading part index, an explanation part index, and an example part index.
見出し部インデックスは、辞書データのうちの見出し語テキストに含まれる複数のNグラム(具体的にはモノグラム及びバイグラム)と、当該見出し語テキストにおける当該複数のNグラムの出現位置と、を対応付けたインデックスである。見出し部インデックスは、(1)見出し部に含まれるNグラムの文字列パターンに関するファイル(pattern_hdl.idx)と、(2)その出現位置及び出現頻度に関するファイル(position_hdl.idx)と、を含んでいる。 The heading index associates a plurality of N-grams (specifically, monograms and bigrams) included in the headword text in the dictionary data with the appearance positions of the plurality of N-grams in the headword text. It is an index. The heading index includes (1) a file (pattern_hdl.idx) related to the character string pattern of the N-gram included in the heading, and (2) a file (position_hdl.idx) related to its appearance position and frequency. .
説明部インデックスは、辞書データのうちの説明テキストに含まれる複数のNグラムと、当該説明テキストにおける当該複数のNグラムの出現位置と、を対応付けたインデックスである。説明部インデックスは、(3)説明部に含まれるNグラムの文字列パターンに関するファイル(pattern_bdy.idx)と、(4)その出現位置及び出現頻度に関するファイル(position_bdy.idx)と、を含んでいる。 The explanation part index is an index that associates a plurality of N-grams included in the explanation text in the dictionary data with the appearance positions of the plurality of N-grams in the explanation text. The explanation part index includes (3) a file (pattern_bdy.idx) related to the character string pattern of the N-gram included in the explanation part, and (4) a file (position_bdy.idx) related to its appearance position and appearance frequency. .
用例部インデックスは、辞書データのうちの用例テキストに含まれる複数のNグラムと、当該用例テキストにおける当該複数のNグラムの出現位置と、を対応付けたインデックスである。用例部インデックスは、(5)用例部に含まれるNグラムの文字列パターンに関するファイル(pattern_exp.idx)と、(6)その出現位置及び出現頻度に関するファイル(position_exp.idx)と、を含んでいる。 The example section index is an index that associates a plurality of N-grams included in the example text in the dictionary data with the appearance positions of the plurality of N-grams in the example text. The example section index includes (5) a file (pattern_exp.idx) related to the character string pattern of the N-gram included in the example section, and (6) a file (position_exp.idx) related to its appearance position and frequency. .
検索インデックス生成部122は、見出し語テキスト、説明テキスト及び用例テキストのそれぞれにおいて別々に、先頭から1文字ずつずらしながらモノグラム及びバイグラムを抽出し、抽出したモノグラム及びバイグラムの出現位置と出現頻度とを導出する。そして、検索インデックス生成部122は、抽出したモノグラム及びバイグラムとその出現位置及び出現頻度とを対応付けることによって、このような3種類のインデックスを生成する。
The search
なお、見出し部インデックスを第1のインデックスといい、説明部インデックスと用例部インデックスとを合わせて第2のインデックスという。 Note that the heading section index is referred to as a first index, and the description section index and the example section index are collectively referred to as a second index.
また、図6に示すように、検索インデックスは、(7)見出し番号に関するファイル(number.idx)と、(8)見出し部の開始位置に関するファイル(headline.idx)と、(9)用例部の開始位置に関するファイル(example.idx)と、を含んでいる。見出し番号に関するファイル(number.idx)は、見出し語単位で、見出し部の開始位置、見出し語個数、説明部の開始位置、用例部の開始位置、用例個数、辞書番号、及び見出し番号の情報を含んでいる。辞書番号は、辞書データを識別する番号である。見出し番号は、複数の見出し部のそれぞれを識別するための番号である。 As shown in FIG. 6, the search index includes (7) a file related to a heading number (number.idx), (8) a file related to a start position of a heading part (headline.idx), and (9) an example section. File about the start position (example.idx). The file (number.idx) relating to the heading number contains information on the starting position of the heading part, the number of heading words, the starting position of the explanation part, the starting position of the example part, the number of examples, the dictionary number, and the heading number in heading word units. Contains. The dictionary number is a number for identifying dictionary data. The heading number is a number for identifying each of the plurality of heading parts.
なお、見出し部インデックスに含まれるNグラム文字列パターンの出現位置、及び、見出し番号に関するファイルにおける見出し部の開始位置は、再配置データの見出し部の先頭文字からの、見出し語テキストのみ(図4における見出し部1〜見出し部M)における文字数を数えて導出した位置である。同様に、説明部インデックスに含まれるNグラム文字列パターンの出現位置、及び、見出し番号に関するファイルにおける説明部の開始位置は、再配置データの説明部の先頭文字からの、説明テキストのみ(図4における説明部1〜説明部M)における文字数を数えて導出した位置である。同様に、用例部インデックスに含まれるNグラム文字列パターンの出現位置、及び、見出し番号に関するファイルにおける用例部の開始位置は、再配置データの用例部の先頭文字からの、用例テキストのみ(図4における用例部1〜用例部M)における文字数を数えて導出した位置である。
Note that the appearance position of the N-gram character string pattern included in the heading index and the starting position of the heading in the file related to the heading number are only the headword text from the first character of the heading of the relocation data (FIG. 4). Are positions derived by counting the number of characters in the heading
図3に示した検索装置100の機能構成の説明に戻る。データ記憶部110は、生成部120によって生成された検索インデックスを記憶する。データ記憶部110は、記憶手段として機能する。
Returning to the description of the functional configuration of the
取得部130は、検索キーワードを取得する。ユーザは、キーボード100iを操作することで、所望の検索キーワードを検索装置100に入力することができる。取得部130は、また、検索装置100に予め複数の電子文書が登録されている場合、ユーザは、キーボード100iを操作することで、複数の電子文書のうちから検索対象となる電子文書を指定することができる。取得部130は、このようにして入力された検索キーワード及び電子文書の指定を取得する。取得部130は、CPU100aがキーボード100i等と協働することによって実現される。取得部130は、取得手段(検索キーワード取得手段)として機能する。
The
検索部140は、検索対象の電子文書である辞書データから、取得部130によって取得された検索キーワードを検索する。具体的に説明すると、検索部140は、検索キーワードに含まれる複数のNグラムの辞書データにおける出現位置を検索インデックスから読み出し、読み出した出現位置の連続性を評価することによって、辞書データから検索キーワードを検索する。検索部140は、CPU100aがRAM100c等と協働することによって実現される。
The
より詳細に説明すると、検索部140は、インクリメンタル検索部141と、全文検索部142と、曖昧検索部143と、の機能を含んでいる。検索部140は、これら3種類の検索を実行することができる。
More specifically, the
インクリメンタル検索部141は、見出し部を対象として、インクリメンタル検索を実行する。インクリメンタル検索は、ユーザによって検索キーワードが1文字ずつ入力される度に実行される前方一致検索である。インクリメンタル検索部141は、取得部130によって検索キーワードが1文字ずつ取得される度に、取得部130によって既に取得された少なくとも1文字に新たに取得された1文字を加えた文字列を検索キーワードとして検索する。
The
具体的に図7を参照して、インクリメンタル検索を実行した例を説明する。ユーザがキーボード100iを介して検索キーワードを1文字ずつ入力すると、取得部130は、この入力に応じて検索キーワードを1文字ずつ取得する。ユーザが検索キーワードの先頭の1文字(図7の例では「w」)を入力すると、インクリメンタル検索部141は、見出し部インデックスを参照して、検索対象となる辞書データにおいて先頭が「w」から始まる見出し語を検索する。その結果、図7の左側に示したように、先頭が「w」から始まる見出し語一覧が生成される。
Specifically, an example in which the incremental search is executed will be described with reference to FIG. When the user inputs a search keyword one character at a time via the
次の1文字(図7の例では「h」)が入力されると、インクリメンタル検索部141は、取得部130によって既に取得された1文字「w」と新たに取得された1文字「h」とを加えた文字列「wh」を先頭に持つ見出し語を、見出し部インデックスを参照して更に検索する。その結果、図7の中央に示すように、先頭が「wh」から始まる見出し語一覧が生成される。更に次の1文字(図7の例では「i」)が入力されると、インクリメンタル検索部141は、取得部130によって既に取得された2文字「wh」と新たに取得された1文字「i」とを加えた文字列「whi」を先頭に持つ見出し語を、見出し部インデックスを参照して更に検索する。その結果、図7の右に示すように、先頭が「whi」から始まる見出し語一覧が生成される。
When the next one character (“h” in the example of FIG. 7) is input, the
このように、インクリメンタル検索部141は、ユーザによって検索キーワードが1文字ずつ入力される度に、見出し部インデックスを参照して、見出し語カテゴリに属する見出し語テキストから検索キーワードで始まる文字列を検索する前方一致検索を実行する。
As described above, the
全文検索部142は、辞書データ全体を対象として、全文検索を実行する。全文検索は、例えばユーザによってリターンキーが押下される等によって検索キーワードが確定された後に実行される完全一致検索である。全文検索部142は、検索キーワードが確定されると、見出し部インデックス、説明部インデックス及び用例部インデックスを参照して、辞書データ全体から検索キーワードを含む文字列を検索する全文検索を実行する。
The full-
例えば、検索キーワードとして「while」との文字列が取得された場合、全文検索部142は、検索キーワード「while」の先頭から末尾まで順に2文字ずつ切り出していき、「wh」、「hi」、「il」、「le」の4個のバイグラムを抽出する。そして、全文検索部142は、データ記憶部110に記憶された見出し部インデックス、説明部インデックス及び用例部インデックスから抽出した各バイグラムの出現位置を読み込んで、その連続性を評価する。具体的に説明すると、全文検索部142は、抽出した4個のバイグラム「wh」、「hi」、「il」、「le」が、この順番で1文字ずつずれた位置に出現するかを判定する。評価の結果、各バイグラムの出現位置に連続性が有ると評価した場合、全文検索部142は、その出現位置に、検索キーワードに相当する文字列が存在していると判定する。
For example, when a character string “while” is acquired as a search keyword, the full-
図8に、「while」との検索キーワードを全文検索した場合の例を示す。図8に示すように、全文検索部142は、「while」との文字列の完全一致検索を、見出し部、説明部及び用例部のそれぞれについて実行する。その結果、見出し部、説明部及び用例部のそれぞれにおいて、検索キーワード(図8の例では「while」)が含まれるテキストが見付け出される。
FIG. 8 shows an example in which a full-text search is performed for a search keyword “while”. As illustrated in FIG. 8, the full-
曖昧検索部143は、見出し部を対象として、曖昧検索を実行する。曖昧検索は、検索キーワードと部分的には一致するが完全には一致しない文字列を探し出すことが可能な部分一致検索である。曖昧検索部143は、ユーザがキーボード100iを操作して検索キーワードを入力し、曖昧検索モードを選択した場合に、曖昧検索を実行する。曖昧検索の詳細については、上記特許文献2に開示されているため、ここでは簡単に説明する。
The
曖昧検索部143は、検索キーワードに含まれる複数のNグラムの見出し語カテゴリに属するテキストにおける出現位置を見出し部インデックスから読み出し、読み出した出現位置が、検索キーワードにおける複数のNグラムの位置と連続して合致する数(連続合致Nグラム数)に基づいて、見出し語テキストから検索キーワードを検索する。連続合致Nグラム数とは、検索キーワードから抽出した各Nグラムの見出し語テキストにおける出現位置が、検索キーワードにおける対応する各Nグラムの位置と連続して合致する数である。曖昧検索部143は、連続合致Nグラム数を算出し、連続合致Nグラム数が多いほど評価が高い(ユーザが望んでいる結果である確率が高い)検索結果であると判定する。
The
図9に、「salaed」との検索キーワードを曖昧検索した場合の例を示す。図9に示すように、曖昧検索部143は、曖昧検索を実行することで、「salaed」との文字列に近い文字列を見出し語の中から見付け出す。その結果、例えば「salad」等の見出し語が見付け出される。
FIG. 9 shows an example in which the search keyword “saled” is ambiguously searched. As shown in FIG. 9, the
インクリメンタル検索部141及び曖昧検索部143の検索対象は、どちらも辞書データのうちの見出し語カテゴリ(第1のカテゴリ)に属するテキストのみである。言い換えると、インクリメンタル検索部141及び曖昧検索部143は、それぞれ第1のカテゴリに属するテキストから検索キーワードを検索する第1の検索手段として機能する。これに対して、全文検索部142の検索対象は、辞書データ全体、言い換えると見出し語カテゴリ(第1のカテゴリ)と本文カテゴリ(第2のカテゴリ)との両方である。言い換えると、全文検索部142は、第1のカテゴリに属するテキストと第2のカテゴリに属するテキストとから検索キーワードを検索する第2の検索手段として機能する。
The search targets of the
評価部150は、検索部140による検索結果に対する順位付け評価値を算出する。順位付け評価値とは、検索結果を出力する際の優先順位を示す値である。評価部150は、CPU100aがRAM100c等と協働することによって実現される。評価部150は、評価手段として機能する。
The
例えば、評価部150は、検索によって得られた検索キーワードの出現位置が見出し部、説明部又は用例部の先頭に近いほど、順位を高く評価する。また、評価部150は、1つの見出し部に複数の見出し語がある場合には、先頭に近い見出し語が検索結果として得られた場合ほど、高く評価する。説明部及び用例部についても同様である。また、評価部150は、曖昧検索において、検索キーワードと合致する文字数が多いほど順位を高くする。また、評価部150は、全文検索におけるAND検索の場合には、2つの検索キーワードの出現位置が近いほど順位を高く評価する。
For example, the
出力部160は、検索部140による検索結果を出力する。具体的に説明すると、出力部160は、インクリメンタル検索部141、全文検索部142又は曖昧検索部143によって検索が実行されると、検索によって得られた検索キーワードの出現位置を、評価部150によって算出された順位付け評価値が高い順に並べ替える。そして、出力部160は、並び替えられた出現位置を示す情報を検索結果として表示部170に表示する。或いは、出力部160は、検索結果をスピーカ100jから音声で出力しても良い。出力部160は、CPU100aがビデオカード100g、LCD100h又はスピーカ100j等と協働することによって実現される。出力部160は、出力手段として機能する。
The
具体的に説明すると、インクリメンタル検索が実行された場合、出力部160は、ユーザが検索キーワードを1文字ずつ入力する度に、例えば図7に示したような見出し語一覧を表示部170に表示する。これに対して、全文検索が実行された場合、出力部160は、例えば図8に示したように、検索結果を見出し部、説明部及び用例部に分けて表示部170に表示する。また、曖昧検索が実行された場合、出力部160は、例えば図9に示したように、曖昧検索結果を表示部170に表示する。
More specifically, when the incremental search is performed, the
以上のように構成される検索装置100によって実行される処理の流れについて、図10から図17に示すフローチャートを参照して説明する。
The flow of processing executed by the
まず、図10に示すフローチャートを参照して、生成部120によって実行される検索インデックス生成処理の流れを説明する。検索インデックス生成処理は、再配置データ生成処理と検索インデックス生成処理とに分けられる。図10に示す検索インデックス生成処理は、例えばユーザがキーボード100iを操作して検索インデックスを生成する指示を入力すると、開始する。
First, the flow of the search index generation process executed by the
検索インデックス生成処理が開始すると、再配置データ生成部121は、データ記憶部110に記憶された辞書データを読み出す(ステップS1)。そして、再配置データ生成部121は、読み出した辞書データから見出し語テキスト、説明テキスト及び用例テキストを抽出する(ステップS2)。
When the search index generation process starts, the relocation
再配置データ生成部121は、抽出した見出し語テキストのそれぞれの先頭と末尾とに、区切り文字を付加する(ステップS3)。区切り文字は、見出し語の区切りを示すためのマークとして機能する文字である。区切り文字として、例えばスペース又は特殊文字等、見出し語テキストに現れない文字が用いられる。
The rearrangement
見出し語テキストに区切り文字を付加すると、再配置データ生成部121は、見出し語毎に説明テキストと用例テキストとをまとめた、図4右側に示したような再配置データを生成し、データ記憶部110へ保存する(ステップS4)。
When a delimiter is added to the headword text, the rearrangement
次に、検索インデックス生成部122は、再配置データ生成部121によって生成された再配置データから検索インデックスを生成する(ステップS5)。具体的に説明すると、検索インデックス生成部122は、再配置データにおける見出し部、説明部及び用例部のそれぞれについて、先頭から1文字ずつずらしながらモノグラム及びバイグラムを抽出し、抽出したモノグラム及びバイグラムの出現位置と出現頻度とを導出する。そして、検索インデックス生成部122は、抽出したモノグラム及びバイグラムのそれぞれについてその出現位置と出現頻度とを対応付けることによって、図5及び図6に示すような検索インデックスを生成し、データ記憶部110に記憶する。以上により、図10における検索インデックス生成処理は終了する。
Next, the search
次に、図11から図17に示すフローチャートを参照して、検索部140によって実行される検索処理の流れを説明する。上述したように、検索部140は、検索処理として、インクリメンタル検索処理、全文検索処理、及び曖昧検索処理を実行する。
Next, the flow of a search process executed by the
第1に、図11を参照して、インクリメンタル検索処理の流れを説明する。ユーザがキーボード100iを操作して対象辞書を指定した上で検索キーワードを1文字ずつ入力する度に、インクリメンタル検索部141は、図11に示すインクリメンタル検索処理を開始する。以下、検索キーワードとして「whi」との文字列が入力された場合を例にとって、説明する。
First, the flow of the incremental search process will be described with reference to FIG. Each time the user operates the
インクリメンタル検索処理が開始すると、インクリメンタル検索部141は、検索キーワードとして入力された入力文字列から、検索文字列を生成する(ステップS11)。具体的に説明すると、インクリメンタル検索部141は、入力文字列の先頭に区切り文字を付加することによって、検索文字列を生成する。例えば区切り文字を「・」と表した場合、インクリメンタル検索部141は、検索キーワード「whi」の先頭に「・」を付加することによって、「・whi」との検索文字列を生成する。
When the incremental search process starts, the
検索文字列を生成すると、インクリメンタル検索部141は、検索文字列からバイグラムを抽出する(ステップS12)。具体的に説明すると、インクリメンタル検索部141は、検索文字列「・whi」の先頭から末尾まで順に2文字ずつ切り出していき、「・w」、「wh」、「hi」の3個のバイグラムを抽出する。そして、インクリメンタル検索部141は、検索文字列を基準文字列と設定する(ステップS13)。
After generating the search character string, the
バイグラムを抽出すると、インクリメンタル検索部141は、見出し部インデックス(図5に示した(1)pattern_hdl.idx及び(2)position_hdl.idx)を参照して、基準文字列から抽出した各バイグラムの出現位置を読み込んで、その連続性を評価する(ステップS14)。具体的に説明すると、インクリメンタル検索部141は、抽出した3個のバイグラム「・w」、「wh」、「hi」が、見出し語テキストにおいてこの順番で1文字ずつずれた位置に出現するかを判定する。
When the bigram is extracted, the
評価の結果、連続性が無いと判定した場合は(ステップS15;NO)、インクリメンタル検索部141は、ステップS14において、見出し部インデックスから読み込んだ他の出現位置について同様に連続性を評価する。
As a result of the evaluation, when it is determined that there is no continuity (step S15; NO), the
これに対して、連続性有りと判定した場合(ステップS15;YES)、インクリメンタル検索部141は、先頭のバイグラムの出現位置を基準文字列の出現位置と判定する(ステップS16)。そして、インクリメンタル検索部141は、検索インデックスの見出し番号に関するファイルと見出し部の開始位置に関するファイル(図6に示した(7)number.idx及び(8)headline.idx)とを参照して、基準文字列の出現位置から検索結果として辞書番号及び見出し番号を導出する(ステップS17)。そして、評価部150は、検索結果に対する順位付け評価値を算出する(ステップS18)。
On the other hand, if it is determined that there is continuity (step S15; YES), the
次に、インクリメンタル検索部141は、未評価の出現位置が存在するかを判定し(ステップS19)、存在すると判定した場合には(ステップS19;YES)、ステップS14に戻る。一方、未評価の出現位置が存在しないと判定した場合には(ステップS19;NO)、出力部160は、順位付け評価値に基づいて、検索結果を並べる(ステップS20)。そして、出力部160は、検索結果を見出し語単位で表示部170に出力する(ステップS21)。出力部160は、例えば図7に示した表示画面を表示部170に表示する。これにより、インクリメンタル検索処理は終了する。
Next, the
第2に、図12から図16に示すフローチャートを参照して、全文検索処理の流れを説明する。ユーザがキーボード100iを操作して対象辞書を指定した上で検索キーワードを確定させると、全文検索部142は、図12から図16に示す全文検索処理を開始する。
Second, the flow of the full-text search process will be described with reference to the flowcharts shown in FIGS. When the user operates the
全文検索処理が開始すると、全文検索部142は、検索キーワードとして入力された入力文字列から、検索文字列を生成する(ステップS31)。具体的に説明すると、全文検索部142は、入力文字列の両端に区切り文字を付加することによって、検索文字列を生成する。例えば検索キーワードとして「while」との文字列が入力された場合、全文検索部142は、検索キーワード「while」の先頭と末尾とに「・」を付加することによって、「・while・」との検索文字列を生成する。
When the full-text search process starts, the full-
検索文字列を生成すると、全文検索部142は、検索文字列の個数が1個であるかを判定する(ステップS32)。言い換えると、全文検索部142は、現在の検索が複数の検索キーワードによるAND検索であるか否かを判定する。全文検索部142は、検索文字列の数が1個である場合は(ステップS32;YES)、処理をステップS33に進め、一方、検索文字列の数が複数である場合は(ステップS32;NO)、処理をステップS35に進める。
After generating the search character string, the full-
検索文字列が1個の場合には(ステップS32;YES)、全文検索部142は、検索文字列からモノグラム及びバイグラムを抽出する(ステップS33)。具体的に説明すると、検索文字列が3文字の文字列(・+1文字の入力文字列+・)である場合には、全文検索部142は、1文字の入力文字列に相当する1個のモノグラムと、両端の区切り文字を含む2個のバイグラムと、を抽出する。一方、検索文字列が4文字以上の文字列(・+2文字以上の入力文字列+・)である場合には、全文検索部142は、検索文字列の先頭から末尾まで順にバイグラムを抽出する。例えば、検索文字列「・while・」からは「・w」、「wh」、「hi」、「il」、「le」、「e・」の6個のバイグラムが抽出される。
When there is only one search character string (step S32; YES), the full-
次に、全文検索部142は、検索文字列を基準文字列と設定する(ステップS34)。そして、全文検索部142は、見出し部、説明部及び用例部の順で、すなわちカテゴリ毎に、抽出したバイグラムの連続性を評価する処理に移行する。
Next, the full-
図13に移って、全文検索部142は、基準文字列の文字数が3文字であるかを判定する(ステップS51)。基準文字列の文字数が3文字であると判定した場合には(ステップS51;YES)、全文検索部142は、見出し部インデックス(図5に示した(1)pattern_hdl.idx及び(2)position_hdl.idx)を参照して、基準文字列から抽出した1個のモノグラムの出現位置を読み込んで、これを基準文字列の出現位置と特定する(ステップS52)。
Referring to FIG. 13, the full-
基準文字列の出現位置を特定すると、全文検索部142は、検索状態を導出する(ステップS53)。検索状態とは、検索キーワードが見出し語そのものであるか否かを示す情報である。具体的に説明すると、全文検索部142は、見出し部インデックスから、区切り文字を含む2個のバイグラムの出現位置を読み込んで、その連続性を評価する。連続性が有る場合、検索キーワードが見出し語そのものであるとの検索状態を導出する。
When the appearance position of the reference character string is specified, the full-
一方、ステップS51において、基準文字列の文字数が4文字以上であると判定した場合には(ステップS51;No)、全文検索部142は、見出し部インデックスを参照して、基準文字列から抽出したバイグラムのうちの区切り文字を含まないバイグラムの出現位置を読み込んで、その連続性を評価する(ステップS54)。評価の結果、連続性が無いと判定した場合は(ステップS55;NO)、全文検索部142は、ステップS54において、見出し部インデックスから読み込んだ他の出現位置について同様に連続性を評価する。
On the other hand, when it is determined in step S51 that the number of characters of the reference character string is four or more (step S51; No), the full-
これに対して、連続性が有ると判定した場合(ステップS55;YES)、全文検索部142は、2番目のバイグラムの出現位置を、基準文字列の出現位置と判定する(ステップS56)。そして、全文検索部142は、見出し部インデックスから、区切り文字を含む2個のバイグラムの出現位置を読み込んで、その連続性を評価することで、検索状態を導出する(ステップS57)。
On the other hand, when it is determined that there is continuity (step S55; YES), the full-
ステップS53又はステップS57において検索状態を導出すると、全文検索部142は、検索インデックスの見出し番号に関するファイル((7)number.idx)と見出し部の開始位置に関するファイル((8)headline.idx)とを参照して、基準文字列の出現位置から検索結果として辞書番号、見出し番号及び用例番号を導出する(ステップS58)。そして、評価部150は、検索結果に対する順位付け評価値を算出する(ステップS59)。
When the search state is derived in step S53 or step S57, the full-
次に、全文検索部142は、未評価の出現位置が存在するかを判定し(ステップS60)、未評価の出現位置が存在する場合は(ステップS60;YES)、ステップS51に戻る。一方、未評価の出現位置が存在しない場合は(ステップS60;NO)、全文検索部142は、未評価のカテゴリが存在するかを判定する(ステップS61)。未評価のカテゴリが存在する場合は(ステップS61;YES)、全文検索部142は、ステップS51に戻り、説明部及び用例部の順に未評価のカテゴリについて同様の処理を実行する。
Next, the full-
最終的に、未評価のカテゴリが存在しないと判定した場合は(ステップS61;NO)、出力部160は、順位付け評価値に基づいて、検索結果を並べ替える(ステップS62)。そして、出力部160は、検索結果を表示部170に出力する(ステップS63)。このとき、出力部160は、図8に示したように、見出し部、説明部及び用例部からの検索結果を、それぞれ見出し語単位、説明部単位及び用例部単位で表示部170に表示する。以上により、検索文字列の数が1個である場合の全文検索処理は終了する。
Finally, when it is determined that there is no category that has not been evaluated (step S61; NO), the
図12に戻って、ステップS32において、全文検索部142は、検索文字列の数が複数である場合には(ステップS32;NO)、各検索文字列からモノグラム及びバイグラムを抽出する(ステップS35)。言い換えると、全文検索部142は、複数の検索文字列のそれぞれについて、ステップS32と同様の処理を実行する。
Returning to FIG. 12, in step S32, when the number of search character strings is plural (step S32; NO), the full-
次に、全文検索部142は、見出し部インデックス、説明部インデックス及び用例部インデックスを参照して、抽出したモノグラム及びバイグラムのそれぞれの出現頻度を抽出する(ステップS36)。そして、全文検索部142は、各検索文字列を構成するモノグラム及びバイグラムの中で最小出現頻度を特定する(ステップS37)。
Next, the full-
最小出現頻度を特定すると、全文検索部142は、複数の検索文字列から基準文字列と検証文字列とを決定する(ステップS38)。具体的に説明すると、全文検索部142は、最小出現頻度のモノグラム又はバイグラムを含む1個の検索文字列を基準文字列と決定し、それ以外の少なくとも1個の検索文字列を検証文字列と設定する。これは、AND検索において、出現頻度が低い検索文字列を基準にして検索した方が、処理負荷を下げ、検索速度を上げることができるからである。或いは、検索文字列の入力順を考慮した検索の場合には、全文検索部142は、最初に入力した検索文字列を基準文字列と決定し、2番目以降に入力した検索文字列を検証文字列と決定しても良い。
After specifying the minimum appearance frequency, the full-
その後、全文検索部142は、見出し部、説明部及び用例部の順で、すなわちカテゴリ毎に、抽出したバイグラムの連続性を評価する処理に移行する。
Thereafter, the full-
図14に移って、全文検索部142は、基準文字列の文字数が3文字であるかを判定する(ステップS71)。以降、全文検索部142は、基準文字列の出現位置を特定し、その検索状態を導出する(ステップS71からステップS77)。ステップS71からステップS77の処理は、検索文字列の数が1個の場合において説明したステップS51からステップS57の処理と同じであるため、説明を省略する。
Referring to FIG. 14, the full-
基準文字列の出現位置を特定し、その検索状態を導出すると、全文検索部142は、検索インデックスの見出し番号に関するファイル((7)number.idx)と見出し部の開始位置に関するファイル((8)headline.idx)とを参照して、基準文字列の出現位置から検索結果候補として辞書番号、見出し番号及び用例番号を導出する(ステップS78)。
When the appearance position of the reference character string is specified and its search state is derived, the full-
このように基準文字列の評価処理を終了すると、全文検索部142は、図15に移り、検証文字列の評価処理を実行する。図15において、全文検索部142は、検証文字列の文字数が3文字であるかを判定する(ステップS81)。
When the evaluation processing of the reference character string ends in this way, the full
検証文字列の文字数が3文字であると判定した場合には(ステップS81;YES)、全文検索部142は、見出し部インデックスから、抽出した1個のモノグラムの出現位置を読み込んで、これを検証文字列の出現位置と特定する(ステップS82)。そして、全文検索部142は、見出し部インデックスから、区切り文字を含む2個のバイグラムの出現位置を読み込んで、その連続性を評価することで、検索状態を導出する(ステップS83)。
When it is determined that the number of characters of the verification character string is three (step S81; YES), the full-
検索状態を導出すると、全文検索部142は、ステップS78において導出された検索結果候補の辞書番号、見出し番号及び用例番号によって指定される範囲内に検証文字列が存在するかを評価する(ステップS84)。この範囲は、基準文字列と検証文字列とがAND検索としてヒットする範囲である。例えば、基準文字列と検証文字列とがどちらも同じ辞書データにおける同じ見出し語の構成単位(説明部及び用例部を含む)に存在する場合に、AND検索がヒットするように設定する。或いは、基準文字列と検証文字列とがどちらも同じ用例部に存在する場合に、AND検索がヒットするように設定することもできる。
When the search state is derived, the full-
評価の結果、検証文字列の出現位置が指定範囲の最小位置以上で無いと判定した場合には(ステップS85;NO)、全文検索部142は、処理をステップS82に戻す。一方、検証文字列の出現位置が最小位置以上であると判定した場合には(ステップS85;YES)、全文検索部142は、検証文字列の出現位置が指定範囲内の最大位置以下であるかを評価する(ステップS86)。検証文字列の出現位置が最大位置以下でないと判定した場合は(ステップS86;NO)、全文検索部142は、処理を図16のステップS103に移す。一方、検証文字列の出現位置が最大位置以下であると判定した場合は(ステップS86;YES)、全文検索部142は、処理をステップS94に移す。
As a result of the evaluation, when it is determined that the appearance position of the verification character string is not more than the minimum position of the specified range (Step S85; NO), the full-
ステップS81において、検証文字列が4文字以上であると判定した場合には(ステップS81;NO)、全文検索部142は、見出し部インデックスから、検証文字列から抽出したバイグラムのうちの2番目のバイグラムの出現位置を読み込んで、これを検証文字列の出現位置と特定する(ステップS87)。
If it is determined in step S81 that the verification character string has four or more characters (step S81; NO), the full-
検証文字列の出現位置を特定すると、全文検索部142は、ステップS78において導出された検索結果候補の辞書番号、見出し番号及び用例番号によって指定される範囲内に検証文字列が存在するかを評価する(ステップS88)。
When the appearance position of the verification character string is specified, the full-
評価の結果、検証文字列の出現位置が指定範囲の最小位置以上で無いと判定した場合には(ステップS89;NO)、全文検索部142は、処理をステップS87に戻す。一方、検証文字列の出現位置が最小位置以上であると判定した場合には(ステップS89;YES)、全文検索部142は、検証文字列の出現位置が指定範囲内の最大位置以下であるかを評価する(ステップS90)。検証文字列の出現位置が最大位置以下でないと判定した場合は(ステップS90;NO)、全文検索部142は、処理を図16のステップS103に移す。
As a result of the evaluation, when it is determined that the appearance position of the verification character string is not greater than or equal to the minimum position of the specified range (Step S89; NO), the full-
一方、検証文字列の出現位置が最大位置以下であると判定した場合は(ステップS90;YES)、全文検索部142は、見出し部インデックスから、検証文字列から抽出したバイグラムのうちの区切り文字を含まないバイグラムの出現位置を読み込んで、その連続性を評価する(ステップS91)。評価の結果、連続性が無いと判定した場合は(ステップS92;NO)、全文検索部142は、処理をステップS87に戻し、2番目のバイグラムの他の出現位置について同様の処理を実行する。
On the other hand, if it is determined that the appearance position of the verification character string is equal to or less than the maximum position (step S90; YES), the full-
これに対して、連続性が有ると判定した場合(ステップS92;YES)、全文検索部142は、見出し部インデックスから、区切り文字を含むバイグラムの出現位置を読み込んで、その連続性を評価することで、検証状態を導出する(ステップS93)。そして、全文検索部142は、処理をステップS94に移す。
On the other hand, when it is determined that there is continuity (step S92; YES), the full-
ステップS94において、全文検索部142は、全ての検証文字列について評価を完了したかを判定する(ステップS94)。全ての検証文字列について評価を完了していないと判定した場合には(ステップS94;NO)、処理をステップS81に戻し、全ての検証文字列について同様の処理を実行する。
In step S94, the full-
一方、全ての検証文字列について評価を完了したと判定した場合には(ステップS94;YES)、全文検索部142は、図16に移り、以上の処理で得られた検索結果候補をAND検索の検索結果と決定する(ステップS101)。言い換えると、全文検索部142は、指定範囲内に存在する1個の基準文字列の出現位置と少なくとも1個の検証文字列の出現位置とを、AND検索でヒットした位置と決定する。評価部150は、このAND検索の検索結果に対する順位付け評価値を算出する(ステップS102)。
On the other hand, when it is determined that the evaluation has been completed for all the verification character strings (step S94; YES), the full-
次に、全文検索部142は、未評価の出現位置が存在するかを判定し(ステップS103)、未評価の出現位置が存在すると判定した場合には(ステップS103;YES)、処理を図14に示したステップS71に戻す。一方、全文検索部142は、未評価の出現位置が存在しないと判定した場合には(ステップS103;NO)、未評価のカテゴリが存在するかを判定する(ステップS104)。未評価のカテゴリが存在する場合は(ステップS104;YES)、全文検索部142は、ステップS71に戻り、説明部及び用例部の順に未評価のカテゴリについて同様の処理を実行する。
Next, the full-
最終的に、未評価のカテゴリが存在しないと判定した場合は(ステップS104;NO)、出力部160は、順位付け評価値に基づいて、カテゴリ別に検索結果を並べ替える(ステップS105)。そして、出力部160は、検索結果を表示部170に出力する(ステップS106)。このとき、出力部160は、図8に示したように、見出し部、説明部及び用例部からの検索結果を、それぞれ見出し語単位、説明部単位及び用例部単位で表示部170に表示する。以上により、検索文字列の数が複数である場合の全文検索処理は終了する。
Finally, when it is determined that there is no unrated category (step S104; NO), the
第3に、図17に示すフローチャートを参照して、曖昧検索処理の流れを説明する。ユーザがキーボード100iを操作して検索キーワードを入力し、曖昧検索モードを選択した場合に、曖昧検索部143は、図17に示す曖昧検索処理を開始する。
Third, the flow of the fuzzy search process will be described with reference to the flowchart shown in FIG. When the user operates the
曖昧検索処理が開始すると、曖昧検索部143は、検索キーワードとして入力された入力文字列から、検索文字列を生成する(ステップS121)。具体的に説明すると、曖昧検索部143は、入力文字列の両端に区切り文字を付加することによって、検索文字列を生成する。例えば検索キーワードとして「salaed」との文字列が入力された場合、曖昧検索部143は、検索キーワード「salaed」の先頭と末尾とに「・」を付加することによって、「・salaed・」との検索文字列を生成する。
When the fuzzy search process starts, the
検索文字列を生成すると、曖昧検索部143は、検索文字列からモノグラム及びバイグラムを抽出する(ステップS122)。具体的に説明すると、曖昧検索部143は、検証文字列がM文字であるとすると、検証文字列から、両端の区切り文字をそれぞれ含む2個のバイグラムと、区切り文字を含まない(M−2)個のモノグラムを抽出する。例えば、検索文字列「・salaed・」からは、両端の「・s」、「d・」の2個のバイグラムと、中央の「s」、「a」、「l」、「a」、「e」、「d」の6個のモノグラムと、が抽出される。
After generating the search character string, the
次に、曖昧検索部143は、検証文字列を基準文字列と設定する(ステップS123)。基準文字列を設定すると、曖昧検索部143は、辞書データに含まれる見出し語毎に、抽出したモノグラム及びバイグラムの連続性を評価する処理に移る。
Next, the
まず、曖昧検索部143は、辞書データに含まれる複数の見出し語のうちの第1の見出し語を選択し、その見出し語の出現範囲を導出する(ステップS124)。具体的に説明すると、曖昧検索部143は、検索インデックスの見出し番号に関するファイルと見出し部の開始位置に関するファイル(図6に示した(7)number.idx及び(8)headline.idx)とを参照して、辞書データ内において見出し語が出現する範囲を特定する。
First, the
見出し語の出現範囲を導出すると、曖昧検索部143は、見出し部インデックス(図5に示した(1)pattern_hdl.idx及び(2)position_hdl.idx)を参照して、基準文字列から抽出した各モノグラム及びバイグラムの出現位置を読み込む(ステップS125)。
After deriving the appearance range of the headword, the
出現位置を読み込むと、曖昧検索部143は、ステップS124で導出した見出し語テキストの出現範囲内に存在する各モノグラム及びバイグラムの出現位置を基準として、連続合致Nグラム数を算出する(ステップS126)。具体的に説明すると、例えば検索文字列が「・salaed・」である場合、曖昧検索部143は、この検索文字列を構成する「・s」、「s」、「a」、「l」、「a」、「e」、「d」、「d・」の8個のモノグラム又はバイグラムが、見出し語テキストにおいてこの順番で1文字ずつずれて出現するかを判定する。そして、曖昧検索部143は、出現位置が連続して出現するモノグラム及びバイグラムの数を、連続合致Nグラム数として算出する。
When the appearance position is read, the
連続合致Nグラム数を算出すると、曖昧検索部143は、算出した連続合致Nグラム数に基づいて、連続合致Nグラム数の頻度分布を生成する(ステップS127)。そして、曖昧検索部143は、生成した頻度分布から曖昧検索評価値を算出する(ステップS128)。曖昧検索評価値の算出方法は、上記特許文献2によって開示された方法を用いることができる。具体的に説明すると、曖昧検索部143は、生成した頻度分布を参照して、連続合致Nグラム数が多いほど大きな値を曖昧検索評価値として算出する。また、曖昧検索部143は、曖昧検索評価値として、連続合致するNグラムの出現頻度が高いほど大きな値を曖昧検索評価値として算出する。
After calculating the number of consecutive matching N-grams, the
次に、評価部150は、順位付け評価値を算出する(ステップS129)。そして、曖昧検索部143は、未評価の見出し語が存在するかを判定する(ステップS130)。未評価の見出し語が存在すると判定した場合には(ステップS130;YES)、曖昧検索部143は、処理をステップS124に戻し、未評価の見出し語について同様の処理を実行する。
Next, the
最終的に、未評価の見出し語が存在しないと判定した場合は(ステップS130;NO)、出力部160は、曖昧検索評価値及び順位付け評価値に基づいて、検索結果を並べ替える(ステップS131)。そして、出力部160は、例えば図9に示したように、検索結果を表示部170に出力する(ステップS132)。以上により、曖昧検索処理は終了する。
Finally, when it is determined that there is no unevaluated headword (step S130; NO), the
以上に説明したように、本実施形態に係る検索装置100は、検索対象の電子文書である辞書データに含まれる複数のNグラムとその出現位置とを対応付けた検索インデックスを、辞書データのうちの見出し語カテゴリに属するテキストと本文カテゴリに属するテキストとに分けて生成する。そして、検索装置100は、辞書データ内の見出し語テキストのみを対象とするインクリメンタル検索及び曖昧検索の際には、見出し部インデックスのみを参照して検索キーワードを検索し、辞書データ全体を対象とする全文検索の際には、検索インデックス全体を参照して検索キーワードを検索する。
As described above, the
言い換えると、検索装置100は、Nグラムの出現位置をカテゴリ毎に集計してインデックスを生成し、インクリメンタル検索及び曖昧検索の際には、辞書データ全体ではなく、見出し語カテゴリ単位で生成された、データサイズの小さいインデックスを用いて検索する。これにより、インクリメンタル検索及び曖昧検索の際の検索効率が向上するため、検索時間を短縮することができ、所望の電子文書を効率良く探し出すことができる。
In other words, the
特に、インクリメンタル検索は、検索キーワードが1文字ずつ入力される毎に実行されるため、インクリメンタル検索による検索時間を短縮することで、全文検索を含めた検索処理全体の処理時間を大きく短縮することができる。また、曖昧検索は、処理時間が比較的大きい検索であるため、検索時間を短縮することによる効果が大きい。 In particular, since the incremental search is executed every time a search keyword is input one character at a time, by shortening the search time by the incremental search, it is possible to greatly reduce the processing time of the entire search process including the full-text search. it can. Further, since the ambiguous search is a search having a relatively long processing time, the effect of reducing the search time is great.
(変形例)
以上に本発明の実施形態について説明したが、上記実施形態は一例であり、本発明の適用範囲はこれに限られない。すなわち、本発明の実施形態は種々の応用が可能であり、あらゆる実施の形態が本発明の範囲に含まれる。
(Modification)
Although the embodiment of the present invention has been described above, the above embodiment is an example, and the scope of the present invention is not limited to this. That is, the embodiments of the present invention can be applied in various ways, and all embodiments are included in the scope of the present invention.
例えば、上記実施形態では、検索装置100は、検索インデックスを生成する生成部120を備えていた。しかしながら、本発明において、検索装置100は、検索インデックスを生成する機能を備えていなくても良い。予め外部装置が生成した検索インデックスを取得し、取得した検索キーワードをデータ記憶部110に記憶しておけば、検索装置100は、上述した検索処理を実行することができる。例えば、工場出荷時において、検索装置100に搭載される複数の辞書データのそれぞれに対応する検索インデックスをデータ記憶部110に記憶するとしても良い。
For example, in the above-described embodiment, the
上記実施形態では、検索対象の電子文書として辞書データを例にとって説明した。しかしながら、検索対象の電子文書は、辞書に限定される訳ではなく、複数のカテゴリに分類されたテキストを含む文書であれば、どのような文書でも良い。例えば、検索対象の電子文書は、「発明の名称」及び「特許請求の範囲」等のカテゴリにそれぞれ分類されたテキストを含む特許明細書であっても良い。或いは、検索対象の電子文書は、ある製品が有する機能の名称を表すテキストが分類されるカテゴリ(機能名カテゴリ)と、当該機能を利用するための操作方法を表すテキストが分類されるカテゴリ(操作方法カテゴリ)とを含む説明書であっても良い。 In the above embodiment, dictionary data has been described as an example of an electronic document to be searched. However, the electronic document to be searched is not limited to a dictionary, and may be any document including text classified into a plurality of categories. For example, the electronic document to be searched may be a patent specification including texts classified into categories such as "Title of Invention" and "Claims". Alternatively, in the electronic document to be searched, a category (function name category) into which a text representing a name of a function of a certain product is classified and a category (operation) into which a text representing an operation method for using the function is classified (Method category).
上記実施形態では、検索装置100は、第1の検索手段としてインクリメンタル検索部141と曖昧検索部143とを備え、第2の検索手段として全文検索部142を備えていた。しかしながら、本発明において、検索装置100は、第1の検索手段として、インクリメンタル検索又は曖昧検索のどちらか一方のみ備えていても良い。或いは、検索装置100は、第1の検索手段又は第2の検索手段として、これらの検索に限らず、他の種類の検索機能を備えていても良い。また、インクリメンタル検索(前方一致検索)、全文検索(完全一致検索)、及び曖昧検索(部分一致検索)における具体的な方法、特に順位付けの方法については、任意に設定可能である。また、上記実施形態では、Nグラムとしてモノグラム及びバイグラムを用いたが、例えばトライグラム等、他のNグラムを用いても良い。
In the above-described embodiment, the
上記実施形態では、検索装置100において、CPU100aがROM100bに記憶されたプログラムを実行することによって、生成部120、取得部130、検索部140、評価部150及び出力部160のそれぞれとして機能した。しかしながら、本発明において、検索装置100は、CPU100aの代わりに、例えばASIC(Application Specific Integrated Circuit)、FPGA(Field-Programmable Gate Array)、又は、各種制御回路等の専用のハードウェアを備え、専用のハードウェアが、生成部120、取得部130、検索部140、評価部150及び出力部160のそれぞれとして機能してもよい。この場合、各部の機能それぞれを個別のハードウェアで実現してもよいし、各部の機能をまとめて単一のハードウェアで実現してもよい。また、各部の機能のうち、一部を専用のハードウェアによって実現し、他の一部をソフトウェア又はファームウェアによって実現してもよい。
In the above embodiment, in the
なお、本発明に係る機能を実現するための構成を予め備えた検索装置として提供できることはもとより、プログラムの適用により、既存のパーソナルコンピュータや情報端末機器を、本発明に係る検索装置として機能させることもできる。すなわち、上記実施形態で説明した検索装置100による各機能構成を実現させるためのテキスト検索プログラムを、既存のパーソナルコンピュータや情報端末機器等を制御するCPU等が実行できるように適用することで、本発明に係る検索装置100として機能させることができる。また、本発明に係る検索方法は、検索装置100を用いて実施することができる。
It should be noted that the present invention can be provided not only as a search device having a configuration for realizing the function according to the present invention but also as a search device according to the present invention by applying a program to an existing personal computer or information terminal device. You can also. That is, by applying a text search program for realizing each functional configuration by the
また、このようなプログラムの適用方法は任意である。プログラムを、例えば、コンピュータが読取可能な記録媒体(CD−ROM(Compact Disc Read-Only Memory)、DVD(Digital Versatile Disc)、MO(Magneto Optical disc)等)に格納して適用できる他、インターネット等のネットワーク上のストレージにプログラムを格納しておき、これをダウンロードさせることにより適用することもできる。また、辞書データ、再配置データ及び検索インデックス等の上記処理に必要なデータの一部又は全部を外部サーバに記憶し、通信機能を用いてこれらのデータを取得して上記処理を実行する構成も可能である。 The method of applying such a program is arbitrary. The program can be stored in a computer-readable recording medium (Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD), Magneto Optical disc (MO), etc.), and applied, for example, to the Internet, etc. It is also possible to store the program in a storage on the network and download the program to apply. Further, a configuration is also possible in which part or all of the data required for the above processing such as dictionary data, relocation data, and search index is stored in an external server, and these data are obtained using a communication function to execute the above processing. It is possible.
以上、本発明の好ましい実施形態について説明したが、本発明は係る特定の実施形態に限定されるものではなく、本発明には、特許請求の範囲に記載された発明とその均等の範囲とが含まれる。以下に、本願出願の当初の特許請求の範囲に記載された発明を付記する。 As described above, the preferred embodiments of the present invention have been described, but the present invention is not limited to the specific embodiments, and the present invention includes the invention described in the claims and the equivalents thereof. included. Hereinafter, the invention described in the claims of the present application is additionally described.
(付記1)
検索対象の電子文書のうちの第1のカテゴリに属するテキストに含まれる複数のNグラムと、前記第1のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第1のインデックス、及び、前記電子文書のうちの第2のカテゴリに属するテキストに含まれる複数のNグラムと、前記第2のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第2のインデックスを記憶する記憶手段と、
検索キーワードを取得する取得手段と、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記第1のカテゴリに属するテキストから前記検索キーワードを検索する第1の検索手段と、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックス及び前記第2のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記電子文書から前記検索キーワードを検索する第2の検索手段と、
少なくとも前記第1の検索手段と前記第2の検索手段の一方による検索結果を出力する出力手段と、
を備えることを特徴とする検索装置。
(Appendix 1)
A first N-gram in which a plurality of N-grams included in the text belonging to the first category in the electronic document to be searched are associated with the appearance positions of the plurality of N-grams in the text belonging to the first category; An index, and a plurality of N-grams included in the text belonging to the second category of the electronic document, and an appearance position of the plurality of N-grams in the text belonging to the second category. Storage means for storing the second index;
Acquisition means for acquiring a search keyword;
The search keywords are retrieved from the text belonging to the first category by reading the appearance positions of the plurality of N-grams included in the search keywords from the first index and evaluating the continuity of the read appearance positions. First search means;
The search keywords are retrieved from the electronic document by reading the appearance positions of a plurality of N-grams included in the search keywords from the first index and the second index and evaluating the continuity of the read appearance positions. Second search means for performing
Output means for outputting a search result by at least one of the first search means and the second search means;
A search device comprising:
(付記2)
前記取得手段は、前記検索キーワードを1文字ずつ取得し、
前記第1の検索手段は、前記取得手段によって前記検索キーワードが1文字ずつ取得される度に、前記取得手段によって既に取得された少なくとも1文字に新たに取得された1文字を加えた文字列を前記検索キーワードとして検索する、
ことを特徴とする付記1に記載の検索装置。
(Appendix 2)
The acquiring means acquires the search keyword one character at a time,
The first search means, every time the search keyword is obtained one character at a time by the obtaining means, outputs a character string obtained by adding at least one character newly obtained to the at least one character already obtained by the obtaining means. Search as the search keyword,
3. The search device according to
(付記3)
前記第1の検索手段は、前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックスから読み出し、読み出した出現位置が、前記検索キーワードにおける前記複数のNグラムの位置と連続して合致する数に基づいて、前記第1のカテゴリに属するテキストから前記検索キーワードを検索する、
ことを特徴とする付記1又は2に記載の検索装置。
(Appendix 3)
The first search means reads out appearance positions of a plurality of N-grams included in the search keyword from the first index, and the read out appearance position is continuous with positions of the plurality of N-grams in the search keyword. Searching for the search keyword from texts belonging to the first category based on the number of matches.
3. The search device according to
(付記4)
前記第1の検索手段は、前記第1のインデックスを参照して、前記第1のカテゴリに属するテキストから前記検索キーワードで始まる文字列を検索し、
前記第2の検索手段は、前記第1のインデックス及び前記第2のインデックスを参照して、前記電子文書から前記検索キーワードを含む文字列を検索する、
ことを特徴とする付記1から3のいずれか1つに記載の検索装置。
(Appendix 4)
The first search means searches the text belonging to the first category for a character string starting with the search keyword with reference to the first index,
The second search means searches the electronic document for a character string including the search keyword with reference to the first index and the second index;
4. The search device according to any one of
(付記5)
前記第1のカテゴリに属するテキストに含まれる複数のNグラムと、前記第1のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けることによって、前記第1のインデックスを生成し、前記第2のカテゴリに属するテキストに含まれる複数のNグラムと、前記第2のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けることによって、前記第2のインデックスを生成する生成手段、を更に備え、
前記記憶手段は、前記生成手段によって生成された前記第1のインデックス及び前記第2のインデックスを記憶する、
ことを特徴とする付記1から4のいずれか1つに記載の検索装置。
(Appendix 5)
Generating the first index by associating the plurality of N-grams included in the text belonging to the first category with the appearance positions of the plurality of N-grams in the text belonging to the first category; Generating the second index by associating a plurality of N-grams included in the text belonging to the second category with the appearance positions of the plurality of N-grams in the text belonging to the second category Means, further comprising:
The storage unit stores the first index and the second index generated by the generation unit,
5. The search device according to any one of
(付記6)
前記電子文書は、辞書データであり、
前記第1のカテゴリに属するテキストは、前記辞書データにおける見出し語を表すテキストであり、
前記第2のカテゴリに属するテキストは、前記見出し語の説明又は用例を表すテキストである、
ことを特徴とする付記1から5のいずれか1つに記載の検索装置。
(Appendix 6)
The electronic document is dictionary data,
The text belonging to the first category is a text representing a headword in the dictionary data,
The text belonging to the second category is text representing an explanation or an example of the headword,
6. The search device according to any one of
(付記7)
検索対象の電子文書のうちの第1のカテゴリに属するテキストに含まれる複数のNグラムと、前記第1のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第1のインデックス、及び、前記電子文書のうちの第2のカテゴリに属するテキストに含まれる複数のNグラムと、前記第2のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第2のインデックスを取得するインデックス取得ステップと、
検索キーワードを取得する検索キーワード取得ステップと、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記第1のカテゴリに属するテキストから前記検索キーワードを検索する第1の検索ステップと、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックス及び前記第2のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記電子文書から前記検索キーワードを検索する第2の検索ステップと、
少なくとも前記第1の検索ステップと前記第2の検索ステップの一方による検索結果を出力する出力ステップと、
を含む検索方法。
(Appendix 7)
A first N-gram in which a plurality of N-grams included in the text belonging to the first category in the electronic document to be searched are associated with the appearance positions of the plurality of N-grams in the text belonging to the first category; An index, and a plurality of N-grams included in the text belonging to the second category of the electronic document, and an appearance position of the plurality of N-grams in the text belonging to the second category. An index obtaining step of obtaining an index of 2;
A search keyword obtaining step for obtaining a search keyword;
The search keywords are retrieved from the text belonging to the first category by reading the appearance positions of the plurality of N-grams included in the search keywords from the first index and evaluating the continuity of the read appearance positions. A first search step;
The search keywords are retrieved from the electronic document by reading the appearance positions of a plurality of N-grams included in the search keywords from the first index and the second index and evaluating the continuity of the read appearance positions. A second search step,
An output step of outputting a search result by at least one of the first search step and the second search step;
Search method including.
(付記8)
コンピュータを、
検索対象の電子文書のうちの第1のカテゴリに属するテキストに含まれる複数のNグラムと、前記第1のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第1のインデックス、及び、前記電子文書のうちの第2のカテゴリに属するテキストに含まれる複数のNグラムと、前記第2のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第2のインデックスを取得するインデックス取得手段、
検索キーワードを取得する検索キーワード取得手段、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記第1のカテゴリに属するテキストから前記検索キーワードを検索する第1の検索手段、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックス及び前記第2のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記電子文書から前記検索キーワードを検索する第2の検索手段、
少なくとも前記第1の検索手段と前記第2の検索手段の一方による検索結果を出力する出力手段、
として機能させるためのプログラム。
(Appendix 8)
Computer
A first N-gram in which a plurality of N-grams included in the text belonging to the first category in the electronic document to be searched are associated with the appearance positions of the plurality of N-grams in the text belonging to the first category; An index, and a plurality of N-grams included in the text belonging to the second category of the electronic document, and an appearance position of the plurality of N-grams in the text belonging to the second category. Index acquisition means for acquiring the second index;
Search keyword acquisition means for acquiring a search keyword,
The search keywords are retrieved from the text belonging to the first category by reading the appearance positions of the plurality of N-grams included in the search keywords from the first index and evaluating the continuity of the read appearance positions. A first search means,
The search keywords are retrieved from the electronic document by reading the appearance positions of a plurality of N-grams included in the search keywords from the first index and the second index and evaluating the continuity of the read appearance positions. A second search means,
Output means for outputting a search result by at least one of the first search means and the second search means;
Program to function as
100…検索装置、100a…CPU、100b…ROM、100c…RAM、100d…ハードディスク、100e…メディアコントローラ、100g…ビデオカード、100h…LCD、100i…キーボード、100j…スピーカ、110…データ記憶部、120…生成部、121…再配置データ生成部、122…検索インデックス生成部、130…取得部、140…検索部、141…インクリメンタル検索部、142…全文検索部、143…曖昧検索部、150…評価部、160…出力部、170…表示部 100 search device, 100a CPU, 100b ROM, 100c RAM, 100d hard disk, 100e media controller, 100g video card, 100h LCD, 100i keyboard, 100j speaker, 110 data storage unit, 120 ... Generating unit, 121 ... Relocation data generating unit, 122 ... Search index generating unit, 130 ... Acquisition unit, 140 ... Search unit, 141 ... Incremental search unit, 142 ... Full-text search unit, 143 ... Fuzzy search unit, 150 ... Evaluation Unit, 160: output unit, 170: display unit
Claims (8)
検索キーワードを取得する取得手段と、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記第1のカテゴリに属するテキストから前記検索キーワードを検索する第1の検索手段と、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックス及び前記第2のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記電子文書から前記検索キーワードを検索する第2の検索手段と、
少なくとも前記第1の検索手段と前記第2の検索手段の一方による検索結果を出力する出力手段と、
を備えることを特徴とする検索装置。 A first N-gram in which a plurality of N-grams included in the text belonging to the first category in the electronic document to be searched are associated with the appearance positions of the plurality of N-grams in the text belonging to the first category; An index, and a plurality of N-grams included in the text belonging to the second category of the electronic document, and an appearance position of the plurality of N-grams in the text belonging to the second category. Storage means for storing the second index;
Acquisition means for acquiring a search keyword;
The search keywords are retrieved from the text belonging to the first category by reading the appearance positions of the plurality of N-grams included in the search keywords from the first index and evaluating the continuity of the read appearance positions. First search means;
The search keywords are retrieved from the electronic document by reading the appearance positions of a plurality of N-grams included in the search keywords from the first index and the second index and evaluating the continuity of the read appearance positions. Second search means for performing
Output means for outputting a search result by at least one of the first search means and the second search means;
A search device comprising:
前記第1の検索手段は、前記取得手段によって前記検索キーワードが1文字ずつ取得される度に、前記取得手段によって既に取得された少なくとも1文字に新たに取得された1文字を加えた文字列を前記検索キーワードとして検索する、
ことを特徴とする請求項1に記載の検索装置。 The acquiring means acquires the search keyword one character at a time,
The first search means, every time the search keyword is obtained one character at a time by the obtaining means, outputs a character string obtained by adding at least one character newly obtained to the at least one character already obtained by the obtaining means. Search as the search keyword,
The search device according to claim 1, wherein:
ことを特徴とする請求項1又は2に記載の検索装置。 The first search means reads out appearance positions of a plurality of N-grams included in the search keyword from the first index, and the read out appearance position is continuous with positions of the plurality of N-grams in the search keyword. Searching for the search keyword from texts belonging to the first category based on the number of matches.
The search device according to claim 1, wherein
前記第2の検索手段は、前記第1のインデックス及び前記第2のインデックスを参照して、前記電子文書から前記検索キーワードを含む文字列を検索する、
ことを特徴とする請求項1から3のいずれか1項に記載の検索装置。 The first search means searches the text belonging to the first category for a character string starting with the search keyword with reference to the first index,
The second search means searches the electronic document for a character string including the search keyword with reference to the first index and the second index;
The retrieval device according to claim 1, wherein:
前記記憶手段は、前記生成手段によって生成された前記第1のインデックス及び前記第2のインデックスを記憶する、
ことを特徴とする請求項1から4のいずれか1項に記載の検索装置。 Generating the first index by associating the plurality of N-grams included in the text belonging to the first category with the appearance positions of the plurality of N-grams in the text belonging to the first category; Generating the second index by associating a plurality of N-grams included in the text belonging to the second category with the appearance positions of the plurality of N-grams in the text belonging to the second category Means, further comprising:
The storage unit stores the first index and the second index generated by the generation unit,
The search device according to any one of claims 1 to 4, wherein:
前記第1のカテゴリに属するテキストは、前記辞書データにおける見出し語を表すテキストであり、
前記第2のカテゴリに属するテキストは、前記見出し語の説明又は用例を表すテキストである、
ことを特徴とする請求項1から5のいずれか1項に記載の検索装置。 The electronic document is dictionary data,
The text belonging to the first category is a text representing a headword in the dictionary data,
The text belonging to the second category is text representing an explanation or an example of the headword,
The search device according to any one of claims 1 to 5, wherein:
検索対象の電子文書のうちの第1のカテゴリに属するテキストに含まれる複数のNグラムと、前記第1のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第1のインデックス、及び、前記電子文書のうちの第2のカテゴリに属するテキストに含まれる複数のNグラムと、前記第2のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第2のインデックスを取得するインデックス取得ステップと、
検索キーワードを取得する検索キーワード取得ステップと、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記第1のカテゴリに属するテキストから前記検索キーワードを検索する第1の検索ステップと、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックス及び前記第2のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記電子文書から前記検索キーワードを検索する第2の検索ステップと、
少なくとも前記第1の検索ステップと前記第2の検索ステップの一方による検索結果を出力する出力ステップと、
を実行する検索方法。 Computer
A first N-gram in which a plurality of N-grams included in the text belonging to the first category in the electronic document to be searched are associated with the appearance positions of the plurality of N-grams in the text belonging to the first category; An index, and a plurality of N-grams included in the text belonging to the second category of the electronic document, and an appearance position of the plurality of N-grams in the text belonging to the second category. An index obtaining step of obtaining an index of 2;
A search keyword obtaining step for obtaining a search keyword;
The search keywords are retrieved from the text belonging to the first category by reading the appearance positions of the plurality of N-grams included in the search keywords from the first index and evaluating the continuity of the read appearance positions. A first search step;
The search keywords are retrieved from the electronic document by reading the appearance positions of a plurality of N-grams included in the search keywords from the first index and the second index and evaluating the continuity of the read appearance positions. A second search step,
An output step of outputting a search result by at least one of the first search step and the second search step;
Search method to perform .
検索対象の電子文書のうちの第1のカテゴリに属するテキストに含まれる複数のNグラムと、前記第1のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第1のインデックス、及び、前記電子文書のうちの第2のカテゴリに属するテキストに含まれる複数のNグラムと、前記第2のカテゴリに属するテキストにおける当該複数のNグラムの出現位置と、を対応付けた第2のインデックスを取得するインデックス取得手段、
検索キーワードを取得する検索キーワード取得手段、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記第1のカテゴリに属するテキストから前記検索キーワードを検索する第1の検索手段、
前記検索キーワードに含まれる複数のNグラムの出現位置を前記第1のインデックス及び前記第2のインデックスから読み出し、読み出した出現位置の連続性を評価することによって、前記電子文書から前記検索キーワードを検索する第2の検索手段、
少なくとも前記第1の検索手段と前記第2の検索手段の一方による検索結果を出力する出力手段、
として機能させるためのプログラム。 Computer
A first N-gram in which a plurality of N-grams included in the text belonging to the first category in the electronic document to be searched are associated with the appearance positions of the plurality of N-grams in the text belonging to the first category; An index, and a plurality of N-grams included in the text belonging to the second category of the electronic document, and an appearance position of the plurality of N-grams in the text belonging to the second category. Index acquisition means for acquiring the second index;
Search keyword acquisition means for acquiring a search keyword,
The search keywords are retrieved from the text belonging to the first category by reading the appearance positions of the plurality of N-grams included in the search keywords from the first index and evaluating the continuity of the read appearance positions. A first search means,
The search keywords are retrieved from the electronic document by reading the appearance positions of a plurality of N-grams included in the search keywords from the first index and the second index and evaluating the continuity of the read appearance positions. A second search means,
Output means for outputting a search result by at least one of the first search means and the second search means;
Program to function as
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016052786A JP6668855B2 (en) | 2016-03-16 | 2016-03-16 | Search device, search method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016052786A JP6668855B2 (en) | 2016-03-16 | 2016-03-16 | Search device, search method and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017167837A JP2017167837A (en) | 2017-09-21 |
JP6668855B2 true JP6668855B2 (en) | 2020-03-18 |
Family
ID=59913977
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016052786A Active JP6668855B2 (en) | 2016-03-16 | 2016-03-16 | Search device, search method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6668855B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7291488B2 (en) * | 2019-01-21 | 2023-06-15 | 株式会社プリマジェスト | Image processing device |
-
2016
- 2016-03-16 JP JP2016052786A patent/JP6668855B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2017167837A (en) | 2017-09-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105917327B (en) | System and method for entering text into an electronic device | |
US5794177A (en) | Method and apparatus for morphological analysis and generation of natural language text | |
JP6461980B2 (en) | Coherent question answers in search results | |
US20150220547A1 (en) | Suggesting and refining user input based on original user input | |
US20060241934A1 (en) | Apparatus and method for translating Japanese into Chinese, and computer program product therefor | |
US20050267734A1 (en) | Translation support program and word association program | |
US9489944B2 (en) | Information processing device, method and computer program product for processing voice recognition data | |
JP2005251115A (en) | System and method of associative retrieval | |
US20070168344A1 (en) | Data product search using related concepts | |
JP6260294B2 (en) | Information search device, information search method, and information search program | |
US20110246464A1 (en) | Keyword presenting device | |
JP5910134B2 (en) | Text search apparatus and program | |
JP2013196358A (en) | Retrieval supporting apparatus and retrieval supporting method | |
JP5737079B2 (en) | Text search device, text search program, and text search method | |
US8554539B2 (en) | Method for analyzing morpheme using additional information and morpheme analyzer for executing the method | |
JP6668855B2 (en) | Search device, search method and program | |
JP2007286742A (en) | Document retrieval device | |
JPH0844771A (en) | Information retrieval device | |
JP5447368B2 (en) | NEW CASE GENERATION DEVICE, NEW CASE GENERATION METHOD, AND NEW CASE GENERATION PROGRAM | |
KR101835994B1 (en) | Method and apparatus of providing searching service for electronic books | |
KR20170107808A (en) | Data structure of translation word order pattern separating original text into sub-translation units and determining word order of sub-translation units, computer-readable storage media having instructions for creating data structure stored therein, and computer programs for translation stored in computer-readable storage media executing traslation therewith | |
JP2012141681A (en) | Query segment position determining device | |
JP5733285B2 (en) | SEARCH DEVICE, SEARCH METHOD, AND PROGRAM | |
JP2002032394A (en) | Device and method for preparing related term information, device and method for presenting related term, device and method for retrieving document and storage medium | |
JP6447549B2 (en) | Text search apparatus, text search method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190311 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20191119 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200115 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20200128 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200210 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6668855 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |