summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Sumita <hsumita@google.com>2011-12-05 10:48:49 +0900
committerHiroshi Sumita <hsumita@google.com>2011-12-05 10:48:49 +0900
commit98b613a1f019ee44f403f1804e0eda9c941e5bff (patch)
tree10f11b5007aaafaa9cf9e7fcff407ab971c13e42
parent972642907da0126653dc37579a24b6467c979de2 (diff)
downloadpyzy-98b613a1f019ee44f403f1804e0eda9c941e5bff.tar.gz
Add TODO comment and remove some comment/space.
BUG=None TEST=Build manually Review URL: http://codereview.appspot.com/5440070
-rw-r--r--src/PyZyBopomofoContext.cc5
-rw-r--r--src/PyZyConfig.h2
-rw-r--r--src/PyZyInputContext.h5
-rw-r--r--src/PyZyTest.cc2
-rw-r--r--src/PyZyUtil.h4
5 files changed, 10 insertions, 8 deletions
diff --git a/src/PyZyBopomofoContext.cc b/src/PyZyBopomofoContext.cc
index 6c5e641..e99d199 100644
--- a/src/PyZyBopomofoContext.cc
+++ b/src/PyZyBopomofoContext.cc
@@ -278,7 +278,7 @@ BopomofoContext::updateAuxiliaryText (void)
m_buffer << ',';
m_buffer << (unichar *)m_pinyin[i]->bopomofo;
for (size_t sj = 0; m_pinyin[i]->bopomofo[sj] == bopomofo_char[keyvalToBopomofo(m_text.c_str()[si])] ; si++,sj++);
-
+
if (si < m_text_len) {
int ch = keyvalToBopomofo(m_text.c_str()[si]);
if (ch >= BOPOMOFO_TONE_2 && ch <= BOPOMOFO_TONE_5) {
@@ -374,7 +374,7 @@ BopomofoContext::updatePreeditText (void)
m_buffer << m_selected_special_phrase;
edit_begin_word = edit_end_word = m_buffer.utf8Length ();
edit_begin_byte = edit_end_byte = m_buffer.size ();
-
+
/* append text after cursor */
m_buffer << textAfterCursor ();
}
@@ -403,7 +403,6 @@ BopomofoContext::updatePreeditText (void)
SimpTradConverter::simpToTrad (candidate, m_buffer);
edit_end_word = m_buffer.utf8Length ();
edit_end_byte = m_buffer.size ();
-
/* append rest text */
for (const char *p=m_text.c_str() + m_pinyin_len; *p ;++p) {
m_buffer.appendUnichar(bopomofo_char[keyvalToBopomofo(*p)]);
diff --git a/src/PyZyConfig.h b/src/PyZyConfig.h
index 754cb5b..02505b3 100644
--- a/src/PyZyConfig.h
+++ b/src/PyZyConfig.h
@@ -39,7 +39,7 @@ protected:
private:
Config (const Config & obj) { }
-
+
public:
virtual void readDefaultValues (void);
diff --git a/src/PyZyInputContext.h b/src/PyZyInputContext.h
index 88275fb..486dcdd 100644
--- a/src/PyZyInputContext.h
+++ b/src/PyZyInputContext.h
@@ -80,6 +80,8 @@ public:
virtual bool moveCursorRight (void) = 0;
virtual bool moveCursorLeft (void) = 0;
+ // Currently this library treats cahracters after cursor as a one-word phrase.
+ // TODO(hsumita): Parse pinyin after cursor.
virtual bool moveCursorRightByWord (void) = 0;
virtual bool moveCursorLeftByWord (void) = 0;
virtual bool moveCursorToBegin (void) = 0;
@@ -95,6 +97,8 @@ public:
virtual bool removeCharBefore (void) = 0;
virtual bool removeCharAfter (void) = 0;
virtual bool removeWordBefore (void) = 0;
+ // Currently this library treats cahracters after cursor as a one-word phrase.
+ // TODO(hsumita): Parse pinyin after cursor.
virtual bool removeWordAfter (void) = 0;
virtual void bopomofoSelectMode () = 0;
@@ -113,7 +117,6 @@ public:
virtual const std::string & conversionText (void) const = 0;
virtual const std::string & restText (void) const = 0;
virtual const std::string & auxiliaryText (void) const = 0;
- // TODO(hsumita): Change return value to "class Candidates".
virtual const Candidates & candidates () const = 0;
virtual unsigned int cursor () const = 0;
virtual unsigned int focusedCandidate () const = 0;
diff --git a/src/PyZyTest.cc b/src/PyZyTest.cc
index 1682736..11e3084 100644
--- a/src/PyZyTest.cc
+++ b/src/PyZyTest.cc
@@ -203,7 +203,7 @@ TEST_F (PyZyTest, FullPinyinBasicTest) {
observer.clear ();
insertKeys (context, "aazhi");
EXPECT_EQ (5, context.cursor ());
- EXPECT_EQ ("aazhi", context.inputText ());
+ EXPECT_EQ ("aazhi", context.inputText ());
EXPECT_EQ ("", context.selectedText ());
EXPECT_EQ ("AA制", context.conversionText ());
EXPECT_EQ ("", context.restText ());
diff --git a/src/PyZyUtil.h b/src/PyZyUtil.h
index d8d621d..1bd4f4a 100644
--- a/src/PyZyUtil.h
+++ b/src/PyZyUtil.h
@@ -55,7 +55,7 @@ namespace std {
namespace PyZy {
// for Unicode
typedef unsigned int unichar;
-
+
class UUID {
public:
UUID (void)
@@ -75,7 +75,7 @@ public:
operator const char * (void) const
{
- return m_uuid;
+ return m_uuid;
}
private: