[liblouis-liblouisxml] Re: A question with future extending the hungarian grade1 table related testing tasks

  • From: Mesar Hameed <mesar.hameed@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Tue, 8 May 2012 14:00:11 +0100

Hi Attila,

On Tue 08/05/12,14:07, Hammer Attila wrote:
> Hy,
> 
> Yesterday afternoon I talked Mesar in Liblouis IRC channel future
> possible need extending the hungarian Liblouis test harness file
> with short sentences with testing more possibilities the new
> hungarian contraction table.
> Now, the hungarian test harness file containing my added example
> single words only.
> 
> I generated following automatic way the test harness file, I talked
> Mesar when I finalized the automatic way generator script, I will be
> sending the list. Hopefuly the future script will be help beginner
> table creators the test harness file generation.

Thanks, it will nor completely replace the manually created tests, but will 
help the writer to create them.
The writer may still have to edit the harness file to have maximum flexibility.

> First, you need known a single plain text file need containing the
> example words (or future sentences or paragraph), with separated new
> lines.

Something like this?

--cut--
hello
world
hello world this is a test
hello, world! a line with 9 words and 3 punctuation marks.
1Orange, 2bananas and apples45
--end cut--

The tests should test for contractions i.e. the single words and sentances, but 
should also test the interaction between 
punctuation/numbers and contractions, when there is no space.

> The Python script with I begin doing read the text file, and
> do following tasks:
> 1. - Put the beginning { character the second parameter gived file,
> of course proper indenting the line with four spaces.
> 2. Put the 'txt':  u'readed word or line' line, indenting with eight
> spaces the line.
> 3. Put the 'brl': beginning line, and put the Liblouis
> translateString function returned output, and indenting the line
> with eight spaces.
> 4. Put the final } and comma character, of course indenting this
> line with four characters.

Yes this sounds good, please look at the updated hu1_harness.py, I saved some 
empty lines by putting "}, {" on the same line.
otherwise it will need many keypresses for when moving to a new test.

> If this method are acceptable other languages the test harness file
> automatic generation method, I need finalizing the script, I would
> like add parameters supporting. I need doing the header part
> generation, and the end part generation.

I think just printing the tests is enough, the tester can then add the 
header/footer by hand, it is not much work, so maybe no 
need for parameters.

> When I doed this way the hungarian test harness file automatic
> generation, I used louis.translateString function the braille output
> generation, because I already known every used example words is
> right presenting when I using Liblouis with Orca, or when I turns
> off contraction table with Orca and using the Brltty awailable
> hungarian euro braille table, table name in Brltty is hu.ttb file.

Yes, it is true for Hungarian, but may not be true for other languages, so the 
'brl' messages can be produced using 
lou_translatestring, but should be definitely checked by hand to make sure they 
give the correct braille.

> My questions is following:
> 1. If I want put short sentences with testing the hungarian new
> braille standard required contractions with Mesar suggested me, I
> need put the short sentences the test harness file, or this purpose
> have other better testing possibilities?

test hardness is fine, the 'txt' tag can include any text.
Maybe the script should check that there is no ' or ", and if there is the 
string should be tripple quoted like this:
       'txt': u"""Hello this string has a ' and a " as part of the test"""

> 2. For example what purpose tests doing the txt files in the
> doctests directory?

doctests and the harness does the same job, but we have not agreed how to best 
merge them.
I think the doctests would currently take more typing if done by hand.

Do you have a github account where I can see the current script?

Mesar
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: