Commit Graph

11 Commits

Author SHA1 Message Date
Jeremy Wu
07310c7714 Fix pinyin fuzzysearch (#131)
* fix typo

* make function obsolete 

it is not used in the code

* rewrite the function that converts chinese chars to pinyin

1. Only difference in this rewrite is instead of returning 2D array, return as a combined single string of all the possible pinyin combination. Since fuzzy search does character matching, this shouldn't be a problem.

2. Added a function that returns a custom language converter. In this case Pinyin converter. New converters can be added.

* Use new language converter param + strip out ScoreForPinyin method

* update

* Change parameter name

* fix failing tests

* WIP

* Remove todo

There should be some distinction between score after precision filter and actual raw score derived from FuzzySearch. Although so far RawScore is used in testing, but it seems to describe the structure. Originally it was to avoid assigning score directly as it would be hard to reason about that output of FuzzySearch score is.

* Add constructors, remove default to enforce required properties

* remove setting rawscore in SearchPrecision

* Change method name to reflect intention

* Change parameter name + update comment

* update

* Remove params comment

Co-authored-by: theClueless <14300910+theClueless@users.noreply.github.com>
2020-01-20 01:06:16 +02:00
SysC0mp
7d5c827dec Remove whitespace 2019-12-09 21:08:38 +01:00
SysC0mp
78f243651e Pass Settings instance to Alphabet again 2019-12-09 20:47:24 +01:00
SysC0mp
3d55ad783e Only pass needed setting to Alphabet
As Alphabet class is static, its methods could be used without
ever calling Alphabet.initialize(_settings) beforehand which would end
in an exception.  Therefor only _shouldUsePinyin settings needed will
be transferred with a given default value.
2019-12-03 15:31:08 +01:00
AT
9d98d26cc7 added log into Alphabet service since it can induce a large perf hit 2019-11-16 01:28:07 +02:00
AT
dcb9e34d59 alphabet settings 2019-11-16 00:34:27 +02:00
bao-qian
e4e226b2c7 force pinyin library static constructor initialize #858 2017-02-12 17:22:56 +00:00
bao-qian
86b2391543 Cache for pinyin https://github.com/Wox-launcher/Wox/issues/1189 2017-02-12 16:57:41 +00:00
bao-qian
5cdc3e694f Add cache for pinyin query #858 2017-01-12 20:46:40 +00:00
bao-qian
a486319cc2 temp fix for slow pinyin query #1017 2017-01-12 02:16:53 +00:00
bao-qian
718bff7469 Refactoring pinyin
1. use custom patched pinyin library Pinyin4Net
2. fix memory leak on startup: 360mb -> 160mb when using vs15 debugger
2016-04-24 00:37:25 +01:00