Skip to content

Commit

Permalink
Handle more Translation Opcodes
Browse files Browse the repository at this point in the history
which brings the success rate up to 63%
  • Loading branch information
egli committed Mar 8, 2024
1 parent 8363628 commit 29ce1ff
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ Run all YAML tests:
#+BEGIN_SRC shell
$ LOUIS_TABLE_PATH=~/src/liblouis/tables:~/src/liblouis cargo run -- check --brief ~/src/liblouis/tests/braille-specs/*.yaml ~/src/liblouis/tests/yaml/*.yaml 2> /dev/null
================================================================================
648317 tests run:
333007 successes [51%]
277307 failures [43%]
25560 expected failures [4%]
12443 unexpected successes [2%]
654045 tests run:
410433 successes [63%]
231425 failures [35%]
11824 expected failures [2%]
363 unexpected successes [0%]
#+END_SRC

Test the table query functionality:
Expand Down
32 changes: 31 additions & 1 deletion src/translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use trie::Trie;

use crate::parser::{dots_to_unicode, Braille, Direction, Rule};

mod trie;
mod boundaries;
mod trie;

#[derive(Debug, PartialEq, Clone)]
pub struct Translation {
Expand Down Expand Up @@ -104,15 +104,45 @@ impl TranslationTable {
dots: Braille::Explicit(dots),
..
}
| Rule::Sufword {
chars,
dots: Braille::Explicit(dots),
..
}
| Rule::Prfword {
chars,
dots: Braille::Explicit(dots),
..
}
| Rule::Begword {
chars,
dots: Braille::Explicit(dots),
..
}
| Rule::Begmidword {
chars,
dots: Braille::Explicit(dots),
..
}
| Rule::Midword {
chars,
dots: Braille::Explicit(dots),
..
}
| Rule::Midendword {
chars,
dots: Braille::Explicit(dots),
..
}
| Rule::Endword {
chars,
dots: Braille::Explicit(dots),
..
}
| Rule::Partword {
chars,
dots: Braille::Explicit(dots),
..
} => trie.insert(
&chars,
Translation {
Expand Down

0 comments on commit 29ce1ff

Please sign in to comment.