Skip to content

Integrate regular and "bidi" German tables#1100

Merged
egli merged 25 commits into
masterfrom
bidi-merge
Mar 7, 2022
Merged

Integrate regular and "bidi" German tables#1100
egli merged 25 commits into
masterfrom
bidi-merge

Conversation

@egli

@egli egli commented Aug 20, 2021

Copy link
Copy Markdown
Member

Related to #911

@egli egli marked this pull request as draft August 20, 2021 15:30
@egli egli added this to the 3.20 milestone Nov 24, 2021
@egli egli self-assigned this Nov 24, 2021
@egli egli modified the milestones: 3.20, 3.21 Dec 6, 2021
@bertfrees bertfrees added the tables Something that needs to be fixed in table files label Jan 14, 2022
@egli egli linked an issue Jan 20, 2022 that may be closed by this pull request
5 tasks
egli added 4 commits January 26, 2022 15:12
These tests are really weird and will probably never occur in real
life text
This table can be used to lowercase all chars before liblouis performs
any translation.
This is basically the first step to merge them. I just copied the bidi
table ontop of the g0-core table. Thanks to the latinLowercase table
all the tests involving caps should still work.

I made one small change, namely enable the downgrade emphclass which
wasn't in the bidi table.
@egli

egli commented Jan 26, 2022

Copy link
Copy Markdown
Member Author

So I replaced the g0-core table with the bidi table. Most tests pass with some exceptions:

And the comment says that the line can be removed once #717 has been
fixed which it has.
@egli

egli commented Jan 26, 2022

Copy link
Copy Markdown
Member Author

OK, the problem with ck in g2 is gone. There are still some weird pass2 rules though.

Comment thread tables/de-g0-core.uti Outdated
Comment thread tables/de-g0-core.uti Outdated
Comment thread tables/de-g0-core.uti Outdated
Comment thread tests/braille-specs/de-g0-bidi-specs.yaml Outdated
@bertfrees

Copy link
Copy Markdown
Member

@egli Already did a round of reviewing. I know it's still a draft, but still, my remarks could be useful.

egli added 3 commits January 27, 2022 13:44
This essentially merges the g0 bidi core with the g0 core.

To achieve that I had to do the following:

- expand the detailed accents table. The include (and overwrite)
  mechanism didn't work as desired. Presumably the base opcode cannot
  handle overwrites.
- Reduce the many context rules that handle single capital letter to
  just a few. Also I changed the sign that I insert as I had problems
  with the ck contraction if I use the 45-65 combination. So I use
  @12345678 instead
@egli

egli commented Jan 28, 2022

Copy link
Copy Markdown
Member Author

So I managed to get rid of de-g0-bidi-core.uti, i.e. replace it with de-g0-bidi.utb.

There are still some problems remaining:

  1. The translation of stuff like 'kW kVA hPa' now fails. I don't really understand how that worked before
  2. The context+pass2 trick for single capital letters doesn't work for Æ, as we define the lowercase æ only for forward translation, as that we get problems with backwards translating ae otherwise.
  3. There is a problem with words like '8fach' that wasn't there before
FAIL: braille-specs/de-g0-bidi-specs
====================================

Tables have not been indexed yet. Indexing LOUIS_TABLEPATH.
Best match: /home/egli/src/liblouis/tables/de-g0-bidi.utb (18)
Input:    'kW kVA hPa'
Expected: '⠅⠘⠺ ⠅⠘⠧⠁ ⠓⠨⠏⠁' (length 13)
Received: '⠅⣿⠨⠺ ⠅⠘⠧⠁ ⠓⠨⠏⠁' (length 14)
Diff:     Expected '⠘' but received '⣿' in index 1
lou_checkyaml:./braille-specs/de-g0-bidi-specs.yaml:216: Failure
Table: /home/egli/src/liblouis/tables/de-g0-bidi.utb
Display table: unicode-without-blank.dis

Input:    'Æ'
Expected: '⠨⠁⠑' (length 3)
Received: '⠘⠁⠑' (length 3)
Diff:     Expected '⠨' but received '⠘' in index 0
FAIL: braille-specs/de-g1
=========================

Tables have not been indexed yet. Indexing LOUIS_TABLEPATH.
Best match: /home/egli/src/liblouis/tables/de-g1.ctb (19)
Input:    '8fach'
Expected: '⠼⠓⠠⠋⠁⠹' (length 6)
Received: '⠼⠓⠠⠋⠁⠉⠓' (length 7)
Diff:     Expected '⠹' but received '⠉' in index 5
lou_checkyaml:./braille-specs/de-g1.yaml:451: Failure
Table: /home/egli/src/liblouis/tables/de-g1.ctb
Display table: unicode-without-blank.dis

