1 |
(****************************************************************** |
(****************************************************************** |
2 |
[LibNN - Neural Networks Library] |
[LibNN - Neural Networks Library] |
3 |
Copyright (C) 2002 - 2003 LAGACHERIE Matthieu RICORDEAU Olivier |
Copyright (C) 2002 - 2003 LAGACHERIE Matthieu RICORDEAU Olivier |
4 |
|
|
5 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
6 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
7 |
as published by the Free Software Foundation; either version 2 |
as published by the Free Software Foundation; either version 2 |
8 |
of the License, or (at your option) any later version. This |
of the License, or (at your option) any later version. This |
9 |
program is distributed in the hope that it will be useful, |
program is distributed in the hope that it will be useful, |
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
GNU General Public License for more details. You should have |
GNU General Public License for more details. You should have |
13 |
received a copy of the GNU General Public License |
received a copy of the GNU General Public License |
14 |
along with this program; if not, write to the Free Software |
along with this program; if not, write to the Free Software |
15 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
16 |
USA. |
USA. |
17 |
|
|
18 |
Author: |
Authors: |
19 |
LAGACHERIE Matthieu |
LAGACHERIE Matthieu |
20 |
Paper mail : 7 rue Delescluzes 94280 LE KREMLIN BICETRE, FRANCE |
Paper mail : 7 rue Delescluzes 94280 LE KREMLIN BICETRE, FRANCE |
21 |
E-mail : matthieu@marvinproject.org |
E-mail : matthieu@marvinproject.org |
22 |
|
|
23 |
RICORDEAU Olivier |
RICORDEAU Olivier |
24 |
Paper mail : 69 avenue d'Italie 75013 PARIS, FRANCE |
Paper mail : 69 avenue d'Italie 75013 PARIS, FRANCE |
25 |
E-mail : olivier@marvinproject.org |
E-mail : olivier@marvinproject.org |
26 |
|
|
27 |
*****************************************************************) |
*****************************************************************) |
28 |
|
|
29 |
|
|
30 |
(** The class Corpus of the LibNN |
(** |
31 |
|
The Corpus class |
32 |
|
A corpus is a set of several patterns. This set is stored in the _patterns |
33 |
|
attribute, which is a list of instances of the pattern class. |
34 |
|
|
35 |
@author Matthieu Lagacherie |
@author Matthieu Lagacherie |
36 |
@author Olivier Ricordeau |
@author Olivier Ricordeau |
37 |
|
@since 07/08/2003 |
38 |
|
@param 'a A class parameter. Actually, the 'a type is the pattern type. |
39 |
|
@see 'pattern.ml' Corpus is mainly designed to store instances of the pattern |
40 |
|
class. |
41 |
*) |
*) |
42 |
|
|
43 |
class ['a] corpus = |
class ['a] corpus = |
44 |
object |
object |
45 |
|
(** |
46 |
|
The patterns list. |
47 |
|
*) |
48 |
val mutable _patterns = [] |
val mutable _patterns = [] |
49 |
|
|
50 |
|
(** |
51 |
|
A get*. |
52 |
|
@return the patterns list. |
53 |
|
*) |
54 |
method getPatterns = _patterns |
method getPatterns = _patterns |
55 |
|
|
56 |
|
(** |
57 |
|
A get*. |
58 |
|
@return the nth pattern stored in the object. |
59 |
|
*) |
60 |
method getPattern index = List.nth _patterns index |
method getPattern index = List.nth _patterns index |
61 |
|
|
62 |
|
(** |
63 |
|
A get*. |
64 |
|
@return how many patterns are stored in the object. |
65 |
|
*) |
66 |
method getPatternNumber = List.length _patterns |
method getPatternNumber = List.length _patterns |
67 |
|
|
68 |
|
(** |
69 |
|
Adds a pattern to the object's patterns set. |
70 |
|
*) |
71 |
method addPattern (pattern : 'a) = List.append _patterns pattern |
method addPattern (pattern : 'a) = List.append _patterns pattern |
72 |
|
|
73 |
end |
end |