Python LMF library
 All Classes Namespaces Files Functions Variables
global_information.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 """! @package core
4 """
5 
6 from utils.attr import check_date_format
7 
9  """! "Global Information is a class for administrative information and other general attributes, such as /language coding/ or /script coding/, which are valid for the entire lexical resource." (LMF)
10  """
11  def __init__(self):
12  """! @brief Constructor.
13  GlobalInformation instance is owned by LexicalResource.
14  @return A GlobalInformation instance.
15  """
16  self.languageCode = None
17  self.author = None
18  self.version = None
19  self.lastUpdate = None
20  self.license = None
21  self.characterEncoding = None
22  self.dateCoding = None
23  self.creationDate = None
24  self.projectName = None
25  self.description = None
27 
28  def __del__(self):
29  """! @brief Destructor.
30  """
31  pass
32 
33  def set_languageCode(self, language_code):
34  """! @brief Set global information language code.
35  @param language_code The language code to use.
36  @return GlobalInformation instance.
37  """
38  self.languageCode = language_code
39  return self
40 
41  def get_languageCode(self):
42  """! @brief Get global information language code.
43  @return GlobalInformation attribute 'languageCode'.
44  """
45  return self.languageCode
46 
47  def set_version(self, version):
48  """! @brief Set global information version.
49  @param version The version to set.
50  @return GlobalInformation version.
51  """
52  self.version = version
53  return self
54 
55  def get_version(self):
56  """! @brief Get global information version.
57  @return GlobalInformation attribute 'version'.
58  """
59  return self.version
60 
61  def set_license(self, license):
62  """! @brief Set global information license.
63  @param license The license to set.
64  @return GlobalInformation instance.
65  """
66  self.license = license
67  return self
68 
69  def get_license(self):
70  """! @brief Get global information license.
71  @return GlobalInformation attribute 'license'.
72  """
73  return self.license
74 
75  def set_characterEncoding(self, character_encoding):
76  """! @brief Set global information character encoding.
77  @param character_encoding The character encoding to use.
78  @return GlobalInformation instance.
79  """
80  self.characterEncoding = character_encoding
81  return self
82 
84  """! @brief Get global information character encoding.
85  @return GlobalInformation attribute 'characterEncoding'.
86  """
87  return self.characterEncoding
88 
89  def set_dateCoding(self, date_coding):
90  """! @brief Set global information date coding.
91  @param date_coding The date coding to use.
92  @return GlobalInformation instance.
93  """
94  self.dateCoding = date_coding
95  return self
96 
97  def get_dateCoding(self):
98  """! @brief Get global information date coding.
99  @return GlobalInformation attribute 'dateCoding'.
100  """
101  return self.dateCoding
102 
103  def set_projectName(self, project_name):
104  """! @brief Set global information project name.
105  @param project_name The project name to set.
106  @return GlobalInformation instance.
107  """
108  self.projectName = project_name
109  return self
110 
111  def get_projectName(self):
112  """! @brief Get global information project name.
113  @return GlobalInformation attribute 'projectName'.
114  """
115  return self.projectName
116 
117  def set_creationDate(self, date):
118  """! @brief Set global information creation date.
119  @param date The date to set.
120  @return GlobalInformation instance.
121  """
122  check_date_format(date)
123  self.creationDate = date
124  return self
125 
126  def get_creationDate(self):
127  """! @brief Get global information creation date.
128  @return GlobalInformation attribute 'creationDate'.
129  """
130  return self.creationDate
131 
132  def set_lastUpdate(self, date):
133  """! @brief Set global information last update.
134  @param date The date to set.
135  @return GlobalInformation instance.
136  """
137  check_date_format(date)
138  self.lastUpdate = date
139  return self
140 
141  def get_lastUpdate(self):
142  """! @brief Get global information last update.
143  @return GlobalInformation attribute 'lastUpdate'.
144  """
145  return self.lastUpdate
146 
147  def set_author(self, author):
148  """! @brief Set global information author.
149  @param author The author's name to set.
150  @return GlobalInformation instance.
151  """
152  self.author = author
153  return self
154 
155  def get_author(self):
156  """! @brief Get global information author.
157  @return GlobalInformation attribute 'author'.
158  """
159  return self.author
160 
161  def set_description(self, description):
162  """! @brief Set global information description.
163  @param description The description to set.
164  @return GlobalInformation instance.
165  """
166  self.description = description
167  return self
168 
169  def get_description(self):
170  """! @brief Get global information description.
171  @return GlobalInformation attribute 'description'.
172  """
173  return self.description
174 
176  """! @brief Compute bibliographic citation from date and author.
177  Set GlobalInformation attribute 'bibliographicCitation'.
178  """
179  self.bibliographicCitation = "Online dictionaries"
180  if self.get_author() is not None:
181  self.bibliographicCitation += ", " + self.get_author()
182  if self.get_lastUpdate() is not None:
183  self.bibliographicCitation += ", " + self.get_lastUpdate()
184 
186  """! @brief Get global information bibliographic citation.
187  @return GlobalInformation attribute 'bibliographicCitation'.
188  """
190  return self.bibliographicCitation
def set_description
Set global information description.
def get_description
Get global information description.
def set_languageCode
Set global information language code.
def check_date_format
Verify that date format is composed as follows: YYYY-MM-DD (ISO 8601).
Definition: attr.py:48
def get_lastUpdate
Get global information last update.
def set_characterEncoding
Set global information character encoding.
def get_languageCode
Get global information language code.
def set_creationDate
Set global information creation date.
def set_projectName
Set global information project name.
def compute_bibliographicCitation
Compute bibliographic citation from date and author.
def get_characterEncoding
Get global information character encoding.
def get_dateCoding
Get global information date coding.
def set_dateCoding
Set global information date coding.
def get_bibliographicCitation
Get global information bibliographic citation.
def get_projectName
Get global information project name.
"Global Information is a class for administrative information and other general attributes, such as /language coding/ or /script coding/, which are valid for the entire lexical resource." (LMF)
def get_creationDate
Get global information creation date.
def set_lastUpdate
Set global information last update.