Changed the gerund rule to something that works for cases in Afrikaans.
[apertium.git] / apertium-tagger-training-tools-unicode / src / Segment.H
blob41b4fd06836c0dccc715ca6dbc7c53d684ec69db
1 /*
2  * Copyright (C) 2004-2006 Felipe Sánchez-Martínez
3  * Copyright (C) 2006 Universitat d'Alacant
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18  * 02111-1307, USA.
19  */
20 /**
21  * Class Segment. It define a text segment  (header file)
22  *
23  *  @author   Felipe Sánchez-Martínez - fsanchez@dlsi.ua.es
24  */
26 #ifndef __SEGMENT_H
27 #define __SEGMENT_H
29 #include <set>
30 #include <map>
31 #include <iostream>
32 #include <string>
33 #include <vector>
35 #include <apertium/tagger_word.h>
36 #include <apertium/tagger_data.h>
37 #include <apertium/morpho_stream.h>
38 #include <apertium/tagger_utils.h>
40 #include "StringCollection.H"
41 #include "TransferRules.H"
43 #define TAGGER_WORD_BUFFER_SIZE 100
45 using namespace std;
47 class Segment  {
48 private:
49   static map<wstring, TTag, Ltstr> tag_index;
51   int npaths;
53   vector< vector<TTag> > contador_caminos; //Vector con las etiquetas de cada nodo del segmento
55   vector<int> nfijo_caminos;  //Vector con el nº veces que debe usarse
56                               //un etiqueta antes de pasar a la siguiente
57 public:
59   vector<TaggerWord> vwords;
61   vector<TaggerWord> vwords_before;
62   vector<TaggerWord> vwords_after;
63   
64   Segment();
66   static Segment* new_segment(MorphoStream &ms, TransferRules* tr, TaggerData &td);
68   int get_number_paths();
70   static void set_tag_index(map<wstring, TTag, Ltstr> ti);
71    
72   wstring get_path(vector <TTag>& etqpart, int path);                
75 #endif