OSDN Git Service

18f53dbbcce7158f84b9b68c3badc2858e915d77
[wordring-tm/wordring-tm.git] / languages / japanese / japanese.h
1 #ifndef JAPANESE_H
2 #define JAPANESE_H
3
4 #include "language.h"
5
6 #include <mecab/mecab.h>
7
8 #include <QObject>
9 #include <QIcon>
10 #include <QString>
11
12 class JapanesePlugin : public QObject, public Language
13 {
14         Q_OBJECT
15         Q_INTERFACES(Language)
16         Q_PLUGIN_METADATA(IID  "net.wordring.tm.language/1.0")
17
18 public:
19         explicit JapanesePlugin(QObject *parent = 0);
20         ~JapanesePlugin();
21
22         void set_settings(Settings const *settings);
23
24         QString name() const;
25         int code() const;
26         QIcon icon() const;
27
28         Text::pointer divide_into_sentences(QString string);
29         Text::pointer divide_into_words(Text::pointer sentence);
30
31         QString normalize(QString string);
32
33 private:
34         Settings const *m_settings;
35
36         MeCab::Model *m_mecab_model;
37         MeCab::Tagger *m_mecab_tagger;
38         MeCab::Lattice *m_mecab_lattice;
39 };
40
41 #endif // JAPANESE_H