[dasher/relicence] Revert "Added IME support for Windows"



commit 9de7b506bc69eb1f81058643e044a67c30d7913f
Author: Gavin Henderson <gavin henderson hotmail co uk>
Date:   Thu Mar 3 15:44:20 2022 +0000

    Revert "Added IME support for Windows"
    
    This reverts commit 64b82f7d18f594a015bd4310ef4d9b3d64a06abb.

 .../LanguageModelling/JapaneseLanguageModel.cpp    | 12 +---
 Src/DasherCore/LanguageModelling/KanjiConversion.h | 62 +++++++++-----------
 .../LanguageModelling/KanjiConversionCanna.h       | 20 +++----
 .../LanguageModelling/KanjiConversionIME.cpp       | 66 ----------------------
 .../LanguageModelling/KanjiConversionIME.h         | 31 ----------
 5 files changed, 38 insertions(+), 153 deletions(-)
---
diff --git a/Src/DasherCore/LanguageModelling/JapaneseLanguageModel.cpp 
b/Src/DasherCore/LanguageModelling/JapaneseLanguageModel.cpp
index 1f35b55b..b83ea3e4 100644
--- a/Src/DasherCore/LanguageModelling/JapaneseLanguageModel.cpp
+++ b/Src/DasherCore/LanguageModelling/JapaneseLanguageModel.cpp
@@ -14,8 +14,6 @@
 #include "KanjiConversion.h"
 #ifdef HAVE_LIBCANNA
 #include "KanjiConversionCanna.h"
-#elif _WIN32
-#include "KanjiConversionIME.h"
 #endif
 
 #include <math.h>
@@ -111,10 +109,6 @@ void CJapaneseLanguageModel::GetProbs(Context context, std::vector<unsigned int>
       //TODO: Write a conversion code here
 #ifdef HAVE_LIBCANNA
       CKanjiConversionCanna canna;
-#elif _WIN32
-      CKanjiConversionIME canna;
-#else
-      CKanjiConversion canna;
 #endif
       //CKanjiConversion canna;
       std::vector < std::string > cand_list;
@@ -323,7 +317,7 @@ void CJapaneseLanguageModel::AddSymbol(CJapaneseLanguageModel::CJaPPMContext &co
         // creates new nodes, updates counts
         // and leaves 'context' at the new context
 {
-  DASHER_ASSERT(sym >= 0 && sym <= GetSize());
+  DASHER_ASSERT(sym >= 0 && sym < GetSize());
 
   CJaPPMnode *vineptr, *temp;
   int updatecnt = 1;
@@ -353,7 +347,7 @@ void CJapaneseLanguageModel::AddSymbol(CJapaneseLanguageModel::CJaPPMContext &co
 // Update context with symbol 'Symbol'
 
 void CJapaneseLanguageModel::EnterSymbol(Context c, int Symbol) {
-  DASHER_ASSERT(Symbol >= 0 && Symbol <= GetSize());
+  DASHER_ASSERT(Symbol >= 0 && Symbol < GetSize());
 
   CJapaneseLanguageModel::CJaPPMContext & context = *(CJaPPMContext *) (c);
 
@@ -397,7 +391,7 @@ void CJapaneseLanguageModel::EnterSymbol(Context c, int Symbol) {
 /////////////////////////////////////////////////////////////////////
 
 void CJapaneseLanguageModel::LearnSymbol(Context c, int Symbol) {
-  DASHER_ASSERT(Symbol >= 0 && Symbol <= GetSize());
+  DASHER_ASSERT(Symbol >= 0 && Symbol < GetSize());
 
   CJapaneseLanguageModel::CJaPPMContext & context = *(CJaPPMContext *) (c);
   AddSymbol(context, Symbol);
diff --git a/Src/DasherCore/LanguageModelling/KanjiConversion.h 
b/Src/DasherCore/LanguageModelling/KanjiConversion.h
index f83951ba..128df940 100644
--- a/Src/DasherCore/LanguageModelling/KanjiConversion.h
+++ b/Src/DasherCore/LanguageModelling/KanjiConversion.h
@@ -13,45 +13,35 @@
 #include <vector>
 
 namespace Dasher {
-  /// \ingroup LM
-  /// \{
-  class CKanjiConversion {
+  class CKanjiConversion;
+} class CKanjiConversion {
+public:
+  CKanjiConversion() {
+    IsInit = 0;
+  };
+  ~CKanjiConversion() {
+    IsInit = 0;
+  };
+
+  virtual int ConvertKanji(std::string) = 0;
+  //int context_id;
+
+  class CPhrase {
   public:
-    CKanjiConversion();
-    virtual ~ CKanjiConversion();
-
-    virtual int ConvertKanji(std::string);
-
-    class CPhrase {
-    public:
-      CPhrase() {
-      };
-      CPhrase(CPhrase * p) {
-        candidate_list = p->candidate_list;
-      };
-      ~CPhrase() {
-        candidate_list.clear();
-      };
-      std::vector < std::string > candidate_list;
+    CPhrase() {
     };
+    CPhrase(CPhrase * p) {
+      candidate_list = p->candidate_list;
+    };
+    ~CPhrase() {
+      candidate_list.clear();
+    };
+    std::vector < std::string > candidate_list;
+  };
 
-    std::vector < CPhrase > phrase;       //      a list of phrases
+  std::vector < CPhrase > phrase;       //      a list of phrases
 
-    bool IsInit;                  // true if dictionary is loaded
-  };
-  /// \}
-  
-  inline CKanjiConversion::CKanjiConversion(){
-    IsInit = 0;
-  }
-  
-  inline CKanjiConversion::~CKanjiConversion(){
-    IsInit = 0;
-  }
-  
-  inline int CKanjiConversion::ConvertKanji(std::string s){
-    return 0;
-  }
-}
+  bool IsInit;                  // true if dictionary is loaded
+};
 
 #endif /* #ifndef __KanjiConversion_H__ */
diff --git a/Src/DasherCore/LanguageModelling/KanjiConversionCanna.h 
b/Src/DasherCore/LanguageModelling/KanjiConversionCanna.h
index c14b3401..7e1cbb2b 100644
--- a/Src/DasherCore/LanguageModelling/KanjiConversionCanna.h
+++ b/Src/DasherCore/LanguageModelling/KanjiConversionCanna.h
@@ -19,16 +19,14 @@
 #define BUFSIZE 10240
 
 namespace Dasher {
-  /// \ingroup LM
-  /// \{
-  class CKanjiConversionCanna:public CKanjiConversion {
-  public:
-    CKanjiConversionCanna();
-    virtual ~ CKanjiConversionCanna();
+  class CKanjiConversion;
+} class CKanjiConversionCanna:public CKanjiConversion {
+public:
+  CKanjiConversionCanna();
+  ~CKanjiConversionCanna();
+
+  int ConvertKanji(std::string);
+  int context_id;
+};
 
-    int ConvertKanji(std::string);
-    int context_id;
-  };
-  /// \}
-}
 #endif /* #ifndef __KanjiConversionCanna_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]