Closed tianhe1986 closed 7 years ago
Merging #28 into master will increase coverage by
0.18%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #28 +/- ##
==========================================
+ Coverage 64.07% 64.26% +0.18%
==========================================
Files 5 5
Lines 1119 1122 +3
==========================================
+ Hits 717 721 +4
+ Misses 402 401 -1
Impacted Files | Coverage Δ | |
---|---|---|
src/class/Jieba.php | 93.55% <100%> (+0.41%) |
:arrow_up: |
src/class/Posseg.php | 83.84% <0%> (-0.09%) |
:arrow_down: |
src/class/Finalseg.php | 98.42% <0%> (-0.06%) |
:arrow_down: |
src/class/JiebaAnalyse.php | 100% <0%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 26f4b64...35956ce. Read the comment docs.
@tianhe1986 太感謝了,多少會有些幫助的!
尝试从以下两个方面提高性能。 1
self::$trie
命中的词组,无需再做一次end相关的比较。 2self::$trie
未命中的词组,若多次出现,则第二次开始,无需再去调用MultiArray::get
并最终用MultiArray::getValue
进行递归遍历。 因为是跟self::$trie相关,所以在self::$trie作修改的时候需要清除缓存。我用如下代码在浏览器中进行测试,跟之前对比,大概能有百分之二十左右的提升。像"是否和"一词在lyric.txt.中出现了8次,对它的处理就会比之前更快。
不知对 #27 会不会有所帮助。