[liblouis-liblouisxml] [liblouis] r742 committed - tests/runHarness.py: small optimization.

  • From: liblouis@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 18 Jul 2012 10:30:24 +0000

Revision: 742
Author:   mesar.hameed@xxxxxxxxx
Date:     Wed Jul 18 03:30:01 2012
Log:      tests/runHarness.py: small optimization.
http://code.google.com/p/liblouis/source/detail?r=742

Modified:
 /trunk/tests/runHarness.py

=======================================
--- /trunk/tests/runHarness.py  Tue Jul 17 02:37:27 2012
+++ /trunk/tests/runHarness.py  Wed Jul 18 03:30:01 2012
@@ -131,14 +131,7 @@
# FIXME: liblouis currently crashes if we dont add space at end of the word, probably due to a counter running past the end of the string. # medium/longterm this hack should be removed, and the root of the problem found/resolved.
         hyphen_mask=hyphenate(tables, word+' ', mode)
-        inlen=len(word)
-        hyphen_word = ''
-        for i in range(inlen):
-            if hyphen_mask[i]=='0':
-                hyphen_word=hyphen_word+word[i]
-            else:
-                hyphen_word=hyphen_word+'-'+word[i]
-        return hyphen_word
+ return "".join(map(lambda a,b: "-"+a if b=='1' else a, word, hyphen_mask)[:-1])

     def check_translate(self):
         if self.cursorPos is not None:
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts:

  • » [liblouis-liblouisxml] [liblouis] r742 committed - tests/runHarness.py: small optimization. - liblouis