⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tree.cpp

📁 一个类似STL的自动机的源代码库
💻 CPP
字号:
#include <astl.h>#include <astl_tree.h>#include <dfa.h>#include <stream.h>#include <tools.h>#include <unistd.h>#include <ccopy.h>#include <string>#include <iterator>using namespace std;template <typename DFA>void run(DFA& dfa, const config& c){  int wc;  string word;  for(wc = 0, getline(cin, word); !cin.eof(); ++wc, getline(cin, word))     tree_build(dfa, word.begin(), word.end(), empty_tag());   if (c.verbose_mode)     cerr << c.argv[0] << ": word count " << wc << endl;  DFA_stream out(cout);  clone(out, dfirstc(dfa));}int main(int argc, char** argv){  config c(argc, argv, 1, "map bin tr mtf");  if (c.representation == "map") {    DFA_map<plain> dfa;    run(dfa, c);  }  if (c.representation == "bin") {    DFA_bin<plain> dfa;    run(dfa, c);  }  if (c.representation == "mtf") {    DFA_mtf<plain> dfa;    run(dfa, c);  }  if (c.representation == "tr") {    DFA_tr<plain> dfa;    run(dfa, c);  }  return 0;}  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -