Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
fe9fdb6b
"README.md" did not exist on "5958a3e3fadc47f8d986870a79c80f3b3588b37a"
Commit
fe9fdb6b
authored
13 years ago
by
ilor
Browse files
Options
Downloads
Patches
Plain Diff
sentence cleanup WIP
parent
e70ded36
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libwccl/sentencecontext.h
+16
-3
16 additions, 3 deletions
libwccl/sentencecontext.h
with
16 additions
and
3 deletions
libwccl/sentencecontext.h
+
16
−
3
View file @
fe9fdb6b
...
...
@@ -21,10 +21,12 @@ public:
/// Constructor, wraps the Sentence and sets position to 0
explicit
SentenceContext
(
const
boost
::
shared_ptr
<
Corpus2
::
Sentence
>&
s
);
/// Returns a copy of this with a cloned underlyi
o
ng sentence
/// Returns a copy of this with a cloned underlying sentence
.
SentenceContext
duplicate
()
const
;
/// Cloning -- clones the underlying sentence as well
/// Note: slower than duplicate() and less useful since you should
/// prefer to keep SentenceContexts as values, not pointers
SentenceContext
*
clone
()
const
;
/// Underlying sentence accessor
...
...
@@ -107,7 +109,7 @@ public:
++
position_
;
}
/// Res
t
e position to point to the first token
/// Rese
t
position to point to the first token
void
goto_start
()
{
position_
=
0
;
}
...
...
@@ -152,10 +154,21 @@ public:
return
at
(
position_
);
}
/// Translate a Position into an absolute index into
/// the Sentence wrapped by this SentenceContext.
/// This takes proper care of the special `begin',
/// `end' and `nowhere' Positions.
int
get_abs_position
(
const
Position
&
position
)
const
;
/// Translate a Position into an relative index into
/// the Sentence wrapped by this SentenceContext.
/// (Relative to the current position).
/// This takes proper care of the special `begin',
/// `end' and `nowhere' Positions.
int
get_rel_position
(
const
Position
&
position
)
const
;
/// Helper function for translatin special Positions
/// (`begin', `end' and `nowhere')
int
translate_special_position
(
int
pos
)
const
{
switch
(
pos
)
{
case
Position
::
Begin
:
...
...
@@ -168,8 +181,8 @@ public:
return
position_
+
pos
;
}
}
private
:
private
:
/// The wrapped sentence
boost
::
shared_ptr
<
Corpus2
::
Sentence
>
sentence_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment