Skip to content
Snippets Groups Projects
Commit 1f5d3535 authored by Bartosz Broda's avatar Bartosz Broda
Browse files

add stub for mwe reader

parent 8b85ba87
No related merge requests found
......@@ -63,6 +63,7 @@ endif(MSVC OR BORLAND)
add_subdirectory(libwccl)
add_subdirectory(wccl-apps)
add_subdirectory(tests)
add_subdirectory(libmwereader)
if(WCCL_BUILD_SWIG)
FIND_PACKAGE(SWIG)
......
PROJECT(MWEReader)
cmake_minimum_required(VERSION 2.8.0)
set(libmwereader_major 0)
set(libmwereader_minor 1)
add_library(corpus2_mwereader SHARED mwereader.cpp )
set_target_properties(corpus2_mwereader PROPERTIES
VERSION "${libmwereader_major}.${libmwereader_minor}"
SOVERSION ${libmwereader_major})
find_package(Corpus2 1.0.9 REQUIRED)
set(LIBS ${LIBS} ${Corpus2_LIBRARIES})
find_package(PwrUtils 1.0.1 REQUIRED)
set(LIBS ${LIBS} ${PwrUtils_LIBRARY})
link_directories(${Boost_LIBRARY_DIRS})
set(LIBS ${LIBS} ${Boost_LIBRARIES})
find_package(ICU REQUIRED)
include_directories(${ICU_INCLUDE_DIR})
set(LIBS ${LIBS} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
find_package(ANTLR REQUIRED)
include_directories(${ANTLR_INCLUDE_DIR})
target_link_libraries(corpus2_mwereader corpus2)
add_executable(mwertest mwertest.cpp)
target_link_libraries(mwertest corpus2_mwereader ${LIBS})
if(UNIX)
install(TARGETS corpus2_mwereader LIBRARY DESTINATION lib)
#install(TARGETS c2pqtest RUNTIME DESTINATION bin)
endif(UNIX)
#include "mwereader.h"
namespace Corpus2{
bool MWEReader::registered = TokenReader::register_path_reader<MWEReader>(
"mwereader","token,chunk,sentence"); // TODO wiecej helpa
MWEReader::MWEReader(const Tagset &tagset, const std::string &filename)
: TokenReader(tagset)
{
// TODO implementataion
std::cerr << "Jestem sobie MWE Readerkiem" << std::endl;
}
MWEReader::~MWEReader()
{
// TODO implementataion
}
Token* MWEReader::get_next_token()
{
// TODO implementation
return 0;
}
Sentence::Ptr MWEReader::get_next_sentence()
{
// TODO implementataion
return Sentence::Ptr();
}
boost::shared_ptr<Chunk> MWEReader::get_next_chunk()
{
// TODO implementataion
return boost::shared_ptr<Chunk>();
}
void MWEReader::set_option(const std::string& option)
{
// TODO implementataion
}
void MWEReader::validate()
{
// TODO implementataion
}
std::string MWEReader::get_option(const std::string& option) const
{
// TODO implementataion
std::string s;
return s;
}
}// ns Corpus2
#ifndef LIBMWEREADER_MWEREADER_H
#define LIBMWEREADER_MWEREADER_H
#include <libcorpus2/io/reader.h>
namespace Corpus2 {
class MWEReader: public TokenReader
{
public:
MWEReader(const Tagset& tagset, const std::string& filename);
~MWEReader();
Token* get_next_token();
Sentence::Ptr get_next_sentence();
boost::shared_ptr<Chunk> get_next_chunk();
void set_option(const std::string& option);
/**
* Option inspector. Should echo the option if it is set, return
* an empty string otheriwse, and "unknown" if the option is invalid.
*/
std::string get_option(const std::string& option) const;
/**
* Check if the reader is valid, should throw if not. Called after
* all set_options during factory reader creation.
*/
virtual void validate();
static bool registered;
};
} // ns Corpus2
#endif // LIBMWEREADER_MWEREADER_H
#include <iostream>
int main(int ac, char**av)
{
std::cout << "TEST" << std::endl;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment