Kyopro Library
 
読み取り中…
検索中…
一致する文字列を見つけられません
AhoCorasick< char_size, margin > 構造体テンプレート

AhoCorasick [詳解]

#include "aho.hpp"

AhoCorasick< char_size, margin > の継承関係図
Trie< char_size+1, margin >

公開メンバ関数

void build (bool heavy=true)
 前計算 オートマトンを構築する
 
unordered_map< int, int > match (const string &str, int now=0)
 str の中に出現する全パターンの出現回数を返す
 
pair< int64_t, int > move (const char &c, int now=0)
 現在のノード now から文字 c で遷移したときの(見つかったパターンの総数, 次のノード)を返す
 
pair< int64_t, int > move (const string &str, int now=0)
 str に対して move を適用する。(見つかったパターンの総数, 最終ノードを返す)
 
- 基底クラス Trie< char_size+1, margin > に属する継承公開メンバ関数
 Trie ()
 
 Trie (int len)
 
void update_direct (int node, int id)
 
void update_child (int node, int child, int id)
 
void add (const string &str, int str_index, int node_index, int id)
 
void add (const string &str, int id)
 
void add (const string &str)
 文字列 str を追加する
 
void query (const string &str, const function< void(int)> &f, int str_index, int node_index)
 
void query (const string &str, const function< void(int)> &f)
 strをprefixとして持つ全ての文字列に対し、見つかった文字列のインデックスそれぞれに対してfを実行する
 
int count () const
 文字列の総数
 
int count (const string &s)
 
int size () const
 ノードの総数
 
void insert (const string &s)
 
void erase (const string &s)
 

公開変数類

const int FAIL = char_size
 
vector< int > correct
 
- 基底クラス Trie< char_size+1, margin > に属する継承公開変数類
vector< Node > nodes
 
int root
 

その他の継承メンバ

- 基底クラス Trie< char_size+1, margin > に属する継承公開型
using Node
 

詳解

template<int char_size, int margin>
struct AhoCorasick< char_size, margin >

AhoCorasick

aho.hpp76 行目に定義があります。

関数詳解

◆ build()

template<int char_size, int margin>
void AhoCorasick< char_size, margin >::build ( bool heavy = true)
inline

前計算 オートマトンを構築する

aho.hpp83 行目に定義があります。

参照先 FAIL.

◆ match()

template<int char_size, int margin>
unordered_map< int, int > AhoCorasick< char_size, margin >::match ( const string & str,
int now = 0 )
inline

str の中に出現する全パターンの出現回数を返す

aho.hpp122 行目に定義があります。

◆ move() [1/2]

template<int char_size, int margin>
pair< int64_t, int > AhoCorasick< char_size, margin >::move ( const char & c,
int now = 0 )
inline

現在のノード now から文字 c で遷移したときの(見つかったパターンの総数, 次のノード)を返す

aho.hpp135 行目に定義があります。

◆ move() [2/2]

template<int char_size, int margin>
pair< int64_t, int > AhoCorasick< char_size, margin >::move ( const string & str,
int now = 0 )
inline

str に対して move を適用する。(見つかったパターンの総数, 最終ノードを返す)

aho.hpp141 行目に定義があります。

メンバ詳解

◆ FAIL

template<int char_size, int margin>
const int AhoCorasick< char_size, margin >::FAIL = char_size

aho.hpp79 行目に定義があります。

◆ correct

template<int char_size, int margin>
vector<int> AhoCorasick< char_size, margin >::correct

aho.hpp80 行目に定義があります。


この構造体詳解は次のファイルから抽出されました: