Giter VIP home page Giter VIP logo

geezmolycos / vscode-hanzi-counter Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 0.0 4.55 MB

多功能文档字数统计,支持中文,也可用正则表达式自定义要统计的内容。Customizable word counter with great support of Chinese characters (Hanzi). Use custom regexs to match any character type that you want.

Home Page: https://marketplace.visualstudio.com/items?itemName=geezmolycos.vscode-hanzi-counter

License: MIT License

TypeScript 76.57% JavaScript 23.05% AutoHotkey 0.38%
cjk vscode-extension word-count

vscode-hanzi-counter's People

Contributors

geezmolycos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vscode-hanzi-counter's Issues

下一步目标:提升安全性、文件列表视图中显示文件信息

字数统计的功能已经完善了,考虑下一步的目标,实现以下两个功能,计划在之后的一个月中实现(目前正在做其他事情,有时间再实现)。

  • 将模板 JavaScript 代码保存在扩展的固定目录中,而非保存在配置列表中,以方便用户编辑
    • 为了便于用户编写配置,提供可供修改的模板参数放到配置项中,修改常用内容只需要修改模板参数
    • 这样也可以防止恶意来源的工作目录里面放置配置文件,覆盖该扩展全局的配置,执行恶意的模板 JavaScript 代码
  • 在文件列表视图中使用 FileDecorationProvider 或其他技术显示每个文件(及文件夹)的简略信息,或使用Panel显示选中文件的简略信息,也可满足 #4 的需求

中西文混杂情况下的字数统计问题

如:

使用 Adobe Photoshop 打开图片

Spaced words: | 4              [使用] [Adobe] [Photoshop] [打开图片]
Simple words: | 4               [使用] [Adobe] [Photoshop] [打开图片]
Sentences: | 1
Letters: | 20
Puncts/Symbols: | 0/0
Non-white: | 20
Chars: | 23
Non-ASCII: | 6
Codepoints: | 23
UTF-8: | 35


中文: | 6                         [使][用] Adobe Photoshop [打][开][图][片]
中文(不含标点): | 6        [使][用] Adobe Photoshop [打][开][图][片]
CJK字符: | 6
单词: | 4                         [使用] [Adobe] [Photoshop] [打开图片]
非空白字符: | 20
字符数: | 23
非ASCII码位: | 6
码位数: | 23
UTF-8: | 35

MS Word中的统计为:字数8,非中文单词2,中文字符和朝鲜语单词6,更符合日常使用习惯

同时还应考虑中西文间不打空格的情况(使用Adobe Photoshop打开图片

字数过多会把extension host卡死

单行字数过多或文件总字数太多(比如20多MiB),会让extension host卡死,没反应。

需要设置最大允许统计的字数,如果大于这个数,就只统计一部分,再估算。

非常好用,希望增加两个功能

感谢作者对开源社区的贡献!

我有两个小需求:

  1. 能默认显示非空字符串,或者能够自己配置
  2. 能统计文件下所有文件中的字数

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.