Browse Source

fix filterLang() to cut out 'twist:…=' links before processing

readme-update
Simon Grim 9 years ago
parent
commit
d2cd9cdea0
  1. 2
      js/mobile_abstract.js

2
js/mobile_abstract.js

@ -551,7 +551,7 @@ function filterLang(string) {
langFilterReason = polyglot.t('this doesnt contain that', {'this': polyglot.t(langFilterMode), 'that': polyglot.t('language of this')}); langFilterReason = polyglot.t('this doesnt contain that', {'this': polyglot.t(langFilterMode), 'that': polyglot.t('language of this')});
// before detection attempts we cut out any mentions and links, and replace _ with space // before detection attempts we cut out any mentions and links, and replace _ with space
langFilterSubj = string.replace(/@\S\w*|https?:\/\/\S*/g, '').replace(/_+/g, ' ') langFilterSubj = string.replace(/@\S\w*|https?:\/\/\S*|twist:\S\S\S\S\S\S\S\S\S\S\S=/g, '').replace(/_+/g, ' ')
// cut out common frequently used words FIXME I believe there is a list of similar international stuff somewhere outside which is waiting for us, we should just find it // cut out common frequently used words FIXME I believe there is a list of similar international stuff somewhere outside which is waiting for us, we should just find it
.replace(/\btwister|tox|github|linux|ubuntu|debian|windows|google|twitter|facebook|microsoft|ping|pong|email|javascript\b/ig, '') .replace(/\btwister|tox|github|linux|ubuntu|debian|windows|google|twitter|facebook|microsoft|ping|pong|email|javascript\b/ig, '')
// replace zero-width word boundaries, such as between letters from different alphabets [or other symbols], with spaces // replace zero-width word boundaries, such as between letters from different alphabets [or other symbols], with spaces

Loading…
Cancel
Save