1 | <?php |
||
29 | class MoreLike |
||
30 | { |
||
31 | /** |
||
32 | * Models to search from similar |
||
33 | * @var AnnotatedInterface[] |
||
34 | */ |
||
35 | public $models = []; |
||
36 | |||
37 | /** |
||
38 | * A list of fields to fetch and analyze the text from. Defaults to the _all field for free text and to all |
||
39 | * possible fields for document inputs. |
||
40 | * @var array |
||
41 | */ |
||
42 | public $fields = []; |
||
43 | |||
44 | /** |
||
45 | * |
||
46 | * The unlike parameter is used in conjunction with like in order not to select terms found in a chosen set of |
||
47 | * documents. In other words, we could ask for documents like: "Apple", but unlike: "cake crumble tree". The syntax |
||
48 | * is the same as like. |
||
49 | * @var array |
||
50 | */ |
||
51 | public $unlike = []; |
||
52 | |||
53 | /** |
||
54 | * Extra text to search for |
||
55 | * @var string[] |
||
56 | */ |
||
57 | public $texts = []; |
||
58 | |||
59 | /** |
||
60 | * The maximum number of query terms that will be selected. Increasing this value gives greater accuracy at the |
||
61 | * expense of query execution speed. |
||
62 | * @var int |
||
63 | */ |
||
64 | public $maxQueryTerms = 25; |
||
65 | |||
66 | /** |
||
67 | * The minimum term frequency below which the terms will be ignored from the input document. |
||
68 | * @var int |
||
69 | */ |
||
70 | public $minTermFreq = 2; |
||
71 | |||
72 | /** |
||
73 | * The minimum document frequency below which the terms will be ignored from the input document. |
||
74 | * @var int |
||
75 | */ |
||
76 | public $minDocFreq = 5; |
||
77 | |||
78 | /** |
||
79 | * The maximum document frequency above which the terms will be ignored from the input document. This could be |
||
80 | * useful in order to ignore highly frequent words such as stop words |
||
81 | * @var int |
||
82 | */ |
||
83 | public $maxDocFreq = null; |
||
84 | |||
85 | /** |
||
86 | * The minimum word length below which the terms will be ignored. The old name min_word_len is deprecated. |
||
87 | * @var int |
||
88 | */ |
||
89 | public $minWordLength = 0; |
||
90 | |||
91 | /** |
||
92 | * The maximum word length above which the terms will be ignored. The old name max_word_len is deprecated. |
||
93 | * @var int |
||
94 | */ |
||
95 | public $maxWordLength = null; |
||
96 | |||
97 | /** |
||
98 | * An array of stop words. Any word in this set is considered "uninteresting" and ignored. If the analyzer allows |
||
99 | * for stop words, you might want to tell MLT to explicitly ignore them, as for the purposes of document similarity |
||
100 | * it seems reasonable to assume that "a stop word is never interesting". |
||
101 | * @var array |
||
102 | */ |
||
103 | public $stopWords = []; |
||
104 | |||
105 | /** |
||
106 | * MoreLikeOptions constructor. |
||
107 | * @param AnnotatedInterface|AnnotatedInterface[]|DataProviderInterface|null $models |
||
108 | */ |
||
109 | public function __construct($models = null) |
||
124 | |||
125 | public function toArray() |
||
197 | } |