CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 20:30:33 GMT
content-type: text/html; charset=utf-8
cache-control: max-age=0, private, must-revalidate
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
link: ; rel=preload; as=fetch; crossorigin=use-credentials
referrer-policy: no-referrer-when-downgrade
server-timing: issue_layout-fragment;desc="issue_layout fragment";dur=192.176929,issue_conversation_content-fragment;desc="issue_conversation_content fragment";dur=478.86604,issue_conversation_sidebar-fragment;desc="issue_conversation_sidebar fragment";dur=33.576913,nginx;desc="NGINX";dur=1.244025,glb;desc="GLB";dur=100.915019
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, Accept,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: fd8fbbc
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=kQ9ILLzNhBbuSK7ZMWpnBuVFl0fIX3OnWkIZ5ArF3ZbyjN6zaFv55L1IdSeb5q%2B7m9AgREFCmC69hr4JaFnw1jwvm4h%2FRExl6LmTVAq2d3QyoD%2BB0kdhdP7Slc2qGn%2BXN4cyYUWxd%2FdVZqYGEx6x8xt78%2Fjq95K8WKTXrUAOQfJTAz6keoIUY5uWqlj3Ei3dKp1jiC7pXmP3RStKvZmSXnK4PQ6pF80COWgwdIEYrh3YA6lznSlSZ9wiC1YJDeY6sznkm3OTkV3NpAEhLOdryw%3D%3D--UfKAQifOtl92dT9z--ddai%2Fsxu20yakt5YNRA1CA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.286868273.1753302633; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 20:30:33 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 20:30:33 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 9368:221257:D7A4B:1167E2:68814669
未进行修改, 自定义词典缓存失败 · Issue #1025 · hankcs/HanLP · GitHub
No one assignedNo projectsNo milestoneNone yetNo branches or pull requests
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Labels
Description
注意事项
请确认下列注意事项:
- 我已仔细阅读下列文档,都没有找到答案:
- 我已经通过Google和issue区检索功能搜索了我的问题,也没有找到答案。
- 我明白开源社区是出于兴趣爱好聚集起来的自由社区,不承担任何责任或义务。我会礼貌发言,向每一个帮助我的人表示感谢。
- 我在此括号内输入x打钩,代表上述事项确认完毕。
版本号
使用python3.7.1 版本, 直接pip 安装得到
Windows 10 家庭中文版1803 17134.376
当前最新版本号是:1.7.0
我使用的版本是:1.7.0
我的问题
在我使用pip 安装后, 在命令行运行hanlp segment
下载过jar和data后, 输入测试任意用句, 会出现报错信息.
复现问题
在我清空以前的hanlp文件后, 重新pip 安装, 没有对data 中的任何数据修改, 直接使用hanlp segment即出现问题.
触发代码
$ hanlp segment
测试用句
实际输出
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadDat
警告: 读取失败,问题发生在java.lang.ArrayIndexOutOfBoundsException: 7
at com.hankcs.hanlp.utility.ByteUtil.bytesHighFirstToInt(ByteUtil.java:239)
at com.hankcs.hanlp.corpus.io.ByteArray.nextInt(ByteArray.java:68)
at com.hankcs.hanlp.dictionary.CustomDictionary.loadDat(CustomDictionary.java:325)
at com.hankcs.hanlp.dictionary.CustomDictionary.loadMainDictionary(CustomDictionary.java:64)
at com.hankcs.hanlp.dictionary.CustomDictionary.<clinit>(CustomDictionary.java:51)
at com.hankcs.hanlp.seg.Segment.combineByCustomDictionary(Segment.java:203)
at com.hankcs.hanlp.seg.Viterbi.ViterbiSegment.segSentence(ViterbiSegment.java:57)
at com.hankcs.hanlp.seg.Segment.seg(Segment.java:557)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary load
严重: 自定义词典c:/program读取错误!java.io.FileNotFoundException: c:\program (系统找不到指定的文件。)
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 失败:c:/program
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 没有加载到任何词条
十一月 17, 2018 3:09:57 下午 com.hankcs.hanlp.dictionary.CustomDictionary loadMainDictionary
警告: 自定义词典c:/program files/python37/lib/site-packages/pyhanlp/static/data/dictionary/custom/CustomDictionary.txt缓存失败!
java.lang.NullPointerException
at com.hankcs.hanlp.dictionary.CustomDictionary.loadMainDictionary(CustomDictionary.java:116)
at com.hankcs.hanlp.dictionary.CustomDictionary.<clinit>(CustomDictionary.java:51)
at com.hankcs.hanlp.seg.Segment.combineByCustomDictionary(Segment.java:203)
at com.hankcs.hanlp.seg.Viterbi.ViterbiSegment.segSentence(ViterbiSegment.java:57)
at com.hankcs.hanlp.seg.Segment.seg(Segment.java:557)
测试/vn 用/p 句/q
谢谢您的解答!
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Issue actions
You can’t perform that action at this time.