Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
corpus2
Commits
3add93fc
Commit
3add93fc
authored
Nov 15, 2011
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
Added class that represents directed relation
parent
b6b6351e
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
libcorpus2/CMakeLists.txt
+1
-0
1 addition, 0 deletions
libcorpus2/CMakeLists.txt
libcorpus2/relation.cpp
+32
-0
32 additions, 0 deletions
libcorpus2/relation.cpp
libcorpus2/relation.h
+107
-0
107 additions, 0 deletions
libcorpus2/relation.h
with
140 additions
and
0 deletions
libcorpus2/CMakeLists.txt
+
1
−
0
View file @
3add93fc
...
...
@@ -44,6 +44,7 @@ SET(libcorpus2_STAT_SRC
document.cpp
exception.cpp
lexeme.cpp
relation.cpp
sentence.cpp
tag.cpp
tagging.cpp
...
...
This diff is collapsed.
Click to expand it.
libcorpus2/relation.cpp
0 → 100644
+
32
−
0
View file @
3add93fc
/*
Copyright (C) 2010 Tomasz Śniatowski, Adam Radziszewski, Paweł Kędzia
Part of the libcorpus2 project
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 LICENSE and COPYING files for more details.
*/
#include
<libcorpus2/relation.h>
namespace
Corpus2
{
Relation
::
Relation
(
const
std
::
string
&
name
,
const
boost
::
shared_ptr
<
const
DirectionPoint
>
from
,
const
boost
::
shared_ptr
<
const
DirectionPoint
>
to
)
:
name_
(
name
),
from_
(
from
),
to_
(
to
)
{
}
Relation
::~
Relation
()
{
}
}
/* end ns Corpus2 */
This diff is collapsed.
Click to expand it.
libcorpus2/relation.h
0 → 100644
+
107
−
0
View file @
3add93fc
/*
Copyright (C) 2010 Tomasz Śniatowski, Adam Radziszewski, Paweł Kędzia
Part of the libcorpus2 project
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 LICENSE and COPYING files for more details.
*/
#ifndef LIBCORPUS2_RELATIONT_H
#define LIBCORPUS2_RELATIONT_H
#include
<string>
#include
<boost/shared_ptr.hpp>
namespace
Corpus2
{
/**
* Helper class to represent one of two point of direction in any relation.
* Each relation has two points: from (source) and to (target)
*/
class
DirectionPoint
{
public:
/**
* @param sentence_id Sentence identifier
* @param channel_name Channel name
* @param annotation_number Annotation number
*/
DirectionPoint
(
const
std
::
string
sentence_id
,
const
std
::
string
channel_name
,
const
int
annotation_number
)
:
sentence_id_
(
sentence_id
),
channel_name_
(
channel_name
),
annotation_number_
(
annotation_number
)
{
//
}
/// Sentence identifier accessor
const
std
::
string
sentence_id
()
const
{
return
sentence_id_
;
}
/// Channel name accessor
const
std
::
string
channel_name
()
const
{
return
channel_name_
;
}
/// Annotatio number accessor
int
annotation_number
()
const
{
return
annotation_number_
;
}
private
:
const
std
::
string
sentence_id_
;
const
std
::
string
channel_name_
;
const
int
annotation_number_
;
};
/**
* Class to represent directed relation. As points of direction uses
* DirectionPoint class. Relation contains two points: from and to
*/
class
Relation
{
public:
/**
* Makes directed relation
* @param name Name of the relation
* @param from Source of relation direction
* @param to Target of relation direction
*/
Relation
(
const
std
::
string
&
name
,
const
boost
::
shared_ptr
<
const
DirectionPoint
>
from
,
const
boost
::
shared_ptr
<
const
DirectionPoint
>
to
);
~
Relation
();
/// Accessor to "from" direction point
const
boost
::
shared_ptr
<
const
DirectionPoint
>
from
()
const
{
return
from_
;
}
/// Accessor to "to" direction point
const
boost
::
shared_ptr
<
const
DirectionPoint
>
to
()
const
{
return
to_
;
}
private
:
/// Direction name
const
std
::
string
&
name_
;
/// Direction points: from and to
const
boost
::
shared_ptr
<
const
DirectionPoint
>
from_
;
const
boost
::
shared_ptr
<
const
DirectionPoint
>
to_
;
};
}
/* end ns Corpus2 */
#endif // LIBCORPUS2_RELATIONT_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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