1 /*
2   Copyright (c) 2006 - 2021
3   CLST  - Radboud University
4   ILK   - Tilburg University
5 
6   This file is part of libfolia
7 
8   libfolia is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 3 of the License, or
11   (at your option) any later version.
12 
13   libfolia is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17 
18   You should have received a copy of the GNU General Public License
19   along with this program; if not, see <http://www.gnu.org/licenses/>.
20 
21   For questions and suggestions, see:
22       https://github.com/LanguageMachines/ticcutils/issues
23   or send mail to:
24       lamasoftware (at ) science.ru.nl
25 */
26 
27 #ifndef PROPERTIES_H
28 #define PROPERTIES_H
29 
30 #include <set>
31 #include <string>
32 
33 namespace folia {
34   enum ElementType : unsigned int;
35   enum Attrib : int;
36   enum AnnotatorType: int;
37   enum AnnotationType : int;
38 
39   class properties {
40    public:
41     properties();
42     ElementType ELEMENT_ID;
43     std::string XMLTAG;
44     std::set<ElementType> ACCEPTED_DATA;
45     std::set<ElementType> REQUIRED_DATA;
46     Attrib REQUIRED_ATTRIBS;
47     Attrib OPTIONAL_ATTRIBS;
48     AnnotationType ANNOTATIONTYPE;
49     std::string SUBSET;
50     size_t OCCURRENCES;
51     size_t OCCURRENCES_PER_SET;
52     std::string TEXTDELIMITER;
53     bool PRINTABLE; // does text() work on this element
54     bool SPEAKABLE; // does phon() work on this element
55     bool WREFABLE;  // can this element be refered to by a wref?
56     bool HIDDEN;
57     bool XLINK;
58     bool AUTH;
59     bool SETONLY;
60     bool AUTO_GENERATE_ID;
61     bool TEXTCONTAINER;
62     bool PHONCONTAINER;
63     bool IMPLICITSPACE;
64     std::string LABEL;
65   };
66 
67   extern const std::set<std::string> AttributeFeatures;
68 
69   extern const std::map<ElementType,std::string> et_s_map;
70   extern const std::map<std::string,ElementType> s_et_map;
71 
72   extern const std::map<AnnotationType,std::string> ant_s_map;
73   extern const std::map<std::string,AnnotationType> s_ant_map;
74 
75   extern const std::map<AnnotationType, ElementType> annotationtype_elementtype_map;
76   extern std::map<ElementType,AnnotationType> element_annotation_map;
77 
78   extern const std::map<AnnotationType,std::string> annotationtype_xml_map;
79   extern const std::map<std::string,std::string> oldtags;
80   extern std::map<std::string,std::string> reverse_old;
81   extern std::map<ElementType,properties*> element_props;
82 
83   extern const std::set<ElementType> default_ignore;
84   extern const std::set<ElementType> default_ignore_annotations;
85   extern const std::set<ElementType> default_ignore_structure;
86   extern const std::set<ElementType> AnnoExcludeSet;
87   extern const std::set<ElementType> SpanSet;
88   extern const std::set<ElementType> wrefables;
89 
90   extern const int MAJOR_VERSION;
91   extern const int MINOR_VERSION;
92   extern const int SUB_VERSION;
93   extern const std::string NSFOLIA;
94   extern const std::string NSDCOI;
95   extern const std::string NSIMDI;
96   extern const std::string DEFAULT_TEXT_SET;
97   extern const std::string DEFAULT_PHON_SET;
98 
99   bool isAttributeFeature( const std::string& );
100 
101   void static_init();
102   void print_type_hierarchy( std::ostream& );
103 
104   extern const int XML_PARSER_OPTIONS;
105 }
106 
107 #endif
108