LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
file.h
Go to the documentation of this file.
1// Copyright 2021 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6#ifndef CONLLU_FILE_H
7#define CONLLU_FILE_H
8
9#include "line.h"
10
11namespace deeplima
12{
13namespace CoNLLU
14{
16 {
17 public:
19 explicit CoNLLUFile(const std::string& filename)
20 {
21 load(filename);
22 }
23
24 void load(const std::string& filename);
25 void save(const std::string& filename, bool force = false);
26
28 {
30 sentence_t(size_t first_line, size_t first_word_line, size_t length)
31 : _first_line(first_line), _first_word_line(first_word_line), _length(length) { }
32
35 size_t _length; // number of words
36 };
37
38 protected:
39
40 std::vector<CoNLLULine> _lines;
41 std::vector<sentence_t> _sentences;
42 };
43
44} // namespace CoNLLU
45} // namespace deeplima
46
47#endif
void save(const std::string &filename, bool force=false)
TODO implement the force parameter.
Definition file.cpp:35
std::vector< CoNLLULine > _lines
Definition file.h:40
CoNLLUFile(const std::string &filename)
Definition file.h:19
void load(const std::string &filename)
Definition file.cpp:16
std::vector< sentence_t > _sentences
Definition file.h:41
sentence_t(size_t first_line, size_t first_word_line, size_t length)
Definition file.h:30