Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
team1920-SpeechComparison
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
msdt
team1920-SpeechComparison
Merge requests
!132
Sc 187/cleanup and docstrings
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Sc 187/cleanup and docstrings
SC-187/cleanup-and_docstrings
into
review-window
Overview
2
Commits
9
Pipelines
0
Changes
5
Closed
Nijsen, T.J.P. (Thomas)
requested to merge
SC-187/cleanup-and_docstrings
into
review-window
5 years ago
Overview
2
Commits
9
Pipelines
0
Changes
5
Expand
Created doc strings where missing.
0
0
Merge request reports
Viewing commit
55356a69
Prev
Next
Show latest version
5 files
+
91
−
145
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
55356a69
started finalizing doctring
· 55356a69
Hees, L.J.H. (Laurens)
authored
5 years ago
umbra/alignment_strategy.py
+
4
−
28
Options
@@ -5,39 +5,15 @@ class AlignmentStrategy(ABC):
@abstractmethod
def
__str__
(
self
):
"""
Provide
s
a
s
tring representation of the AlignmentStrategy.
"""
"""
Provide a
S
tring representation of the AlignmentStrategy.
"""
pass
@abstractmethod
def
align
(
self
,
source
,
shadow
):
"""
Align
the
source and shadow Sentences.
"""
Align
a pair of
source and shadow Sentences.
Args:
source: The Sentence of
words in the source file
shadow: The Sentence of
words in the shadow file
source: The Sentence of
SourceWords
shadow: The Sentence of
ShadowWords
"""
pass
@staticmethod
def
correctly_shadowed
(
source_words
):
"""
Give a summary of the results.
Args:
source_words: The Sentence of Words in the source file
Returns:
total_words: Total number of Words to be shadowed
correct: Number of correctly shadowed Words
skipped: Number of Words skipped
"""
total_words
=
0
correct
=
0
skipped
=
0
for
source_word
in
source_words
:
total_words
+=
1
if
source_word
.
shadowed
:
correct
+=
1
else
:
skipped
+=
1
return
total_words
,
correct
,
skipped
Loading