当前位置: 首页 > news >正文

php站点搭建wordpress安装网站

php站点搭建,wordpress安装网站,邦派巴洛特网站是谁做的呀,建设官方网站的好处和坏处Aho-Corasick算法简称AC算法#xff0c;也称为AC自动机(Aho-Corasick)算法#xff0c;1975年产生于贝尔实验室#xff08;The Bell Labs#xff09;#xff0c;是一种用于解决多模式字符串匹配的经典算法之一。 the Bell Lab 本文的运行效果#xff1a; AC算法以模式树…Aho-Corasick算法简称AC算法也称为AC自动机(Aho-Corasick)算法1975年产生于贝尔实验室The Bell Labs是一种用于解决多模式字符串匹配的经典算法之一。 the Bell Lab  本文的运行效果 AC算法以模式树字典树Trie、广度优先策略和KMP模式匹配算法为核心内容。 using System; using System.Collections; using System.Collections.Generic; namespace Legalsoft.Truffer.Algorithm {     /// summary     /// Aho_Corasick 算法     /// /summary     public static partial class PatternSearch     {         private static int MAXS 512;         private static int MAXC 26; private static int[] outt new int[MAXS]; private static int[] f new int[MAXS]; private static int[,] g new int[MAXS, MAXC]; private static int buildMatchingMachine(string[] arr, int k)         {             for (int i 0; i outt.Length; i)             {                 outt[i] 0;             } for (int i 0; i MAXS; i)             {                 for (int j 0; j MAXC; j)                 {                     g[i, j] -1;                 }             } int states 1;             for (int i 0; i k; i)             {                 string word arr[i];                 int currentState 0; for (int j 0; j word.Length; j)                 {                     int ch word[j] - A;                     if (g[currentState, ch] -1)                     {                         g[currentState, ch] states;                     }                     currentState g[currentState, ch];                 } outt[currentState] | (1 i);             } for (int ch 0; ch MAXC; ch)             {                 if (g[0, ch] -1)                 {                     g[0, ch] 0;                 }             } for (int i 0; i MAXC; i)             {                 f[i] 0;             } Queueint q new Queueint();             for (int ch 0; ch MAXC; ch)             {                 if (g[0, ch] ! 0)                 {                     f[g[0, ch]] 0;                     q.Enqueue(g[0, ch]);                 }             } while (q.Count ! 0)             {                 int state q.Peek();                 q.Dequeue(); for (int ch 0; ch MAXC; ch)                 {                     if (g[state, ch] ! -1)                     {                         int failure f[state];                         while (g[failure, ch] -1)                         {                             failure f[failure];                         } failure g[failure, ch];                         f[g[state, ch]] failure; outt[g[state, ch]] | outt[failure]; q.Enqueue(g[state, ch]);                     }                 }             }             return states;         } private static int findNextState(int currentState, char nextInput)         {             int answer currentState;             int ch nextInput - A; while (g[answer, ch] -1)             {                 answer f[answer];             }             return g[answer, ch];         } public static Listint Aho_Corasick_Search(string text, string pattern, int k 1)         {             Listint matchs new Listint(); string[] arr new string[1] { pattern };             buildMatchingMachine(arr, k); int currentState 0; for (int i 0; i text.Length; i)             {                 currentState findNextState(currentState, text[i]); if (outt[currentState] 0)                 {                     continue;                 } for (int j 0; j k; j)                 {                     if ((outt[currentState] (1 j)) 0)                     {                         matchs.Add((i - arr[j].Length 1));                     }                 }             } return matchs;         }     } } POWER BY TRUFFER.CN using System; using System.Collections; using System.Collections.Generic;namespace Legalsoft.Truffer.Algorithm {/// summary/// Aho_Corasick 算法/// /summarypublic static partial class PatternSearch{private static int MAXS 512;private static int MAXC 26;private static int[] outt new int[MAXS];private static int[] f new int[MAXS];private static int[,] g new int[MAXS, MAXC];private static int buildMatchingMachine(string[] arr, int k){for (int i 0; i outt.Length; i){outt[i] 0;}for (int i 0; i MAXS; i){for (int j 0; j MAXC; j){g[i, j] -1;}}int states 1;for (int i 0; i k; i){string word arr[i];int currentState 0;for (int j 0; j word.Length; j){int ch word[j] - A;if (g[currentState, ch] -1){g[currentState, ch] states;}currentState g[currentState, ch];}outt[currentState] | (1 i);}for (int ch 0; ch MAXC; ch){if (g[0, ch] -1){g[0, ch] 0;}}for (int i 0; i MAXC; i){f[i] 0;}Queueint q new Queueint();for (int ch 0; ch MAXC; ch){if (g[0, ch] ! 0){f[g[0, ch]] 0;q.Enqueue(g[0, ch]);}}while (q.Count ! 0){int state q.Peek();q.Dequeue();for (int ch 0; ch MAXC; ch){if (g[state, ch] ! -1){int failure f[state];while (g[failure, ch] -1){failure f[failure];}failure g[failure, ch];f[g[state, ch]] failure;outt[g[state, ch]] | outt[failure];q.Enqueue(g[state, ch]);}}}return states;}private static int findNextState(int currentState, char nextInput){int answer currentState;int ch nextInput - A;while (g[answer, ch] -1){answer f[answer];}return g[answer, ch];}public static Listint Aho_Corasick_Search(string text, string pattern, int k 1){Listint matchs new Listint();string[] arr new string[1] { pattern };buildMatchingMachine(arr, k);int currentState 0;for (int i 0; i text.Length; i){currentState findNextState(currentState, text[i]);if (outt[currentState] 0){continue;}for (int j 0; j k; j){if ((outt[currentState] (1 j)) 0){matchs.Add((i - arr[j].Length 1));}}}return matchs;}} }
http://www.w-s-a.com/news/946110/

相关文章:

  • 临沂seo网站推广wordpress新编辑器
  • c2c网站设计店面logo设计制作
  • 网站建设任务执行书重庆今天新闻事件
  • 怎样发布自己的网站南宁制作网站公司
  • wordpress装多站点百度查一下
  • 怎么优化一个网站搭建网站免费空间
  • 山东建设和城乡建设厅注册中心网站首页wordpress安装教材
  • 个人风采网站制作毕节网站开发公司电话
  • 网络网站销售设计主题和设计理念
  • 做网站一般用什么服务器承德专业做网站
  • 松北区建设局网站网站建设分为几种
  • 网站建设的合同 体会智联招聘网站建设情况
  • 记的网站域名wordpress地方信息主题
  • 淄博好的建网站公司网站建设 海口
  • 有人做网站花了10几万2017做啥网站能致富
  • 做网站有什么软件cod建站平台
  • 合肥学校网站建设怎么做免费的产品图片网站
  • 营养早餐网站的设计与制作建设通网站怎么查项目经理在建
  • 浑南区建设局网站永州网站建设公司推荐
  • 做外贸都得有网站吗绵阳网站建设制作
  • 功能性的网站建设北京餐饮品牌设计公司
  • php做网站优势视频直播软件
  • 怎么安装php网站哪个网站是专门为建设方服务的
  • 重慶网站开发sina app engine wordpress
  • wampserver网站开发步骤中冠工程管理咨询有限公司
  • 自己做网站商城需要营业执照吗老外做牛排的视频网站
  • 网站推广效果的评估指标主要包括公司广告推广
  • 昆明网站建设那家好哪个网站学做凉皮
  • hype做网站动效哪里有给网站做
  • 打扑克网站推广软件设计类专业哪个最好