游记jieba
聊斋jieba库
import jieba print("02 17向悦")# 读取文本文件path = "聊斋志异.txt"file = open(path, "r", encoding="utf-8")text = file.read()file.close() # 使用jieba分词words = jieba. ......
红楼梦jieba分词
import jieba excludes = {"什么","一个","我们","那里","你们","如今","说道","知道","起来","姑娘","这里","出来","他们","众人","自己", "一面","只见","怎么",&quo ......
jieba分词 红楼梦相关分词
import jieba text=open('C:\Users\李文卓\Desktop\xn\红楼梦.txt',"r",encoding='utf-8').read() words=jieba.lcut(text) counts={} for word in words: if len(word) ......
jieba分词
```import jieba # 读取文本文件 path = "西游记.txt" file = open(path, "r", encoding="utf-8") text = file.read() file.close() # 使用jieba分词 words = jieba.lcut(text ......
西游记jieba分词
引用jiaba库 点击查看代码 import jieba 读取文件,文件路径填写文件放取的位置 并且使用jieba分词的精确模式 点击查看代码 txt = open('西游记.txt', 'r', encoding='utf-8').read() words = jieba.lcut(txt) co ......
jieba分词
jieba分词尾号为1,2,3的同学做,西游记相关的分词,出现次数最高的20个。 代码如下: print("学号后两位为03(2021310143103)") import jieba txt = open("E:\\大学\\Python\\西游记.txt","r",encoding='gb1803 ......
jieba西游记
import jiebawith open('E:\西游记.txt','r',encoding='utf-8')as f: # 打开文件 txt = f.read() # 读取为txt words = jieba.lcut(txt) # 利用jieba库的lcut分词 counts={} # 创建字 ......
jieba分词 | 西游记相关分词,出现次数最高的20个。
代码 1 import jieba 2 3 txt = open("《西游记》.txt", "r", encoding='utf-8').read() 4 5 words = jieba.lcut(txt) # 使用精确模式对文本进行分词 6 7 counts = {} # 通过键值对的形式存储词语 ......
python作业 jieba 分词
尾号为7,8,9,0的同学做,聊斋相关的分词,出现次数最高的20个。学号:2022310143007 ```import jieba # 读取文本文件path = "聊斋志异.txt"file = open(path, "r", encoding="utf-8")text = file.read() ......
jieba 分词
尾号为7,8,9,0的同学做,聊斋相关的分词,出现次数最高的20个。 # -*- coding: utf-8 -*- """ Created on Sat Dec 23 18:00:49 2023 @author: 86135 """ import jieba # 读取文本文件 path = "C: ......
jieba分词
import jieba txt = open("D:\python-learn\lianxi\聊斋志异.txt","r",encoding = 'utf-8').read() words = jieba.lcut(txt) counts = {} for word in words: if len ......
jieba分词
import jieba txt = open("D:\python-learn\lianxi\聊斋志异.txt","r",encoding = 'utf-8').read() words = jieba.lcut(txt) counts = {} for word in words: if len ......
2023 ICPC 合肥游记
board 11.24 开始嗓子疼了,但可以忍受。晚上睡的很不舒服 11.25 起床就开始难受,还得骑车到地铁站,应该打个车来着。不过路上拍到了很好看的朝霞(写到这里才想起来还没发朋友圈给 ta 看) 报道的时候玩小游戏获得了明信片+玩偶,虽然来晚了没有好看的玩偶了。。。事后想拿两个明信片也挺好 因 ......
jieba分词
import jieba# 读取文本文件path = "红楼梦.txt"file = open(path, "r", encoding="GB2312",errors="ignore")text = file.read()file.close()# 使用jieba分词words = jieba.lc ......
CSP2023游记
CSP2023游记 8:25 手忙脚乱地建好了目录文件、配置好了 DEV-C++ 的语法环境。 8:30 打开题目 8:45 看到 T1 发现不如去年简单,有些慌张,我选择了先看 T2。 9:00~9:30 发现 T2 其实就是一个贪心,于是用了半个小时做出来了。 9:30~9:50 回看 T1,发 ......
CSP&NOIP 2023 游记
今日是 2023.12.20. 先写 CSP 吧。在本校考试。具体的记忆都模糊了。 花了 30 分钟过了 A,认为实在是不可置信。 然后看 B,感觉是括号匹配,首先有一个平方的算法,可以拿 50 分。 看了一眼 C,感觉是一坨屎。D 当时觉得很难。 于是 15:00 到 16:00 什么都没做。 到 ......
THUPC 2024 初赛部分题解和游记
我们队赛时被 J 题创死了 awa 离做出来差一个剪枝,而且赛后试了试不加剪枝甚至能过…… 6 题离场。 一些题解 J 套娃 先对 \([0,n]\) 中每个数 \(k\) 分别考虑。 假设总共出现了 \(c\) 次 \(k\),第 \(i\) 次出现的位置是 \(pos_{i}\),(令 \(po ......
jieba分词
import jiebatxt = open("D:\\python\\西游记.txt", "r", encoding='ansi').read()words = jieba.lcut(txt) # 使用精确模式对文本进行分词counts = {} # 通过键值对的形式存储词语及其出现的次数for ......
最后一次大作业-2-jieba分词
尾号为4,5,6的同学做,红楼梦相关的分词,出现次数最高的20个。 import jieba txt = open("D:\pycharm\python123\jieba分词作业\红楼梦.txt","r",encoding = 'utf-8').read() words = jieba.lcut(t ......
jieba 分词
jieba 分词 描述 尾号为1,2,3的同学做,西游记相关的分词,出现次 ......
jieba分词《聊斋》
import jieba txt = open("聊斋志异白话简写版.txt", "r", encoding='utf-8').read()words = jieba.lcut(txt) # 使用精确模式对文本进行分词counts = {} # 通过键值对的形式存储词语及其出现的次数 for wor ......
jieba 分词
import jieba txt = open("西游记.txt", "r", encoding='utf-8').read() words = jieba.lcut(txt) # 使用精确模式对文本进行分词 counts = {} # 通过键值对的形式存储词语及其出现的次数 for word in ......
jieba库的运用:聊斋志异
# -*- coding: utf-8 -*- """ Created on Wed Dec 20 00:02:07 2023 @author: chen """ import jieba # 读取文本文件 path = "聊斋志异.txt" file = open(path, "r", encod ......
2023 重庆市赛游记
Day -? 校赛轻松打出 n+3,把赛时某题 wa 的代码交到 hdu 原题上直接过了,所以其实是 n+4,不过怎么都是第一,轻松入选市赛。 Day 1 早八坐大巴去西南大学。 地铁 2h+ 的路程,大巴走高速只需要 40min,实在是快。 等另一个校区的同学来齐之后拍了点合影就进去签到了。 排队 ......
ICPC2023 杭州站游记
Day -2 周五早八的飞机,周四晚上就润去机场旁边的酒店了。 队长说昨晚没睡好,不到九点就先睡了,但是十二点左右就睡醒了。睡醒之后又点了外卖吃,这下完全不困了,玩手机玩到三点顶不住就睡了。 和队长聊天,目标都是守银。 Day -1 本来定的 5:45 的闹钟,5:43 刚好醒来,简单收拾一下就出发 ......
jieba库 聊斋志异
import jiebatxt = open("D:\python课本内容\聊斋志异.txt","r",encoding = 'utf-8').read()words = jieba.lcut(txt)counts = {}for word in words: if len(word) == 1: ......
jieba库西游记分词(13号)
import jieba def merge_synonyms(words, synonyms): merged_words = [] for word in words: for synonym_list in synonyms: if word in synonym_list: merged_w ......
jieba分词——西游记相关的分词,出现次数最高的20个
1 import jieba 2 3 txt = open("D:\Python project\Python123作业\西游记.txt", "r", encoding='utf-8').read() 4 words = jieba.lcut(txt) # 使用精确模式对文本进行分词 5 count ......
jieba 分词
西游记相关的分词,出现次数最高的20个 输入: 1 import jieba 2 excludes = {"一个", "我们", "怎么", "那里", "不知", "不是", "只见", "两个", "不敢", "这个", "如何", "原来", "甚么", "不曾", "闻言", "正 ......
红楼梦相关的 jieba 分词
尾号为4,5,6的同学做,红楼梦相关的分词,出现次数最高的20个。 以下为代码及运行结果: import jiebatxt = open("D:\红楼梦.txt","r",encoding = 'ansi').read()words = jieba.lcut(txt) #精确模式进行分词count ......