52 |
|
|
53 |
class corpus = |
class corpus = |
54 |
object |
object |
55 |
|
|
56 |
(** |
(** |
57 |
The patterns list. |
The patterns list. |
58 |
*) |
*) |
67 |
A get*. |
A get*. |
68 |
@return the patterns list. |
@return the patterns list. |
69 |
*) |
*) |
70 |
method getPatterns = _patterns |
method getPatterns = |
71 |
|
_patterns |
72 |
|
|
73 |
(** |
(** |
74 |
A get*. |
A get*. |
75 |
@return the nth pattern stored in the object. |
@return the nth pattern stored in the object. |
76 |
*) |
*) |
77 |
method getPattern index = List.nth _patterns index |
method getPattern index = |
78 |
|
List.nth _patterns index |
79 |
|
|
80 |
(** |
(** |
81 |
A get*. |
A get*. |
82 |
@return how many patterns are stored in the object. |
@return how many patterns are stored in the object. |
83 |
*) |
*) |
84 |
method getPatternNumber = List.length _patterns |
method getPatternNumber = |
85 |
|
List.length _patterns |
86 |
|
|
87 |
(** |
(** |
88 |
Adds a pattern to the object's patterns set. |
Adds a pattern to the object's patterns set. |
89 |
*) |
*) |
90 |
method addPattern (thePattern : pattern) = _patterns <- thePattern::_patterns |
method addPattern (thePattern : pattern) = |
91 |
|
_patterns <- thePattern::_patterns |
92 |
|
|
93 |
(** |
(** |
94 |
Get the current learning position |
Get the current learning position |
95 |
*) |
*) |
96 |
method getLearnPos = _learnPos |
method getLearnPos = |
97 |
|
_learnPos |
98 |
|
|
99 |
(** |
(** |
100 |
Increment the current learning position. |
Increment the current learning position. |
110 |
(** |
(** |
111 |
Get the current input learning vector. |
Get the current input learning vector. |
112 |
*) |
*) |
113 |
method getInputLearnVector pos = (List.nth _patterns (fst pos))#getInput (snd pos) |
method getInputLearnVector pos = |
114 |
|
(List.nth _patterns (fst pos))#getInput (snd pos) |
115 |
|
|
116 |
(** |
(** |
117 |
Get the current output learning vector. |
Get the current output learning vector. |
118 |
*) |
*) |
119 |
method getOutputLearnVector pos = (List.nth _patterns (fst pos))#getOutput (snd pos) |
method getOutputLearnVector pos = |
120 |
|
(List.nth _patterns (fst pos))#getOutput (snd pos) |
121 |
|
|
122 |
end |
end |