/** * Set the stop words array. * * @param array $words * @return void */ public function setStopWords(array $words) { $this->stopWords = Ary::flatten(array_map(function ($w) { return Str::normalize($w); }, $words)); }
public function testFlatten() { $this->assertEquals(['a', 'b', 'c', 'd', 'e'], Ary::flatten([['a', ['b', ['c']]], 'd', ['e']])); $this->assertEquals([1, 2, 3, 4, 5], Ary::flatten([[1, [2, 3], [[4, [5]]]]])); }