egli added 2 commits February 9, 2022 15:06
This is probably a workaround around a bug in the base opcode where
base doesn't seem to trigger when the lowercase char is preceded with
a noback
@egli

egli commented Feb 9, 2022

Copy link
Copy Markdown
Member Author
  • I managed to fix the forward translation of Æ with a context rule. I suspect that this is just for a workaround around a bug in the base opcode where the lowercase char is defined with a noback prefix
  • I also managed to fix the 'kW' problem with some more pass3 trickery
  • all that's left now are problems with missing contraction after a number to character change
Tables have not been indexed yet. Indexing LOUIS_TABLEPATH.
Best match: /home/egli/src/liblouis/tables/de-g1.ctb (19)
Input:    '8fach'
Expected: '⠼⠓⠠⠋⠁⠹' (length 6)
Received: '⠼⠓⠠⠋⠁⠉⠓' (length 7)
Diff:     Expected '⠹' but received '⠉' in index 5
lou_checkyaml:./braille-specs/de-g1.yaml:451: Failure
Table: /home/egli/src/liblouis/tables/de-g1.ctb
Display table: unicode-without-blank.dis

@egli

egli commented Feb 10, 2022

Copy link
Copy Markdown
Member Author

Hi @BueVest why does Æ need to be indicated with 46 whereas all the other single capital letters are indicated with 45? Is that test case really correct? See https://github.com/liblouis/liblouis/blob/bidi-merge/tests/braille-specs/de-g0-bidi-specs.yaml#L258

egli added 4 commits February 11, 2022 10:10
and also move to the pass2 rules to the associated context rules
This is a cheap hack I know. It's for explorative purposes only. What
baffles me is that some stuff is contracted but there is no
contraction of 'st' and oddly enough in g2 it contracts the 'te' of
'stel' instead of the 'st' and the 'el'
Comment thread tables/de-g0-core.uti Outdated
@@ -1,6 +1,7 @@
# liblouis: German grade 0 braille
# liblouis: German grade 0 braille (bidirectional)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bidirectional" -> "with indication of capitals"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "detailed" be OK? Because it is with capitals and with detailed accents

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other comment.

@egli egli marked this pull request as ready for review March 7, 2022 12:02
Comment thread tables/de-g0-detailed.utb Outdated
Comment on lines +21 to +22
#-index-name: German, uncontracted, detailed
#-display-name: German uncontracted braille (detailed)

@bertfrees bertfrees Mar 7, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Detailed" is maybe a bit cryptic for a display name. I'd have called it something like "German uncontracted braille with indication of capitals" (similar to ru-litbrl-detailed.utb). More precise would be "German uncontracted braille with indication of capitals and detailed representation of accented letters", but that may be a bit too long.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But "detailed" might be fine too, dunno.

@egli

egli commented Mar 7, 2022

Copy link
Copy Markdown
Member Author

@bertfrees any idea why generateDisplayName fails

@bertfrees

Copy link
Copy Markdown
Member

@bertfrees any idea why generateDisplayName fails

Just run make in that directory and check generate.log. We should let Github upload the log file if that test fails.

@egli

egli commented Mar 7, 2022

Copy link
Copy Markdown
Member Author
make
go get golang.org/x/text/language/display
go: downloading golang.org/x/text v0.3.7
go build -buildmode=c-archive displayLanguage.go
displayLanguage.go:5:2: no required module provides package golang.org/x/text/language: go.mod file not found in current directory or any parent directory; see 'go help modules'
displayLanguage.go:6:2: no required module provides package golang.org/x/text/language/display: go.mod file not found in current directory or any parent directory; see 'go help modules'
make: *** [Makefile:19: displayLanguage.h] Error 1

@bertfrees

Copy link
Copy Markdown
Member
../../tables/de-g1-detailed.ctb: German, partially contracted, back-translatable != German, partially contracted, detailed
   cat ../../tables/de-g1-detailed.ctb | sed 's/^\(#-index-name: *\).*$/\1German, partially contracted, detailed/g' > ../../tables/de-g1-detailed.ctb.tmp
   mv ../../tables/de-g1-detailed.ctb.tmp ../../tables/de-g1-detailed.ctb
../../tables/de-g1-detailed.ctb: German partially contracted braille (back-translatable) != German partially contracted braille (detailed)
   cat ../../tables/de-g1-detailed.ctb | sed 's/^\(#-display-name: *\).*$/\1German partially contracted braille (detailed)/g' > ../../tables/de-g1-detailed.ctb.tmp
   mv ../../tables/de-g1-detailed.ctb.tmp ../../tables/de-g1-detailed.ctb

@egli egli merged commit 79365f1 into master Mar 7, 2022
@egli egli deleted the bidi-merge branch May 25, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tables Something that needs to be fixed in table files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better integrate regular and "bidi" German tables

2 participants