Improve language filter (#5724)
* Scrub text of html before detecting language. * Detect language on statuses coming from activitypub. * Fix rubocop comments. * Remove custom emoji from text before language detection
This commit is contained in:
parent
9e3d24a150
commit
ad207456d6
2 changed files with 26 additions and 7 deletions
|
@ -173,7 +173,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
end
|
||||
|
||||
def language_from_content
|
||||
return nil unless language_map?
|
||||
return LanguageDetector.instance.detect(text_from_content, @account) unless language_map?
|
||||
@object['contentMap'].keys.first
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue