Commit Graph

21 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
Jeremy Wu
504c08a0fc Update test per comment 2020-01-14 07:53:59 +11:00
Jeremy Wu
592f1cafdb update allSubstringsContainedInCompareString calculation as per comment 2020-01-14 07:36:53 +11:00
Jeremy Wu
76727d09bf Update StringMatcher's UserSettingSearchPrecision property type
makes more sense and less conversion to int for actual precision score
2020-01-07 22:30:36 +11:00
Jeremy Wu
2a49b3899a Update tests
Two scoring changes only as a result of substring matching.
2020-01-07 20:26:26 +11:00
Jeremy Wu
24cc5dbaa0 Add unit tests for checking substrings
checking if all substrings contained in compareString
2020-01-07 07:55:02 +11:00
Jeremy Wu
13996740e0 Add additional test which should pass for regular precision 2020-01-07 07:12:34 +11:00
Jeremy Wu
f6d0738c79 debug logging 2020-01-02 08:04:16 +11:00
AT
42edb20b07 fixes to string matcher alg and some logging stuff 2019-12-30 01:13:33 +02:00
SysC0mp
ce89ff3c85 FIx test methods
Use RawScore or Score depending on the test case. Also removed
unnecessary test settings introduced earlier.
2019-12-09 21:08:17 +01:00
SysC0mp
2aeceb7ea8 Fix tests for new search precision handling 2019-12-03 15:31:23 +01:00
Amir Tepper
0e241a0fc5 added empty match option 2019-10-17 13:37:09 +03:00
Jeremy Wu
aae7987df0 update 2019-09-30 21:51:15 +10:00
Jeremy Wu
acd42f9cc6 Update test with updated method name 2019-09-29 14:43:49 +10:00
Jeremy Wu
d8a9630548 Update test 2019-09-29 14:27:07 +10:00
Jeremy Wu
9ab9ea4c2e Add precision score tests for new function 2019-09-29 13:27:28 +10:00
Jeremy Wu
df9b09eeae Add tests for fuzzy search and CalScore method 2019-09-29 00:09:03 +10:00
bao-qian
0daa3a8f57 ReSharper: remove redundant code 2016-01-06 21:34:42 +00:00
bao-qian
ad8b6c806d Optimize using directives 2015-10-30 23:23:01 +00:00
cxfksword
de13ad1cd5 Optimize fuzzy match 2014-03-24 21:14:10 +08:00
cxfksword
a9fa1fb66b add fuzzy string match support for Programs plugin 2014-02-09 01:39:23 +08:00