Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60255587
editor_correction.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Apr 28, 16:38
Size
1 KB
Mime Type
text/x-python
Expires
Tue, Apr 30, 16:38 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17326238
Attached To
rNIETZSCHEPYTHON nietzsche-python
editor_correction.py
View Options
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" This class can be used to represent a word correction by the editors.
"""
# Copyright (C) University of Basel 2020 {{{1
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/> 1}}}
__author__
=
"Christian Steiner"
__maintainer__
=
__author__
__copyright__
=
'University of Basel'
__email__
=
"christian.steiner@unibas.ch"
__status__
=
"Development"
__license__
=
"GPL v3"
__version__
=
"0.0.1"
from
lxml
import
etree
as
ET
import
re
import
sys
from
.editor_comment
import
EditorComment
class
EditorCorrection
(
EditorComment
):
"""
This class represents a word correction by the editors.
"""
def
__init__
(
self
,
correction_text
=
''
,
is_uncertain
=
False
):
super
(
EditorCorrection
,
self
)
.
__init__
(
is_uncertain
=
is_uncertain
)
self
.
correction_text
=
correction_text
@classmethod
def
get_semantic_dictionary
(
cls
):
""" Creates a semantic dictionary as specified by SemanticClass.
"""
dictionary
=
super
(
EditorCorrection
,
cls
)
.
get_semantic_dictionary
()
dictionary
[
cls
.
PROPERTIES_KEY
]
.
update
(
cls
.
create_semantic_property_dictionary
(
'correction_text'
,
str
))
return
cls
.
return_dictionary_after_updating_super_classes
(
dictionary
)
Event Timeline
Log In to Comment