Commits

Lars Yencken committed 4529872

Reverted bug fixes to simplify following merge.

Comments (0)

Files changed (3)

     }
 
     Script lastScript = scriptType(s[0]);
-    int startSeg = 0;
+
+    int i = 1, startSeg = 0;
     Script script;
-    for (int i = 1; i < sSize; i++) {
+    for (i = 1; i < sSize; i++) {
         script = scriptType(s[i]);
         if (script != lastScript) {
-            results.push_back(
-                    make_pair(lastScript, s.substr(startSeg, i-startSeg))
-                );
+            results.push_back(make_pair(lastScript, s.substr(startSeg, i)));
             startSeg = i;
             lastScript = script;
         }
 {
     unsigned int len = 0;
     for (wstring::const_iterator c = s.begin(); c != s.end(); c++) {
-        if (!isSmallKana(*c) && *c != L'ん') {
+        if (!isSmallKana(*c)) {
             len++;
         }
     }

src/tests/testGenerator.hpp

     Segment* m_unique;
     Segment* m_basic;
     Segment* m_smallKana;
-    Segment* m_nKana;
     Segment* m_longVowel;
     Segment* m_mixed;
 
     {
         m_unique = new Segment(L"私", L"わたし");
         m_basic = new Segment(L"漢字", L"たんだん"); 
-        m_smallKana = new Segment(L"発起", L"ほっき");
-        m_nKana = new Segment(L"発起人", L"ほきにん");
+        m_smallKana = new Segment(L"発起人", L"ほっきにん");
         m_longVowel = new Segment(L"ビール", L"ビール");
         m_mixed = new Segment(L"此の節", L"このせつ");
     }
             }
         }
     }
-    
-    void testNKana()
-    {
-        vector<Alignment> alignments;
-        potentialAlignments(*m_nKana, alignments);
-        CPPUNIT_ASSERT(alignments.size() == 4);
-        for (unsigned int i = 0; i < alignments.size(); i++) {
-            Alignment& a = alignments[i];
-            for (Alignment::iterator iter = a.begin(); iter != a.end();
-                    iter++) {
-                CPPUNIT_ASSERT(iter->g.size() == bigKanaLen(iter->p));
-            }
-        }
-    }
 
     void testLongVowel()
     {
                     &GeneratorTest::testBasic));
         s->addTest(new CppUnit::TestCaller<GeneratorTest>("testSmallKana",
                     &GeneratorTest::testSmallKana));
-        s->addTest(new CppUnit::TestCaller<GeneratorTest>("testNKana",
-                    &GeneratorTest::testNKana));
         s->addTest(new CppUnit::TestCaller<GeneratorTest>("testLongVowel",
                     &GeneratorTest::testLongVowel));
         s->addTest(new CppUnit::TestCaller<GeneratorTest>("testMixedScript",

src/tests/testScripts.hpp

     void testScriptBoundaries()
     {
         vector<ScriptSeg> results;
-        wstring example(L"此の節");
-        CPPUNIT_ASSERT(example.size() == 3);
-        scriptBoundaries(example, results);
+        scriptBoundaries(wstring(L"此の節"), results);
         CPPUNIT_ASSERT(results.size() == 3);
         CPPUNIT_ASSERT(results[0].second == wstring(L"此"));
         CPPUNIT_ASSERT(results[1].second == wstring(L"の"));