a8m / a8m/angular-filter

fuzzy and fuzzyBy produce false positives on long strings (too fuzzy?)

オープン
#173 コメント 0 件 リアクション 3 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
2.9k
フォーク
319
PR マージ指標
30日以内にマージされた PR はありません

説明

While testing the `fuzzy` and `fuzzyBy` filters on some sample text, I noticed they tend to match any search term for long string data. The longer the text string, the more likely it will match on words that barely resemble the search string. This makes it hard to use effectively, since the filtered results have a very low signal-to-noise ratio.

``` js
var $filter = angular.element(document.body).injector().get('$filter');
var arr = [
{ text: 'foo bar' },
{ text: 'Curabitur ultricies metus eu neque luctus, vitae efficitur ' +
'quam elementum. Aliquam convallis diam et pretium placerat. Morbi ' +
'tellus turpis, sollicitudin eu nunc et, mollis sodales lectus. ' +
'Pellentesque lacinia augue id risus condimentum bibendum.'
}
];
console.log($filter('fuzzy')(arr, 'foobar').length); // returns 2
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。