Completed
Pull Request — master (#18)
by Peter
08:28
created
AnalyzerText/Filter/Filter.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     protected function getPreviousWord($shift = 1)
78 78
     {
79
-        return $this->getNextWord($shift * -1);
79
+        return $this->getNextWord($shift*-1);
80 80
     }
81 81
 
82 82
     /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $position = $this->getText()->key();
92 92
 
93 93
         try {
94
-            $this->getText()->seek($position + $shift);
94
+            $this->getText()->seek($position+$shift);
95 95
         } catch (\OutOfBoundsException $e) {
96 96
             return null;
97 97
         }
Please login to merge, or discard this patch.
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -17,85 +17,85 @@
 block discarded – undo
17 17
  */
18 18
 abstract class Filter extends \FilterIterator
19 19
 {
20
-    /**
21
-     * @param Text $text
22
-     */
23
-    public function __construct(Text $text)
24
-    {
25
-        parent::__construct($text);
26
-    }
20
+	/**
21
+	 * @param Text $text
22
+	 */
23
+	public function __construct(Text $text)
24
+	{
25
+		parent::__construct($text);
26
+	}
27 27
 
28
-    /**
29
-     * Возвращает текущее слово.
30
-     *
31
-     * @return Word
32
-     */
33
-    public function current()
34
-    {
35
-        return $this->getInnerIterator()->current();
36
-    }
28
+	/**
29
+	 * Возвращает текущее слово.
30
+	 *
31
+	 * @return Word
32
+	 */
33
+	public function current()
34
+	{
35
+		return $this->getInnerIterator()->current();
36
+	}
37 37
 
38
-    /**
39
-     * Возвращает текст
40
-     *
41
-     * @return Text
42
-     */
43
-    public function getText()
44
-    {
45
-        return $this->getInnerIterator();
46
-    }
38
+	/**
39
+	 * Возвращает текст
40
+	 *
41
+	 * @return Text
42
+	 */
43
+	public function getText()
44
+	{
45
+		return $this->getInnerIterator();
46
+	}
47 47
 
48
-    /**
49
-     * Возвращает текст
50
-     *
51
-     * @return Text
52
-     */
53
-    public function getInnerIterator()
54
-    {
55
-        return parent::getInnerIterator();
56
-    }
48
+	/**
49
+	 * Возвращает текст
50
+	 *
51
+	 * @return Text
52
+	 */
53
+	public function getInnerIterator()
54
+	{
55
+		return parent::getInnerIterator();
56
+	}
57 57
 
58
-    /**
59
-     * Заменяет слово в тексте.
60
-     *
61
-     * @param Word $word Слово
62
-     */
63
-    protected function replace(Word $word)
64
-    {
65
-        $this->getInnerIterator()->replace($word);
66
-    }
58
+	/**
59
+	 * Заменяет слово в тексте.
60
+	 *
61
+	 * @param Word $word Слово
62
+	 */
63
+	protected function replace(Word $word)
64
+	{
65
+		$this->getInnerIterator()->replace($word);
66
+	}
67 67
 
68
-    /**
69
-     * Возвращает предыдущее слово.
70
-     *
71
-     * @param int|null $shift Смещение
72
-     *
73
-     * @return Word|null
74
-     */
75
-    protected function getPreviousWord($shift = 1)
76
-    {
77
-        return $this->getNextWord($shift * -1);
78
-    }
68
+	/**
69
+	 * Возвращает предыдущее слово.
70
+	 *
71
+	 * @param int|null $shift Смещение
72
+	 *
73
+	 * @return Word|null
74
+	 */
75
+	protected function getPreviousWord($shift = 1)
76
+	{
77
+		return $this->getNextWord($shift * -1);
78
+	}
79 79
 
80
-    /**
81
-     * Возвращает следующее слово.
82
-     *
83
-     * @param int|null $shift Смещение
84
-     *
85
-     * @return Word|null
86
-     */
87
-    protected function getNextWord($shift = 1)
88
-    {
89
-        $position = $this->getText()->key();
80
+	/**
81
+	 * Возвращает следующее слово.
82
+	 *
83
+	 * @param int|null $shift Смещение
84
+	 *
85
+	 * @return Word|null
86
+	 */
87
+	protected function getNextWord($shift = 1)
88
+	{
89
+		$position = $this->getText()->key();
90 90
 
91
-        try {
92
-            $this->getText()->seek($position + $shift);
93
-        } catch (\OutOfBoundsException $e) {
94
-            return null;
95
-        }
96
-        $word = $this->getText()->current();
97
-        $this->getText()->seek($position);
91
+		try {
92
+			$this->getText()->seek($position + $shift);
93
+		} catch (\OutOfBoundsException $e) {
94
+			return null;
95
+		}
96
+		$word = $this->getText()->current();
97
+		$this->getText()->seek($position);
98 98
 
99
-        return $word;
100
-    }
99
+		return $word;
100
+	}
101 101
 }
Please login to merge, or discard this patch.
AnalyzerText/Text/Word.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -14,57 +14,57 @@
 block discarded – undo
14 14
  */
15 15
 class Word
16 16
 {
17
-    /**
18
-     * Слово в тексте.
19
-     *
20
-     * @var string
21
-     */
22
-    protected $word = '';
17
+	/**
18
+	 * Слово в тексте.
19
+	 *
20
+	 * @var string
21
+	 */
22
+	protected $word = '';
23 23
 
24
-    /**
25
-     * Простая форма слова в тексте.
26
-     *
27
-     * @var string
28
-     */
29
-    protected $plain = '';
24
+	/**
25
+	 * Простая форма слова в тексте.
26
+	 *
27
+	 * @var string
28
+	 */
29
+	protected $plain = '';
30 30
 
31
-    /**
32
-     * @param string $word  Слово в тексте
33
-     * @param string $plain Простая форма слова в тексте
34
-     */
35
-    public function __construct($word, $plain)
36
-    {
37
-        $this->word = $word;
38
-        $this->plain = $plain;
39
-    }
31
+	/**
32
+	 * @param string $word  Слово в тексте
33
+	 * @param string $plain Простая форма слова в тексте
34
+	 */
35
+	public function __construct($word, $plain)
36
+	{
37
+		$this->word = $word;
38
+		$this->plain = $plain;
39
+	}
40 40
 
41
-    /**
42
-     * Возвращает слово из текста.
43
-     *
44
-     * @return string
45
-     */
46
-    public function getWord()
47
-    {
48
-        return $this->word;
49
-    }
41
+	/**
42
+	 * Возвращает слово из текста.
43
+	 *
44
+	 * @return string
45
+	 */
46
+	public function getWord()
47
+	{
48
+		return $this->word;
49
+	}
50 50
 
51
-    /**
52
-     * Возвращает простую форму слова из текста.
53
-     *
54
-     * @return string
55
-     */
56
-    public function getPlain()
57
-    {
58
-        return $this->plain;
59
-    }
51
+	/**
52
+	 * Возвращает простую форму слова из текста.
53
+	 *
54
+	 * @return string
55
+	 */
56
+	public function getPlain()
57
+	{
58
+		return $this->plain;
59
+	}
60 60
 
61
-    /**
62
-     * Возвращает слово.
63
-     *
64
-     * @return string
65
-     */
66
-    public function __toString()
67
-    {
68
-        return $this->word;
69
-    }
61
+	/**
62
+	 * Возвращает слово.
63
+	 *
64
+	 * @return string
65
+	 */
66
+	public function __toString()
67
+	{
68
+		return $this->word;
69
+	}
70 70
 }
Please login to merge, or discard this patch.
AnalyzerText/Filter/Informative.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -24,48 +24,48 @@
 block discarded – undo
24 24
  */
25 25
 class Informative extends Filter
26 26
 {
27
-    /**
28
-     * Список фильтров.
29
-     *
30
-     * @var array
31
-     */
32
-    private $filters = array();
27
+	/**
28
+	 * Список фильтров.
29
+	 *
30
+	 * @var array
31
+	 */
32
+	private $filters = array();
33 33
 
34
-    /**
35
-     * @param Text $iterator Текст
36
-     */
37
-    public function __construct(Text $iterator)
38
-    {
39
-        parent::__construct($iterator);
40
-        $this->filters = array(
41
-            new Interjection($this->getInnerIterator()),
42
-            new Particle($this->getInnerIterator()),
43
-            new Preposition($this->getInnerIterator()),
44
-            new Pronoun($this->getInnerIterator()),
45
-            new Union($this->getInnerIterator()),
46
-            new Adverb($this->getInnerIterator()),
47
-        );
48
-    }
34
+	/**
35
+	 * @param Text $iterator Текст
36
+	 */
37
+	public function __construct(Text $iterator)
38
+	{
39
+		parent::__construct($iterator);
40
+		$this->filters = array(
41
+			new Interjection($this->getInnerIterator()),
42
+			new Particle($this->getInnerIterator()),
43
+			new Preposition($this->getInnerIterator()),
44
+			new Pronoun($this->getInnerIterator()),
45
+			new Union($this->getInnerIterator()),
46
+			new Adverb($this->getInnerIterator()),
47
+		);
48
+	}
49 49
 
50
-    /**
51
-     * @see \FilterIterator::accept()
52
-     */
53
-    public function accept()
54
-    {
55
-        $word = $this->current();
56
-        // сначала ищем последовательности
57
-        foreach ($this->filters as $filter) {
58
-            if ($filter->isSequence($word)) {
59
-                return false;
60
-            }
61
-        }
62
-        // ищем простые и сложные формы
63
-        foreach ($this->filters as $filter) {
64
-            if ($filter->isSimple($word) || $filter->isComposite($word)) {
65
-                return false;
66
-            }
67
-        }
50
+	/**
51
+	 * @see \FilterIterator::accept()
52
+	 */
53
+	public function accept()
54
+	{
55
+		$word = $this->current();
56
+		// сначала ищем последовательности
57
+		foreach ($this->filters as $filter) {
58
+			if ($filter->isSequence($word)) {
59
+				return false;
60
+			}
61
+		}
62
+		// ищем простые и сложные формы
63
+		foreach ($this->filters as $filter) {
64
+			if ($filter->isSimple($word) || $filter->isComposite($word)) {
65
+				return false;
66
+			}
67
+		}
68 68
 
69
-        return true;
70
-    }
69
+		return true;
70
+	}
71 71
 }
Please login to merge, or discard this patch.
AnalyzerText/Filter/Factory.php 1 patch
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -20,87 +20,87 @@
 block discarded – undo
20 20
  */
21 21
 class Factory
22 22
 {
23
-    /**
24
-     * @var Analyzer
25
-     */
26
-    private $analyzer;
23
+	/**
24
+	 * @var Analyzer
25
+	 */
26
+	private $analyzer;
27 27
 
28
-    /**
29
-     * @param Analyzer $analyzer
30
-     */
31
-    public function __construct(Analyzer $analyzer)
32
-    {
33
-        $this->analyzer = $analyzer;
34
-    }
28
+	/**
29
+	 * @param Analyzer $analyzer
30
+	 */
31
+	public function __construct(Analyzer $analyzer)
32
+	{
33
+		$this->analyzer = $analyzer;
34
+	}
35 35
 
36
-    /**
37
-     * Применяет фильтр Informative.
38
-     *
39
-     * @return Factory
40
-     */
41
-    public function Informative()
42
-    {
43
-        return $this->apply(new Informative($this->analyzer->getText()));
44
-    }
36
+	/**
37
+	 * Применяет фильтр Informative.
38
+	 *
39
+	 * @return Factory
40
+	 */
41
+	public function Informative()
42
+	{
43
+		return $this->apply(new Informative($this->analyzer->getText()));
44
+	}
45 45
 
46
-    /**
47
-     * Применяет фильтр Preposition.
48
-     *
49
-     * @return Factory
50
-     */
51
-    public function Preposition()
52
-    {
53
-        return $this->apply(new Preposition($this->analyzer->getText()));
54
-    }
46
+	/**
47
+	 * Применяет фильтр Preposition.
48
+	 *
49
+	 * @return Factory
50
+	 */
51
+	public function Preposition()
52
+	{
53
+		return $this->apply(new Preposition($this->analyzer->getText()));
54
+	}
55 55
 
56
-    /**
57
-     * Применяет фильтр Pronoun.
58
-     *
59
-     * @return Factory
60
-     */
61
-    public function Pronoun()
62
-    {
63
-        return $this->apply(new Pronoun($this->analyzer->getText()));
64
-    }
56
+	/**
57
+	 * Применяет фильтр Pronoun.
58
+	 *
59
+	 * @return Factory
60
+	 */
61
+	public function Pronoun()
62
+	{
63
+		return $this->apply(new Pronoun($this->analyzer->getText()));
64
+	}
65 65
 
66
-    /**
67
-     * Применяет фильтр Union.
68
-     *
69
-     * @return Factory
70
-     */
71
-    public function Union()
72
-    {
73
-        return $this->apply(new Union($this->analyzer->getText()));
74
-    }
66
+	/**
67
+	 * Применяет фильтр Union.
68
+	 *
69
+	 * @return Factory
70
+	 */
71
+	public function Union()
72
+	{
73
+		return $this->apply(new Union($this->analyzer->getText()));
74
+	}
75 75
 
76
-    /**
77
-     * Применяет фильтр Adverb.
78
-     *
79
-     * @return Factory
80
-     */
81
-    public function Adverb()
82
-    {
83
-        return $this->apply(new Adverb($this->analyzer->getText()));
84
-    }
76
+	/**
77
+	 * Применяет фильтр Adverb.
78
+	 *
79
+	 * @return Factory
80
+	 */
81
+	public function Adverb()
82
+	{
83
+		return $this->apply(new Adverb($this->analyzer->getText()));
84
+	}
85 85
 
86
-    /**
87
-     * Применяет фильтр
88
-     *
89
-     * @param Filter $filter
90
-     *
91
-     * @return Factory
92
-     */
93
-    private function apply(Filter $filter)
94
-    {
95
-        if ($filter->getText()->count()) {
96
-            $words = array();
97
-            foreach ($filter as $word) {
98
-                $words[] = $word->getWord();
99
-            }
100
-            $text_class = get_class($filter->getText());
101
-            $this->analyzer->setText(new $text_class(implode(' ', $words)));
102
-        }
86
+	/**
87
+	 * Применяет фильтр
88
+	 *
89
+	 * @param Filter $filter
90
+	 *
91
+	 * @return Factory
92
+	 */
93
+	private function apply(Filter $filter)
94
+	{
95
+		if ($filter->getText()->count()) {
96
+			$words = array();
97
+			foreach ($filter as $word) {
98
+				$words[] = $word->getWord();
99
+			}
100
+			$text_class = get_class($filter->getText());
101
+			$this->analyzer->setText(new $text_class(implode(' ', $words)));
102
+		}
103 103
 
104
-        return $this;
105
-    }
104
+		return $this;
105
+	}
106 106
 }
Please login to merge, or discard this patch.
AnalyzerText/Analyzer/Analyzer.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -17,55 +17,55 @@
 block discarded – undo
17 17
  */
18 18
 abstract class Analyzer
19 19
 {
20
-    /**
21
-     * @var Text
22
-     */
23
-    protected $text;
20
+	/**
21
+	 * @var Text
22
+	 */
23
+	protected $text;
24 24
 
25
-    /**
26
-     * Устанавливает аналезируемый текст
27
-     *
28
-     * @param Text $text
29
-     *
30
-     * @return Analyzer
31
-     */
32
-    public function setText(Text $text)
33
-    {
34
-        $this->clear();
35
-        $this->text = $text;
25
+	/**
26
+	 * Устанавливает аналезируемый текст
27
+	 *
28
+	 * @param Text $text
29
+	 *
30
+	 * @return Analyzer
31
+	 */
32
+	public function setText(Text $text)
33
+	{
34
+		$this->clear();
35
+		$this->text = $text;
36 36
 
37
-        return $this;
38
-    }
37
+		return $this;
38
+	}
39 39
 
40
-    /**
41
-     * Возвращает список слов.
42
-     *
43
-     * @return Text
44
-     */
45
-    public function getText()
46
-    {
47
-        return $this->text;
48
-    }
40
+	/**
41
+	 * Возвращает список слов.
42
+	 *
43
+	 * @return Text
44
+	 */
45
+	public function getText()
46
+	{
47
+		return $this->text;
48
+	}
49 49
 
50
-    /**
51
-     * Очищает анализатор
52
-     *
53
-     * @return Analyzer
54
-     */
55
-    public function clear()
56
-    {
57
-        $this->text = null;
50
+	/**
51
+	 * Очищает анализатор
52
+	 *
53
+	 * @return Analyzer
54
+	 */
55
+	public function clear()
56
+	{
57
+		$this->text = null;
58 58
 
59
-        return $this;
60
-    }
59
+		return $this;
60
+	}
61 61
 
62
-    /**
63
-     * Возвращает фабрику фильтров для применения их.
64
-     *
65
-     * @return Factory
66
-     */
67
-    public function applyFilters()
68
-    {
69
-        return new Factory($this);
70
-    }
62
+	/**
63
+	 * Возвращает фабрику фильтров для применения их.
64
+	 *
65
+	 * @return Factory
66
+	 */
67
+	public function applyFilters()
68
+	{
69
+		return new Factory($this);
70
+	}
71 71
 }
Please login to merge, or discard this patch.
AnalyzerText/Text.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -18,75 +18,75 @@
 block discarded – undo
18 18
  */
19 19
 class Text extends \ArrayIterator
20 20
 {
21
-    /**
22
-     * Спиок всех слов в тексте в простой форме.
23
-     *
24
-     * @var array
25
-     */
26
-    protected $plains = array();
21
+	/**
22
+	 * Спиок всех слов в тексте в простой форме.
23
+	 *
24
+	 * @var array
25
+	 */
26
+	protected $plains = array();
27 27
 
28
-    /**
29
-     * @param string $text
30
-     */
31
-    public function __construct($text)
32
-    {
33
-        $words = array();
34
-        // слово не может начинаться с тире и не может содержать только его
35
-        if (preg_match_all('/[[:alnum:]]+(?:[-\'][[:alnum:]]+)*/u', trim(strip_tags($text)), $match)) {
36
-            $words = $match[0];
37
-            // получение списка слов в нижнем регистре
38
-            $this->plains = explode(' ', mb_strtolower(implode(' ', $words), 'utf8'));
39
-        }
40
-        parent::__construct($words);
41
-    }
28
+	/**
29
+	 * @param string $text
30
+	 */
31
+	public function __construct($text)
32
+	{
33
+		$words = array();
34
+		// слово не может начинаться с тире и не может содержать только его
35
+		if (preg_match_all('/[[:alnum:]]+(?:[-\'][[:alnum:]]+)*/u', trim(strip_tags($text)), $match)) {
36
+			$words = $match[0];
37
+			// получение списка слов в нижнем регистре
38
+			$this->plains = explode(' ', mb_strtolower(implode(' ', $words), 'utf8'));
39
+		}
40
+		parent::__construct($words);
41
+	}
42 42
 
43
-    /**
44
-     * Возвращает список слов.
45
-     *
46
-     * @return array
47
-     */
48
-    public function getWords()
49
-    {
50
-        return $this->getArrayCopy();
51
-    }
43
+	/**
44
+	 * Возвращает список слов.
45
+	 *
46
+	 * @return array
47
+	 */
48
+	public function getWords()
49
+	{
50
+		return $this->getArrayCopy();
51
+	}
52 52
 
53
-    /**
54
-     * Возвращает текущий элемент
55
-     *
56
-     * @return Word
57
-     */
58
-    public function current()
59
-    {
60
-        return new Word(parent::current(), $this->plains[$this->key()]);
61
-    }
53
+	/**
54
+	 * Возвращает текущий элемент
55
+	 *
56
+	 * @return Word
57
+	 */
58
+	public function current()
59
+	{
60
+		return new Word(parent::current(), $this->plains[$this->key()]);
61
+	}
62 62
 
63
-    /**
64
-     * Удаляет слово из текста.
65
-     */
66
-    public function remove()
67
-    {
68
-        $this->offsetUnset($this->key());
69
-        unset($this->plains[$this->key()]);
70
-    }
63
+	/**
64
+	 * Удаляет слово из текста.
65
+	 */
66
+	public function remove()
67
+	{
68
+		$this->offsetUnset($this->key());
69
+		unset($this->plains[$this->key()]);
70
+	}
71 71
 
72
-    /**
73
-     * Заменяет слово в тексте.
74
-     *
75
-     * @param Word $word
76
-     */
77
-    public function replace(Word $word)
78
-    {
79
-        $this->offsetSet($this->key(), $word->getWord());
80
-        $this->plains[$this->key()] = $word->getPlain();
81
-    }
72
+	/**
73
+	 * Заменяет слово в тексте.
74
+	 *
75
+	 * @param Word $word
76
+	 */
77
+	public function replace(Word $word)
78
+	{
79
+		$this->offsetSet($this->key(), $word->getWord());
80
+		$this->plains[$this->key()] = $word->getPlain();
81
+	}
82 82
 
83
-    /**
84
-     * Возвращает текст
85
-     *
86
-     * @return string
87
-     */
88
-    public function __toString()
89
-    {
90
-        return implode(' ', $this->getWords());
91
-    }
83
+	/**
84
+	 * Возвращает текст
85
+	 *
86
+	 * @return string
87
+	 */
88
+	public function __toString()
89
+	{
90
+		return implode(' ', $this->getWords());
91
+	}
92 92
 }
Please login to merge, or discard this patch.
AnalyzerText/Filter/WordList/Interjection.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -14,70 +14,70 @@
 block discarded – undo
14 14
  */
15 15
 class Interjection extends WordList
16 16
 {
17
-    /**
18
-     * Возвращает список слов.
19
-     *
20
-     * @return array
21
-     */
22
-    public function getWords()
23
-    {
24
-        return array(
25
-            // русские междометья
26
-            'ох',
27
-            'ого',
28
-            'ого',
29
-            'эй',
30
-            'эх',
31
-            'цып',
32
-            'брысь',
33
-            'aх',
34
-            'ух',
35
-            'брр',
36
-            'тпру',
37
-            'гм',
38
-            'дзинь',
39
-            'тс',
40
-            'цс',
41
-            'тьфу',
42
-            'ой',
43
-            'фу',
44
-            'фи',
45
-            'ага',
46
-            'апчи',
47
-            'браво',
48
-            'ж',
49
-            'буль',
50
-            'ку',
51
-            'хлоп',
52
-            'бац',
53
-            'бух',
54
-            'шлёп',
55
-            'бум',
56
-            'бах',
57
-            'пли',
58
-            'гав',
59
-            'мяу',
60
-            'тра',
61
-            'ишь',
62
-            'вишь',
63
-            'то-то',
64
-            'эка',
65
-            'ш',
66
-            'вот те раз',
67
-            'ну',
68
-            'типа',
69
-            'хватит',
70
-            'лады',
71
-            'ок',
72
-            'хорош',
73
-            'короче',
74
-            '/^а+(\-а+)*$/ui', // ААааа Аааа-а-а
17
+	/**
18
+	 * Возвращает список слов.
19
+	 *
20
+	 * @return array
21
+	 */
22
+	public function getWords()
23
+	{
24
+		return array(
25
+			// русские междометья
26
+			'ох',
27
+			'ого',
28
+			'ого',
29
+			'эй',
30
+			'эх',
31
+			'цып',
32
+			'брысь',
33
+			'aх',
34
+			'ух',
35
+			'брр',
36
+			'тпру',
37
+			'гм',
38
+			'дзинь',
39
+			'тс',
40
+			'цс',
41
+			'тьфу',
42
+			'ой',
43
+			'фу',
44
+			'фи',
45
+			'ага',
46
+			'апчи',
47
+			'браво',
48
+			'ж',
49
+			'буль',
50
+			'ку',
51
+			'хлоп',
52
+			'бац',
53
+			'бух',
54
+			'шлёп',
55
+			'бум',
56
+			'бах',
57
+			'пли',
58
+			'гав',
59
+			'мяу',
60
+			'тра',
61
+			'ишь',
62
+			'вишь',
63
+			'то-то',
64
+			'эка',
65
+			'ш',
66
+			'вот те раз',
67
+			'ну',
68
+			'типа',
69
+			'хватит',
70
+			'лады',
71
+			'ок',
72
+			'хорош',
73
+			'короче',
74
+			'/^а+(\-а+)*$/ui', // ААааа Аааа-а-а
75 75
 
76
-            // английские междометья
77
-            'ok',
78
-            'oh',
79
-            'ah',
80
-            'bravo',
81
-        );
82
-    }
76
+			// английские междометья
77
+			'ok',
78
+			'oh',
79
+			'ah',
80
+			'bravo',
81
+		);
82
+	}
83 83
 }
Please login to merge, or discard this patch.
AnalyzerText/Filter/WordList/Particle.php 1 patch
Indentation   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -14,147 +14,147 @@
 block discarded – undo
14 14
  */
15 15
 class Particle extends WordList
16 16
 {
17
-    /**
18
-     * Возвращает список слов.
19
-     *
20
-     * @return array
21
-     */
22
-    public function getWords()
23
-    {
24
-        return array(
25
-            // русские междометья
26
-            'пусть',
27
-            'пускай',
28
-            'давайте',
29
-            'да',
30
-            'давай',
31
-            'бы,',
32
-            'б',
33
-            'бывало',
34
-            'не',
35
-            'ни',
36
-            'ли',
37
-            'неужели',
38
-            'разве',
39
-            'вот',
40
-            'вон',
41
-            'именно',
42
-            'только',
43
-            'лишь',
44
-            'исключительно',
45
-            'единственно',
46
-            'как',
47
-            'даже',
48
-            'же',
49
-            'ведь',
50
-            'уж',
51
-            'все-таки',
52
-            'пусть',
53
-            'бишь',
54
-            'вишь',
55
-            'де',
56
-            'дескать',
57
-            'ин',
58
-            'ишь',
59
-            'мол',
60
-            'небось',
61
-            'нет',
62
-            'неужели',
63
-            'нехай',
64
-            'ну-с',
65
-            'сём',
66
-            'сем',
67
-            'таки',
68
-            'те',
69
-            'уж',
70
-            'а',
71
-            'благо',
72
-            'более',
73
-            'больше',
74
-            'буквально',
75
-            'бывает',
76
-            'бывало',
77
-            'было',
78
-            'будто',
79
-            'ведь',
80
-            'во',
81
-            'вовсе',
82
-            'вон',
83
-            'вот',
84
-            'вроде',
85
-            'всё',
86
-            'все',
87
-            'всего',
88
-            'где',
89
-            'гляди',
90
-            'да',
91
-            'давай',
92
-            'давайте',
93
-            'даже',
94
-            'дай',
95
-            'дайте',
96
-            'действительно',
97
-            'единственно',
98
-            'если',
99
-            'ещё',
100
-            'знай',
101
-            'и',
102
-            'или',
103
-            'менно',
104
-            'как',
105
-            'какое',
106
-            'куда',
107
-            'ладно',
108
-            'ли',
109
-            'лучше',
110
-            'никак',
111
-            'ничего',
112
-            'нечего',
113
-            'однако',
114
-            'окончательно',
115
-            'оно',
116
-            'поди',
117
-            'положительно',
118
-            'просто',
119
-            'прямо',
120
-            'пусть',
121
-            'пускай',
122
-            'разве',
123
-            'решительно',
124
-            'ровно',
125
-            'самое',
126
-            'себе',
127
-            'скорее',
128
-            'словно',
129
-            'совершенно',
130
-            'спасибо',
131
-            'так',
132
-            'там',
133
-            'тебе',
134
-            'тоже',
135
-            'только',
136
-            'точно',
137
-            'хоть',
138
-            'чего',
139
-            'чисто',
140
-            'что',
141
-            'чтоб',
142
-            'чтобы',
143
-            'эк',
144
-            'это',
145
-            '*-ка',
146
-            '*-то',
147
-            '*-с',
148
-            'вовсе не',
149
-            'далеко не',
150
-            'отнюдь не',
151
-            'почти что',
152
-            'как раз',
153
-            'что за',
154
-            'вряд ли',
155
-            'едва ли',
17
+	/**
18
+	 * Возвращает список слов.
19
+	 *
20
+	 * @return array
21
+	 */
22
+	public function getWords()
23
+	{
24
+		return array(
25
+			// русские междометья
26
+			'пусть',
27
+			'пускай',
28
+			'давайте',
29
+			'да',
30
+			'давай',
31
+			'бы,',
32
+			'б',
33
+			'бывало',
34
+			'не',
35
+			'ни',
36
+			'ли',
37
+			'неужели',
38
+			'разве',
39
+			'вот',
40
+			'вон',
41
+			'именно',
42
+			'только',
43
+			'лишь',
44
+			'исключительно',
45
+			'единственно',
46
+			'как',
47
+			'даже',
48
+			'же',
49
+			'ведь',
50
+			'уж',
51
+			'все-таки',
52
+			'пусть',
53
+			'бишь',
54
+			'вишь',
55
+			'де',
56
+			'дескать',
57
+			'ин',
58
+			'ишь',
59
+			'мол',
60
+			'небось',
61
+			'нет',
62
+			'неужели',
63
+			'нехай',
64
+			'ну-с',
65
+			'сём',
66
+			'сем',
67
+			'таки',
68
+			'те',
69
+			'уж',
70
+			'а',
71
+			'благо',
72
+			'более',
73
+			'больше',
74
+			'буквально',
75
+			'бывает',
76
+			'бывало',
77
+			'было',
78
+			'будто',
79
+			'ведь',
80
+			'во',
81
+			'вовсе',
82
+			'вон',
83
+			'вот',
84
+			'вроде',
85
+			'всё',
86
+			'все',
87
+			'всего',
88
+			'где',
89
+			'гляди',
90
+			'да',
91
+			'давай',
92
+			'давайте',
93
+			'даже',
94
+			'дай',
95
+			'дайте',
96
+			'действительно',
97
+			'единственно',
98
+			'если',
99
+			'ещё',
100
+			'знай',
101
+			'и',
102
+			'или',
103
+			'менно',
104
+			'как',
105
+			'какое',
106
+			'куда',
107
+			'ладно',
108
+			'ли',
109
+			'лучше',
110
+			'никак',
111
+			'ничего',
112
+			'нечего',
113
+			'однако',
114
+			'окончательно',
115
+			'оно',
116
+			'поди',
117
+			'положительно',
118
+			'просто',
119
+			'прямо',
120
+			'пусть',
121
+			'пускай',
122
+			'разве',
123
+			'решительно',
124
+			'ровно',
125
+			'самое',
126
+			'себе',
127
+			'скорее',
128
+			'словно',
129
+			'совершенно',
130
+			'спасибо',
131
+			'так',
132
+			'там',
133
+			'тебе',
134
+			'тоже',
135
+			'только',
136
+			'точно',
137
+			'хоть',
138
+			'чего',
139
+			'чисто',
140
+			'что',
141
+			'чтоб',
142
+			'чтобы',
143
+			'эк',
144
+			'это',
145
+			'*-ка',
146
+			'*-то',
147
+			'*-с',
148
+			'вовсе не',
149
+			'далеко не',
150
+			'отнюдь не',
151
+			'почти что',
152
+			'как раз',
153
+			'что за',
154
+			'вряд ли',
155
+			'едва ли',
156 156
 
157
-            // английские междометья
158
-        );
159
-    }
157
+			// английские междометья
158
+		);
159
+	}
160 160
 }
Please login to merge, or discard this patch.
AnalyzerText/Filter/WordList/Preposition.php 1 patch
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -14,79 +14,79 @@
 block discarded – undo
14 14
  */
15 15
 class Preposition extends WordList
16 16
 {
17
-    /**
18
-     * Возвращает список слов.
19
-     *
20
-     * @return array
21
-     */
22
-    public function getWords()
23
-    {
24
-        return array(
25
-            // русские предлоги
26
-            'без',
27
-            'в',
28
-            'до',
29
-            'для',
30
-            'за',
31
-            'из',
32
-            'к',
33
-            'ко',
34
-            'на',
35
-            'над',
36
-            'о',
37
-            'об',
38
-            'обо',
39
-            'от',
40
-            'по',
41
-            'под',
42
-            'пред',
43
-            'при',
44
-            'про',
45
-            'с',
46
-            'у',
47
-            'через',
48
-            'со',
49
-            'из-за',
50
-            'из-под',
51
-            'около',
52
-            'близ',
17
+	/**
18
+	 * Возвращает список слов.
19
+	 *
20
+	 * @return array
21
+	 */
22
+	public function getWords()
23
+	{
24
+		return array(
25
+			// русские предлоги
26
+			'без',
27
+			'в',
28
+			'до',
29
+			'для',
30
+			'за',
31
+			'из',
32
+			'к',
33
+			'ко',
34
+			'на',
35
+			'над',
36
+			'о',
37
+			'об',
38
+			'обо',
39
+			'от',
40
+			'по',
41
+			'под',
42
+			'пред',
43
+			'при',
44
+			'про',
45
+			'с',
46
+			'у',
47
+			'через',
48
+			'со',
49
+			'из-за',
50
+			'из-под',
51
+			'около',
52
+			'близ',
53 53
 
54
-            // английские предлоги
55
-            'at',
56
-            'on',
57
-            'in',
58
-            'about',
59
-            'above',
60
-            'below',
61
-            'during',
62
-            'after',
63
-            'before',
64
-            'by',
65
-            'for',
66
-            'from',
67
-            'of',
68
-            'since',
69
-            'to',
70
-            'till',
71
-            'with',
72
-            'up',
73
-            'down',
74
-            'off',
75
-            'onto',
76
-            'towards',
77
-            'away',
78
-            'through',
79
-            'into',
80
-            'along',
81
-            'past',
82
-            'across',
83
-            'over',
84
-            'between',
85
-            'under',
86
-            'outside',
87
-            'the',
88
-            'a',
89
-            'are',
90
-        );
91
-    }
54
+			// английские предлоги
55
+			'at',
56
+			'on',
57
+			'in',
58
+			'about',
59
+			'above',
60
+			'below',
61
+			'during',
62
+			'after',
63
+			'before',
64
+			'by',
65
+			'for',
66
+			'from',
67
+			'of',
68
+			'since',
69
+			'to',
70
+			'till',
71
+			'with',
72
+			'up',
73
+			'down',
74
+			'off',
75
+			'onto',
76
+			'towards',
77
+			'away',
78
+			'through',
79
+			'into',
80
+			'along',
81
+			'past',
82
+			'across',
83
+			'over',
84
+			'between',
85
+			'under',
86
+			'outside',
87
+			'the',
88
+			'a',
89
+			'are',
90
+		);
91
+	}
92 92
 }
Please login to merge, or discard this patch.