Skip to content

Commit

Permalink
test: fix typo in examples tokenization
Browse files Browse the repository at this point in the history
  • Loading branch information
k4black committed Jan 29, 2024
1 parent 8ecff69 commit 297e074
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_codebleu.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,26 @@ def test_error_when_input_length_mismatch() -> None:
[
# https://github.com/microsoft/CodeXGLUE/blob/main/Code-Code/code-to-code-trans/example.png
(
["public static int Sign ( double d ) { return ( float ) ( ( d == 0 ) ? 0 : ( c < 0.0 ) ? - 1 : 1) ; }"],
["public static int Sign ( double d ) { return ( int ) ( ( d == 0 ) ? 0 : ( d < 0 ) ? - 1 : 1) ; }"],
["public static int Sign ( double d ) { return ( float ) ( ( d == 0 ) ? 0 : ( c < 0.0 ) ? -1 : 1 ) ; }"],
["public static int Sign ( double d ) { return ( int ) ( ( d == 0 ) ? 0 : ( d < 0 ) ? -1 : 1 ) ; }"],
0.7846,
11 / 19, # In example, it is 13/21, but with new version of tree-sitter it is 11/19
2 / 3,
0.7019, # Should be 0.7238 if AST=13/21 in the paper, however at the moment tee-sitter AST is 11/19
),
# https://arxiv.org/pdf/2009.10297.pdf "3.4 Two Examples" at the page 4
(
["public static int Sign ( double d ) { return ( float ) ( ( d == 0 ) ? 0 : ( c < 0.0 ) ? - 1 : 1) ;"],
["public static int Sign ( double d ) { return ( int ) ( ( d == 0 ) ? 0 : ( d < 0 ) ? - 1 : 1) ; }"],
["public static int Sign ( double d ) { return ( float ) ( ( d == 0 ) ? 0 : ( c < 0.0 ) ? -1 : 1 ) ;"],
["public static int Sign ( double d ) { return ( int ) ( ( d == 0 ) ? 0 : ( d < 0 ) ? -1 : 1 ) ; }"],
0.7543,
11 / 19, # In example, it is 13/21, but with new version of tree-sitter it is 11/19
2 / 3,
0.6873, # Should be 0.6973 if AST=13/21 in the paper, however at the moment tee-sitter AST is 11/19
),
# https://arxiv.org/pdf/2009.10297.pdf "3.4 Two Examples" at the page 4
(
["public static int Sign ( double c ) { return ( int ) ( ( c == 0 ) ? 0 : ( c < 0 ) ? - 1 : 1) ; }"],
["public static int Sign ( double d ) { return ( int ) ( ( d == 0 ) ? 0 : ( d < 0 ) ? - 1 : 1) ; }"],
["public static int Sign ( double c ) { return ( int ) ( ( c == 0 ) ? 0 : ( c < 0 ) ? -1 : 1 ) ; }"],
["public static int Sign ( double d ) { return ( int ) ( ( d == 0 ) ? 0 : ( d < 0 ) ? -1 : 1 ) ; }"],
0.7571, # Error in the Figure 4, text "Example 2" states 0.7571, not 0.6814,
1.0,
1.0,
Expand Down

0 comments on commit 297e074

Please sign in to comment.