@@ -34,8 +34,13 @@ namespace Timbl{
3434
3535 class Chopper {
3636 public:
37+ Chopper ():
38+ vSize (0 )
39+ {};
3740 virtual ~Chopper () {};
3841 virtual bool chop ( const icu::UnicodeString&, size_t ) = 0;
42+ const icu::UnicodeString& operator []( int i ) const {
43+ return choppedInput[i]; }
3944 const icu::UnicodeString& getField ( size_t i ) const {
4045 return choppedInput[i];
4146 };
@@ -68,24 +73,32 @@ namespace Timbl{
6873
6974 class ExChopper : public virtual Chopper {
7075 public:
71- double getExW () const { return exW; };
76+ ExChopper ():
77+ Chopper (),
78+ exW (-1.0 )
79+ {};
80+ double getExW () const override { return exW; };
7281 protected:
73- void init ( const icu::UnicodeString&, size_t , bool );
82+ void init ( const icu::UnicodeString&, size_t , bool ) override ;
7483 double exW;
7584 };
7685
7786 class OccChopper : public virtual Chopper {
7887 public:
79- int getOcc () const { return occ; };
88+ OccChopper ():
89+ Chopper (),
90+ occ (-1 )
91+ {};
92+ int getOcc () const override { return occ; };
8093 protected:
81- void init ( const icu::UnicodeString&, size_t , bool );
94+ void init ( const icu::UnicodeString&, size_t , bool ) override ;
8295 int occ;
8396 };
8497
8598 class C45_Chopper : public virtual Chopper {
8699 public:
87- bool chop ( const icu::UnicodeString&, size_t );
88- icu::UnicodeString getString () const ;
100+ bool chop ( const icu::UnicodeString&, size_t ) override ;
101+ icu::UnicodeString getString () const override ;
89102 };
90103
91104 class C45_ExChopper : public C45_Chopper , public ExChopper {
@@ -96,7 +109,7 @@ namespace Timbl{
96109
97110 class ARFF_Chopper : public C45_Chopper {
98111 public:
99- bool chop ( const icu::UnicodeString&, size_t );
112+ bool chop ( const icu::UnicodeString&, size_t ) override ;
100113 };
101114
102115 class ARFF_ExChopper : public C45_ExChopper {
@@ -107,8 +120,8 @@ namespace Timbl{
107120
108121 class Bin_Chopper : public virtual Chopper {
109122 public:
110- bool chop ( const icu::UnicodeString&, size_t );
111- icu::UnicodeString getString () const ;
123+ bool chop ( const icu::UnicodeString&, size_t ) override ;
124+ icu::UnicodeString getString () const override ;
112125 };
113126
114127 class Bin_ExChopper : public Bin_Chopper , public ExChopper {
@@ -120,8 +133,8 @@ namespace Timbl{
120133 class Compact_Chopper : public virtual Chopper {
121134 public:
122135 explicit Compact_Chopper ( int L ): fLen(L){};
123- bool chop ( const icu::UnicodeString&, size_t );
124- icu::UnicodeString getString () const ;
136+ bool chop ( const icu::UnicodeString&, size_t ) override ;
137+ icu::UnicodeString getString () const override ;
125138 private:
126139 int fLen ;
127140 Compact_Chopper ();
@@ -143,8 +156,8 @@ namespace Timbl{
143156
144157 class Columns_Chopper : public virtual Chopper {
145158 public:
146- bool chop ( const icu::UnicodeString&, size_t );
147- icu::UnicodeString getString () const ;
159+ bool chop ( const icu::UnicodeString&, size_t ) override ;
160+ icu::UnicodeString getString () const override ;
148161 };
149162
150163 class Columns_ExChopper : public Columns_Chopper , public ExChopper {
@@ -155,8 +168,8 @@ namespace Timbl{
155168
156169 class Tabbed_Chopper : public virtual Chopper {
157170 public:
158- bool chop ( const icu::UnicodeString&, size_t );
159- icu::UnicodeString getString () const ;
171+ bool chop ( const icu::UnicodeString&, size_t ) override ;
172+ icu::UnicodeString getString () const override ;
160173 };
161174
162175 class Tabbed_ExChopper : public Tabbed_Chopper , public ExChopper {
@@ -168,8 +181,8 @@ namespace Timbl{
168181
169182 class Sparse_Chopper : public virtual Chopper {
170183 public:
171- bool chop ( const icu::UnicodeString&, size_t );
172- icu::UnicodeString getString () const ;
184+ bool chop ( const icu::UnicodeString&, size_t ) override ;
185+ icu::UnicodeString getString () const override ;
173186 };
174187
175188 class Sparse_ExChopper : public Sparse_Chopper , public ExChopper {
0 commit comments