From: Dwayne B. <dwa...@us...> - 2006-01-30 14:10:15
|
Update of /cvsroot/translate/src/translate/filters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9212 Modified Files: test_checks.py Log Message: We should be detecting must and dont translate words even when surrounded by punctuation. Index: test_checks.py =================================================================== RCS file: /cvsroot/translate/src/translate/filters/test_checks.py,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- test_checks.py 28 Jan 2006 18:14:42 -0000 1.46 +++ test_checks.py 30 Jan 2006 14:09:50 -0000 1.47 @@ -163,6 +163,11 @@ assert checks.fails(stdchecker.musttranslatewords, "This uses Mozilla. Don't you?", "hierdie gebruik Mozilla soos jy") # should always pass if there are no stopwords in the original assert checks.passes(stdchecker.musttranslatewords, "This uses something else. Don't you?", "hierdie gebruik Mozilla soos jy") + # check that we can find words surrounded by punctuation + assert checks.passes(stdchecker.musttranslatewords, "Click 'Mozilla' button", "Kliek 'Motzille' knoppie") + assert checks.fails(stdchecker.musttranslatewords, "Click 'Mozilla' button", "Kliek 'Mozilla' knoppie") + assert checks.passes(stdchecker.musttranslatewords, "Click Mozilla!", "Kliek Motzille!") + assert checks.fails(stdchecker.musttranslatewords, "Click Mozilla!", "Kliek Mozilla!") def test_notranslatewords(): """tests stopwords""" @@ -175,6 +180,13 @@ assert checks.passes(stdchecker.notranslatewords, "This uses Mozilla. Don't you?", "hierdie gebruik Mozilla soos jy") # should always pass if there are no stopwords in the original assert checks.passes(stdchecker.notranslatewords, "This uses something else. Don't you?", "hierdie gebruik Mozilla soos jy") + # Cope with commas + assert checks.passes(stdchecker.notranslatewords, "using Mozilla Task Manager", "šomiša Selaola Mošomo sa Mozilla, gomme") + # Find words even if they are embedded in punctuation + assert checks.fails(stdchecker.musttranslatewords, "Click 'Mozilla' button", "Kliek 'Motzille' knoppie") + assert checks.passes(stdchecker.musttranslatewords, "Click 'Mozilla' button", "Kliek 'Mozilla' knoppie") + assert checks.fails(stdchecker.musttranslatewords, "Click Mozilla!", "Kliek Motzille!") + assert checks.passes(stdchecker.musttranslatewords, "Click Mozilla!", "Kliek Mozilla!") def test_numbers(): """test numbers""" |