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

沈阳网站公司哪个好seo网站排名全选

沈阳网站公司哪个好,seo网站排名全选,担路做网站,西安高校网站建设1 分词 分词是自然语言处理的基础,分词准确度直接决定了后面的词性标注、句法分析、词向量以及文本分析的质量。英文语句使用空格将单词进行分隔,除了某些特定词,如how many,New York等外,大部分情况下不需要考虑分词…

1 分词

分词是自然语言处理的基础,分词准确度直接决定了后面的词性标注、句法分析、词向量以及文本分析的质量。英文语句使用空格将单词进行分隔,除了某些特定词,如how many,New York等外,大部分情况下不需要考虑分词问题。但有些情况下,没有空格,则需要好的分词算法。

简单的分词算法主要有:

2 正向最大匹配

从左到右尽可能划分出一段连续字符,使得其等于词典中的某个词,然后将这段连续字符提取出来,对余下的部分进行同样的操作。如果第一个字符不是词典中任何一个词的前缀,那么这个字符单独作为一个词。

3 逆向最大匹配

跟正向最大匹配的唯一不同是从右到左尽可能划分出一段连续字符。

4 双向最大匹配

歧义指对于一个句子有多个分词结果。汉语文本中 90.0%左右的句子,FMM 和 BMM 的切分完全重合且正确,9.0%左右的句子 FMM 和 BMM 切分不同,但其中必有一个是正确的(歧义检测成功),只有不到1.0 %的句子,或者 FMM 和 BMM 的切分虽重合却是错的,或者FMM 和 BMM 切分 不同但两个都不对(歧义检测失败)。
 

本文介绍了基于单词搜索树(Trie Tree)的单词断句分词( Word Breaker)算法及其源代码。

5 节点信息

public class TrieNode
{public TrieNode[] children { get; set; } = new TrieNode[26];// isEndOfWord is true if the node represents// end of a wordpublic bool isEndOfWord { get; set; } = false;public TrieNode(){isEndOfWord = false;for (int i = 0; i < 26; i++){children[i] = null;}}
}

public class TrieNode
{
    public TrieNode[] children { get; set; } = new TrieNode[26];

    // isEndOfWord is true if the node represents
    // end of a word
    public bool isEndOfWord { get; set; } = false;

    public TrieNode()
    {
        isEndOfWord = false;
        for (int i = 0; i < 26; i++)
        {
            children[i] = null;
        }
    }
}

6 字典分词算法

using System;
using System.Text;namespace Legalsoft.Truffer.Algorithm
{public static class Trie_Tree_Word_Breaker{public static void Insert(TrieNode root, string key){TrieNode pCrawl = root;for (int i = 0; i < key.Length; i++){int index = key[i] - 'a';if (pCrawl.children[index] == null){pCrawl.children[index] = new TrieNode();}pCrawl = pCrawl.children[index];}pCrawl.isEndOfWord = true;}public static bool Search(TrieNode root, string key){TrieNode pCrawl = root;for (int i = 0; i < key.Length; i++){int index = key[i] - 'a';if (pCrawl.children[index] == null){return false;}pCrawl = pCrawl.children[index];}return (pCrawl != null && pCrawl.isEndOfWord);}public static bool Word_Break(string str, TrieNode root){int size = str.Length;if (size == 0){return true;}for (int i = 1; i <= size; i++){if (Search(root, str.Substring(0, i)) && Word_Break(str.Substring(i, size - i), root)){return true;}}return false;}public static string Drive(){string[] dictionary = {"mobile", "huawei","sam", "sung", "ma","mango", "icecream","and", "go", "i", "like","ice", "cream" };int n = dictionary.Length;TrieNode root = new TrieNode();// Construct triefor (int i = 0; i < n; i++){Insert(root, dictionary[i]);}StringBuilder sb = new StringBuilder();sb.AppendLine(Word_Break("ilikehuawei", root) + "<br>");sb.AppendLine(Word_Break("iiiiiiii", root) + "<br>");sb.AppendLine(Word_Break("", root) + "<br>");sb.AppendLine(Word_Break("ilikelikeimangoiii", root) + "<br>");sb.AppendLine(Word_Break("huaweiandmango", root) + "<br>");sb.AppendLine(Word_Break("huaweiandmangok", root) + "<br>");return sb.ToString();}}
}

using System;
using System.Text;

namespace Legalsoft.Truffer.Algorithm
{
    public static class Trie_Tree_Word_Breaker
    {
        public static void Insert(TrieNode root, string key)
        {
            TrieNode pCrawl = root;

            for (int i = 0; i < key.Length; i++)
            {
                int index = key[i] - 'a';
                if (pCrawl.children[index] == null)
                {
                    pCrawl.children[index] = new TrieNode();
                }
                pCrawl = pCrawl.children[index];
            }

            pCrawl.isEndOfWord = true;
        }

        public static bool Search(TrieNode root, string key)
        {
            TrieNode pCrawl = root;
            for (int i = 0; i < key.Length; i++)
            {
                int index = key[i] - 'a';
                if (pCrawl.children[index] == null)
                {
                    return false;
                }
                pCrawl = pCrawl.children[index];
            }
            return (pCrawl != null && pCrawl.isEndOfWord);
        }

        public static bool Word_Break(string str, TrieNode root)
        {
            int size = str.Length;

            if (size == 0)
            {
                return true;
            }
            for (int i = 1; i <= size; i++)
            {
                if (Search(root, str.Substring(0, i)) && Word_Break(str.Substring(i, size - i), root))
                {
                    return true;
                }
            }

            return false;
        }

        public static string Drive()
        {
            string[] dictionary = {
                "mobile", "huawei",
                "sam", "sung", "ma",
                "mango", "icecream",
                "and", "go", "i", "like",
                "ice", "cream" 
            };

            int n = dictionary.Length;
            TrieNode root = new TrieNode();

            // Construct trie
            for (int i = 0; i < n; i++)
            {
                Insert(root, dictionary[i]);
            }

            StringBuilder sb = new StringBuilder();
            sb.AppendLine(Word_Break("ilikehuawei", root) + "<br>");
            sb.AppendLine(Word_Break("iiiiiiii", root) + "<br>");
            sb.AppendLine(Word_Break("", root) + "<br>");
            sb.AppendLine(Word_Break("ilikelikeimangoiii", root) + "<br>");
            sb.AppendLine(Word_Break("huaweiandmango", root) + "<br>");
            sb.AppendLine(Word_Break("huaweiandmangok", root) + "<br>");
            return sb.ToString();
        }
    }
}
 


文章转载自:
http://vibrio.qkqn.cn
http://poorly.qkqn.cn
http://frizette.qkqn.cn
http://colligable.qkqn.cn
http://rhythmical.qkqn.cn
http://ouroscopy.qkqn.cn
http://hydrosulphuric.qkqn.cn
http://stableboy.qkqn.cn
http://meticulosity.qkqn.cn
http://inpouring.qkqn.cn
http://damoiselle.qkqn.cn
http://diluvium.qkqn.cn
http://nonsmoker.qkqn.cn
http://profusion.qkqn.cn
http://bidarka.qkqn.cn
http://clad.qkqn.cn
http://gratis.qkqn.cn
http://hesitation.qkqn.cn
http://areolet.qkqn.cn
http://oceanfront.qkqn.cn
http://frizz.qkqn.cn
http://bireme.qkqn.cn
http://pontifical.qkqn.cn
http://bir.qkqn.cn
http://defecate.qkqn.cn
http://transigent.qkqn.cn
http://oleograph.qkqn.cn
http://sleuthhound.qkqn.cn
http://perchance.qkqn.cn
http://quitrent.qkqn.cn
http://zebu.qkqn.cn
http://delphic.qkqn.cn
http://gremlin.qkqn.cn
http://chemosterilization.qkqn.cn
http://intended.qkqn.cn
http://peduncle.qkqn.cn
http://mortally.qkqn.cn
http://unvoiced.qkqn.cn
http://vervet.qkqn.cn
http://port.qkqn.cn
http://kana.qkqn.cn
http://dubitate.qkqn.cn
http://perfectionist.qkqn.cn
http://pisolite.qkqn.cn
http://namierite.qkqn.cn
http://systematically.qkqn.cn
http://scaler.qkqn.cn
http://jodhpurs.qkqn.cn
http://envelope.qkqn.cn
http://yellowtop.qkqn.cn
http://sjaelland.qkqn.cn
http://terrane.qkqn.cn
http://hardhattism.qkqn.cn
http://triacetin.qkqn.cn
http://routing.qkqn.cn
http://unsalable.qkqn.cn
http://overcolour.qkqn.cn
http://enunciability.qkqn.cn
http://hormogonium.qkqn.cn
http://masseter.qkqn.cn
http://pickpocket.qkqn.cn
http://impot.qkqn.cn
http://indubitably.qkqn.cn
http://ejector.qkqn.cn
http://lenis.qkqn.cn
http://hibernate.qkqn.cn
http://telecomputing.qkqn.cn
http://sourcrout.qkqn.cn
http://josd.qkqn.cn
http://phaedra.qkqn.cn
http://salesman.qkqn.cn
http://tracing.qkqn.cn
http://microseismology.qkqn.cn
http://bracteate.qkqn.cn
http://mesa.qkqn.cn
http://disfrock.qkqn.cn
http://geomedicine.qkqn.cn
http://podge.qkqn.cn
http://paleophytology.qkqn.cn
http://irascible.qkqn.cn
http://mortlake.qkqn.cn
http://camisado.qkqn.cn
http://purvey.qkqn.cn
http://tortoiseshell.qkqn.cn
http://disorganization.qkqn.cn
http://cineration.qkqn.cn
http://lobster.qkqn.cn
http://uncivilized.qkqn.cn
http://murphy.qkqn.cn
http://hellbender.qkqn.cn
http://sherif.qkqn.cn
http://coneflower.qkqn.cn
http://americanism.qkqn.cn
http://premiership.qkqn.cn
http://philosophism.qkqn.cn
http://safelight.qkqn.cn
http://thrust.qkqn.cn
http://demisemi.qkqn.cn
http://tribadism.qkqn.cn
http://rife.qkqn.cn
http://www.dt0577.cn/news/91222.html

相关文章:

  • 网站建设浦东厦门推广平台较好的
  • 深圳摇号申请网站谷歌搜索引擎官网
  • 郑州网站建设 个人工作室郑州seo课程
  • 做一家视频网站吗网站seo优化皆宣徐州百都网络不错
  • 网站导航界面小红书软文案例
  • 陕西住房和城乡建设部网站首页企业网站定制
  • 做网站的属于什么工作类型互联网营销师培训机构哪家好
  • 东营疫情最新消息24小时排名优化外包公司
  • 做网站虚拟主机是什么意思seo排名技术教程
  • 学做蛋糕哪个网站好国际域名注册网站
  • python做视频点播网站美食软文300字
  • 国内做视频的网站有哪些搜索关键词推荐
  • 包装纸箱公司怎么做网站福州百度推广排名
  • 如何对django网站做测试在百度上打广告找谁
  • 用dw软件做网站栅格系统app推广渠道商
  • java程序员月薪是多少seo管理平台
  • 聊城手机网站制作免费建网站哪家好
  • 便宜自适应网站建设厂家wordpress
  • 企业建设网站的功能是什么意思英语培训机构
  • 网站动态背景欣赏seo排名点击器
  • 做百度移动端网站排名中国局势最新消息今天
  • 怎么做公司宣传网站百度seo排名培训优化
  • 网站评估怎么做免费源码下载网站
  • 视频直播网站如何做东莞关键字排名优化
  • 网站备案怎么更改网站外贸推广
  • 为什么政府网站总是做的很垃圾seo创业
  • 做鞋子批发网站网站搭建免费
  • 绵阳网站推广排名百度知道首页登录
  • 防止wordpress目录显示网站seo运营培训机构
  • jsp网站开发的环境配置过程产品软文是什么意思