文字列の前後の文脈を高速に検索する索引
ZigZag Trie: A Novel Index for Contextual Queries
この論文をやさしく読む
ひとことで言うと
長い文章や配列の中で、ある文字列の左右にどんな文字列が一緒に現れるかを高速に調べる索引です。
何に役立つ?
出現回数の多い文脈、複数文書に共通する文脈、文脈の種類数、得点の高い文脈の検索を効率化します。対象文字列そのものだけでなく、その周囲を調べたい場合の基盤になります。
この研究の面白いところ
左右へ対称に伸びる文脈を同じ部分木へまとめます。長さnのテキストに対し索引サイズはO(n)、構築時間はO(n log n)で、検索の理論保証と十億文字規模の実データでの比較を併せて示しています。
どこまで分かった?
四種類の検索のうち三つは最適時間、得点順検索はほぼ最適な時間としています。実験では比較手法より桁違いに高速と報告していますが、要旨に個別の計測値やデータセット別の詳細はありません。
v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。
アブストラクトの日本語訳
長いテキストTの中にある文字列Pの文脈に関する問い合わせへの関心が高まっている。ここで文脈とは、与えられたqに対して長さがともにqであり、文字列LPRがTに出現する文字列対(L, R)の集合である。このような文脈の問い合わせは複数の分野で重要だが、効率的に答えるのは難しい。実用上のTが極めて長いことに加え、既存の索引が、検索に効率的に答える鍵となる、与えられたPの文脈を直接符号化していないためである。 本研究では、この課題に対応する新しい全文索引ZigZag Trie(ZZT)を導入する。この索引は、任意のPについて、その周囲で対称的に伸びるすべての文字列LとRが索引の共通部分木にまとまるようテキストを再構成し、効率的な取得を可能にする。nをTの長さとすると、大きさO(n)のZZTを、時間O(n log n)、空間O(n)で構築する方法を示す。 さらにZZTの上に、問い合わせパターンPについて四種類の新たな文脈問い合わせに答える専用索引を設計する。第一は、固定したτに対し、Tに少なくともτ回出現する最長の文字列LPRを見つけるもの。第二は、固定したτに対し、テキスト集合の少なくともτ個のテキストに出現する最長の文字列LPRを見つけるもの。第三は、T内のPの異なる文脈の総数を求めるもの。第四は、与えられたqについて、指定のスコア関数で最も高いスコアを持つPの文脈対(L, R)をk個取得するものである。 本索引は第一、第二、第三の問い合わせに最適な時間で、第四には最適に近い時間で答える。また、ZZTが与えられたとき、索引の大きさ、構築に必要な空間と時間は、nに対して線形またはほぼ線形である。十億文字規模の実データセットを使い、基準手法より桁違いに高速に問い合わせに答え、索引の大きさ、構築空間、構築時間でも同等以上の性能を示すことを確認する。
v1の要旨から自動生成。本文の精読・人による確認は未実施。
- 初稿
- 2026-09-17(UTC)
- 最新改訂
- 2026-09-17 · v1
- 査読・掲載
- 査読状況未確認
更新履歴
- v1 2026-09-17 この版を読む
取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。
原文の要旨
There is increasing interest in queries about the context of a string $P$ in a longer text $T$, i.e., the set of all string pairs $(L,R)$, with $|L|=|R|=q$, for a given $q$, such that the string $LPR$ occurs in $T$. Such contextual queries are important in several domains but are challenging to answer efficiently. This is because the length of $T$ in applications is massive and existing indexes do not directly encode the context of a given $P$, which is key for answering retrieval queries efficiently. Our work introduces the ZigZag Trie (ZZT), a new full-text index to specifically address these challenges. This index reorganizes the text so that, for any $P$, all possible strings $L$ and $R$ growing symmetrically around $P$ are grouped into a common subtree of the index, allowing their efficient retrieval. We show how to construct the ZZT of $T$, which has size $\mathcal{O}(n)$ where $n=|T|$, in $\mathcal{O}(n\log n)$ time and $\mathcal{O}(n)$ space. On top of ZZT, we design specialized indexes that, for a query pattern $P$, answer four new types of contextual queries: (I) finding the longest string $LPR$ that occurs at least $\tau$ times in $T$, for a fixed $\tau$; (II) finding the longest string $LPR$ that occurs in at least $\tau$ texts of a text collection, for a fixed $\tau$; (III) reporting the total number of distinct contexts of $P$ in $T$; and (IV) retrieving, for a given $q$, the $k$ pairs $(L,R)$ of $P$ with the highest scores according to a given scoring function. Our indexes answer queries of type I, II, and III in optimal time, and of type IV in near-optimal time. Moreover, their size, construction space, and construction time are linear or near-linear in $n$, given ZZT. Using real billion-letter datasets, we show that our indexes answer queries orders of magnitude faster than baselines and perform similarly or better in index size and construction space and time.
著者のコメント
29 pages
arXiv ID: 2609.19914 / 要約の誤りについて