Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus2
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
corpus2
Commits
04caeb3a
Commit
04caeb3a
authored
13 years ago
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
First implementation of RelationReader
parent
d0ee6ba6
Branches
Branches containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libcorpus2/CMakeLists.txt
+1
-0
1 addition, 0 deletions
libcorpus2/CMakeLists.txt
libcorpus2/io/relreader.cpp
+33
-0
33 additions, 0 deletions
libcorpus2/io/relreader.cpp
libcorpus2/io/relreader.h
+66
-0
66 additions, 0 deletions
libcorpus2/io/relreader.h
with
100 additions
and
0 deletions
libcorpus2/CMakeLists.txt
+
1
−
0
View file @
04caeb3a
...
@@ -66,6 +66,7 @@ SET(libcorpus2_STAT_SRC
...
@@ -66,6 +66,7 @@ SET(libcorpus2_STAT_SRC
io/plainwriter.cpp
io/plainwriter.cpp
io/premorphwriter.cpp
io/premorphwriter.cpp
io/reader.cpp
io/reader.cpp
io/relreader.cpp
io/rft.cpp
io/rft.cpp
io/sax.cpp
io/sax.cpp
io/statwriter.cpp
io/statwriter.cpp
...
...
This diff is collapsed.
Click to expand it.
libcorpus2/io/relreader.cpp
0 → 100644
+
33
−
0
View file @
04caeb3a
/*
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/io/relreader.h>
#include
<boost/make_shared.hpp>
namespace
Corpus2
{
RelationReader
::
RelationReader
(
const
std
::
string
&
rela_path
)
:
rela_path_
(
rela_path
)
{
readed_
=
false
;
}
void
RelationReader
::
read
()
{
// mark that document has been readed
readed_
=
true
;
}
}
/* end ns Corpus2 */
This diff is collapsed.
Click to expand it.
libcorpus2/io/relreader.h
0 → 100644
+
66
−
0
View file @
04caeb3a
/*
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_RELREADER_H
#define LIBCORPUS2_RELREADER_H
#include
<vector>
#include
<boost/shared_ptr.hpp>
#include
<libcorpus2/relation.h>
namespace
Corpus2
{
/**
* A reader for realtion documents. Note that document is read into memory
* before any processing may take place.
*/
class
RelationReader
{
public:
/**
* Reads a document with relations
* @param rela_path path to file with relations
* TODO! Not implemented yet!
*/
RelationReader
(
const
std
::
string
&
rela_path
);
/**
* Relations accessor. If relations are not readed then read relations
* and returns list of them.
* @return List of readed relations
*/
const
std
::
vector
<
boost
::
shared_ptr
<
Relation
>
>&
relations
()
{
if
(
!
readed_
)
{
read
();
}
return
relations_
;
}
private
:
void
read
();
/// List of the relations in given relation file
std
::
vector
<
boost
::
shared_ptr
<
Relation
>
>
relations_
;
/// Path to file with relations
const
std
::
string
rela_path_
;
///
bool
readed_
;
};
}
/* end ns Corpus2 */
#endif // LIBCORPUS2_RELREADER_H
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