mastodon/spec
David Yip 05ee0aeb8b Allow keywords to match either substrings or whole words.
Word-boundary matching only works as intended in English and languages
that use similar word-breaking characters; it doesn't work so well in
(say) Japanese, Chinese, or Thai.  It's unacceptable to have a feature
that doesn't work as intended for some languages.  (Moreso especially
considering that it's likely that the largest contingent on the Mastodon
bit of the fediverse speaks Japanese.)

There are rules specified in Unicode TR29[1] for word-breaking across
all languages supported by Unicode, but the rules deliberately do not
cover all cases.  In fact, TR29 states

    For example, reliable detection of word boundaries in languages such
    as Thai, Lao, Chinese, or Japanese requires the use of dictionary
    lookup, analogous to English hyphenation.

So we aren't going to be able to make word detection work with regexes
within Mastodon (or glitchsoc).  However, for a first pass (even if it's
kind of punting) we can allow the user to choose whether they want word
or substring detection and warn about the limitations of this
implementation in, say, docs.

[1]: https://unicode.org/reports/tr29/
     https://web.archive.org/web/20171001005125/https://unicode.org/reports/tr29/
2017-10-21 14:54:36 -05:00
..
controllers Set up /settings/keyword_mutes. #164. 2017-10-21 14:54:36 -05:00
fabricators Add KeywordMute model. 2017-10-21 14:53:41 -05:00
features Add scenarios for log in (#3497) 2017-06-01 17:25:59 +02:00
fixtures Custom emoji (#4988) 2017-09-19 02:42:40 +02:00
helpers Set up /settings/keyword_mutes. #164. 2017-10-21 14:54:36 -05:00
lib hide mentions of muted accounts (in home col) (#190) 2017-10-20 10:49:54 -04:00
mailers Spec UserMailer (#3757) 2017-06-17 01:15:00 +02:00
models Allow keywords to match either substrings or whole words. 2017-10-21 14:54:36 -05:00
policies Add status destroy authorization to policy (#3453) 2017-05-30 22:56:31 +02:00
presenters Use around hook to restore context in InstancePresenter spec (#3430) 2017-05-30 09:03:35 -04:00
requests Redesign the landing page, mount public timeline on it (#4122) 2017-07-11 15:27:59 +02:00
routing Move create/destroy actions for api/v1/statuses to namespace (#3678) 2017-06-10 09:39:26 +02:00
services Merge remote-tracking branch 'origin/master' into gs-master 2017-10-16 01:29:02 -05:00
support Some minor change and spec for Account (#3813) 2017-06-22 18:34:27 +02:00
validators Fix StatusLengthValidator tests 2017-09-02 11:37:40 -05:00
views fix haml quotes in a bid to make travis less grumpy 2017-10-06 09:07:04 +02:00
workers Clean up reblog tracking keys, related improvements (#5428) 2017-10-17 11:45:06 +02:00
rails_helper.rb Fix #4058 - Use a long-lived cookie to keep track of user-level sessions (#4091) 2017-07-07 23:25:15 +02:00
spec_helper.rb Minor performance improvement for test suite (#4678) 2017-08-24 13:31:55 +02:00