librime: algebra.h Source File

| librime 1.2 Rime Input Method Engine, the core library

algebra.h
Go to the documentation of this file.
1//
2// Copyright RIME Developers
3// Distributed under the BSD License
4//
5// 2012-01-19 GONG Chen <chen.sst@gmail.com>
6//
7
8#ifndef RIME_ALGEBRA_H_
9#define RIME_ALGEBRA_H_
10
11#include <rime/common.h>
12#include <rime/config.h>
13#include "spelling.h"
14
15namespace rime {
16
17class Calculation;
18class Schema;
19
20 class Script : public map<string, vector<Spelling>> {
21 public:
22 RIME_DLL bool AddSyllable(const string& syllable);
23 void Merge(const string& s,
24 const SpellingProperties& sp,
25 const vector<Spelling>& v);
26 void Dump(const path& file_path) const;
27};
28
29 class Projection {
30 public:
31 RIME_DLL bool Load(an<ConfigList> settings);
32 // "spelling" -> "gnilleps"
33 RIME_DLL bool Apply(string* value);
34 // {z, y, x} -> {a, b, c, d}
35 RIME_DLL bool Apply(Script* value);
36
37 protected:
38 vector<of<Calculation>> calculation_;
39};
40
41} // namespace rime
42
43#endif // RIME_ALGEBRA_H_
common.h
spelling.h
config.h
RIME_DLL
#define RIME_DLL
Definition rime_api.h:33
rime
Definition algebra.cc:12
rime::an
std::shared_ptr< T > an
Definition common.h:60
rime::Script
Definition algebra.h:20
rime::Script::Merge
void Merge(const string &s, const SpellingProperties &sp, const vector< Spelling > &v)
Definition algebra.cc:22
rime::Script::Dump
void Dump(const path &file_path) const
Definition algebra.cc:40
rime::Script::AddSyllable
RIME_DLL bool AddSyllable(const string &syllable)
Definition algebra.cc:14
rime::Projection
Definition algebra.h:29
rime::Projection::Load
RIME_DLL bool Load(an< ConfigList > settings)
Definition algebra.cc:54
rime::Projection::Apply
RIME_DLL bool Apply(string *value)
Definition algebra.cc:88
rime::Projection::calculation_
vector< of< Calculation > > calculation_
Definition algebra.h:38
rime::Calculation
Definition calculus.h:19
rime::SpellingProperties
Definition spelling.h:24
rime::path
Definition common.h:84
rime::Schema
Definition schema.h:15