A sequence $e_0,e_1,\ldots$ of edit operations in a string $T$ is called ephemeral if operation $e_i$ constructing string $T^i$, for all $i=2k$ with $k\in\mathbb{N}$, is reverted by operation $e_{i+1}$ that reconstructs $T$. Such a sequence arises when processing a stream of independent edits or testing hypothetical edits. We introduce text indexing with ephemeral substring edits, a new version of text indexing. Our goal is to design a data structure over a given text that supports subsequent pattern matching queries with ephemeral substring insertions, deletions, or substitutions in the text; we require insertions and substitutions to be of constant length. In particular, we preprocess a text $T=T[0\mathinner{.\,.} n)$ over an integer alphabet $Σ=[0,σ)$ with $σ=n^{\mathcal{O}(1)}$ in $\mathcal{O}(n)$ time. Then, we can preprocess any arbitrary pattern $P=P[0\mathinner{.\,.} m)$ given online in $\mathcal{O}(m\log\log m)$ time and $\mathcal{O}(m)$ space and allow any ephemeral sequence of edit operations in $T$. Before reverting the $i$th operation, we report all Occ occurrences of $P$ in $T^i$ in $\mathcal{O}(\log\log n + \text{Occ})$ time. We also introduce pattern matching with ephemeral edits. In particular, we preprocess two strings $T$ and $P$, each of length at most $n$, over an integer alphabet $Σ=[0,σ)$ with $σ=n^{\mathcal{O}(1)}$ in $\mathcal{O}(n)$ time. Then, we allow any ephemeral sequence of edit operations in $T$. Before reverting the $i$th operation, we report all Occ occurrences of $P$ in $T^i$ in the optimal $\mathcal{O}(\text{Occ})$ time. Along our way to this result, we also give an optimal solution for pattern matching with ephemeral block deletions.


翻译:若字符串 $T$ 上的编辑操作序列 $e_0,e_1,\ldots$ 满足:对于所有 $i=2k$(其中 $k\in\mathbb{N}$),操作 $e_i$ 构造出字符串 $T^i$,而随后的操作 $e_{i+1}$ 将其恢复为原始文本 $T$,则称该序列为瞬态编辑序列。此类序列在处理独立编辑流或测试假设性编辑时出现。本文提出了一种支持瞬态子串编辑的文本索引新范式。我们的目标是设计一种数据结构,使其能在给定文本上支持后续伴随瞬态子串插入、删除或替换的模式匹配查询;其中要求插入与替换操作具有恒定长度。具体而言,我们在 $\mathcal{O}(n)$ 时间内对定义在整数字母表 $Σ=[0,σ)$(其中 $σ=n^{\mathcal{O}(1)}$)上的文本 $T=T[0\mathinner{.\,.} n)$ 进行预处理。随后,对于任意在线给定的模式 $P=P[0\mathinner{.\,.} m)$,我们可在 $\mathcal{O}(m\log\log m)$ 时间与 $\mathcal{O}(m)$ 空间内完成预处理,并允许对 $T$ 执行任意瞬态编辑操作序列。在撤销第 $i$ 次操作前,我们能够以 $\mathcal{O}(\log\log n + \text{Occ})$ 时间报告 $P$ 在 $T^i$ 中所有 Occ 次出现。本文同时提出了支持瞬态编辑的模式匹配方法。具体而言,我们在 $\mathcal{O}(n)$ 时间内对两个定义于整数字母表 $Σ=[0,σ)$(其中 $σ=n^{\mathcal{O}(1)}$)且长度不超过 $n$ 的字符串 $T$ 与 $P$ 进行预处理。随后,我们允许对 $T$ 执行任意瞬态编辑操作序列。在撤销第 $i$ 次操作前,我们能够以最优的 $\mathcal{O}(\text{Occ})$ 时间报告 $P$ 在 $T^i$ 中所有 Occ 次出现。在实现该结果的过程中,我们还给出了瞬态块删除模式下模式匹配问题的最优解。

0
下载
关闭预览

相关内容

【ICLR2022】GNN-LM基于全局信息的图神经网络语义理解模型
专知会员服务
50+阅读 · 2021年6月2日
【ICML2021】具有线性复杂度的Transformer的相对位置编码
专知会员服务
25+阅读 · 2021年5月20日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
图节点嵌入(Node Embeddings)概述,9页pdf
专知
15+阅读 · 2020年8月22日
【NeurIPS2019】图变换网络:Graph Transformer Network
NAACL 2019 | 一种考虑缓和KL消失的简单VAE训练方法
PaperWeekly
20+阅读 · 2019年4月24日
基于Lattice LSTM的命名实体识别
微信AI
48+阅读 · 2018年10月19日
CNN 反向传播算法推导
统计学习与视觉计算组
30+阅读 · 2017年12月29日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关资讯
图节点嵌入(Node Embeddings)概述,9页pdf
专知
15+阅读 · 2020年8月22日
【NeurIPS2019】图变换网络:Graph Transformer Network
NAACL 2019 | 一种考虑缓和KL消失的简单VAE训练方法
PaperWeekly
20+阅读 · 2019年4月24日
基于Lattice LSTM的命名实体识别
微信AI
48+阅读 · 2018年10月19日
CNN 反向传播算法推导
统计学习与视觉计算组
30+阅读 · 2017年12月29日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员