/usr/include/hfst/parsers/TwolCGrammar.h is in libhfst-dev 3.13.0~r3461-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | //! @file TwolCGrammar.h
//!
//! @brief Hold the rules in a twolc-grammar, resolve their conflicts and store
//! them.
//!
//! @author Miikka Silfverberg
// 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, version 3 of the License.
//
// 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
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef TWOL_C_GRAMMAR_H_
#define TWOL_C_GRAMMAR_H_
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "HfstTwolcDefs.h"
#include "LeftRestrictionArrowRule.h"
#include "RuleContainer.h"
#include "LeftArrowRuleContainer.h"
#include "RightArrowRuleContainer.h"
namespace op
{
enum OPERATOR
{
RIGHT,
LEFT,
NOT_LEFT,
LEFT_RIGHT,
RE_RIGHT,
RE_LEFT,
RE_NOT_LEFT,
RE_LEFT_RIGHT
};
}
class TwolCGrammar
{
protected:
typedef HandySet<Rule*> RuleSet;
typedef HandyMap<std::string,RuleSet> StringRuleSetMap;
bool be_quiet;
bool be_verbose;
StringRuleSetMap name_to_rule_subcases;
LeftArrowRuleContainer left_arrow_rule_container;
RightArrowRuleContainer right_arrow_rule_container;
RuleContainer other_rule_container;
RuleContainer compiled_rule_container;
std::string get_original_name(const std::string &name);
SymbolRange diacritics;
public:
TwolCGrammar(bool be_quiet,
bool be_verbose,
bool resolve_left_conflicts,
bool resolve_right_conflicts);
void define_diacritics(const SymbolRange &diacritics);
void add_rule(const std::string &name,
const SymbolPair ¢er,
op::OPERATOR oper,
const OtherSymbolTransducerVector contexts);
void add_rule(const std::string &name,
const OtherSymbolTransducer ¢er,
op::OPERATOR oper,
const OtherSymbolTransducerVector contexts);
void add_rule(const std::string &name,
const SymbolPairVector ¢er,
op::OPERATOR oper,
const OtherSymbolTransducerVector contexts);
void compile_and_store(HfstOutputStream &out);
};
#endif // TWOL_C_GRAMMAR_H_
|