Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MessageFormat2 support with ICU4J executor #175

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

mradbourne
Copy link
Contributor

No description provided.

@mradbourne mradbourne changed the title Add draft test schema Add draft MessageFormat2 test schema Feb 5, 2024
@sven-oly
Copy link
Collaborator

sven-oly commented Feb 5, 2024

Thanks for your work on this. I look forward to integrating MF2!

schema/messageformat2/test_schema.json Outdated Show resolved Hide resolved
schema/messageformat2/test_schema.json Outdated Show resolved Hide resolved
schema/messageformat2/test_schema.json Outdated Show resolved Hide resolved
schema/messageformat2/test_schema.json Outdated Show resolved Hide resolved
schema/messageformat2/test_schema.json Outdated Show resolved Hide resolved
schema/messageformat2/test_schema.json Outdated Show resolved Hide resolved
@mradbourne mradbourne changed the title Add draft MessageFormat2 test schema Add MessageFormat2 support with ICU4J executor Feb 27, 2024
testgen/testdata_gen.py Outdated Show resolved Hide resolved
testgen/testdata_gen.py Outdated Show resolved Hide resolved

# Utility functions
def computeMaxDigitsForCount(count):
return math.ceil(math.log10(count + 1))


def readFile(filename, version=''):
def readFile(filename, version='', filetype='txt'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

How does Python allow people to attach doc strings for methods? Can you add a source doc string to document filetype as having special behavior when you provide a value in the set of ['json']?

@echeran
Copy link
Collaborator

echeran commented Mar 12, 2024

FYI, the current failure in the end-to-end job in CI is related to a configuration mistake in the Dart intl4x library that has been fixed and should roll out soon. It's obviously unrelated to our work, so ignore it for now.

"value": 1.2
}
],
"verify": "=1.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I predict this test expected value is not correct and will need changing, once we get the test data hooked up to the executor. Plural selection happens on the "formatted" number (more precisely: the formatted-to-parts result, which comes after rounding is performed, notation changes applied, units are added, etc.), not the input number. I would expect the result to be other.

By contrast, the previous test case's expected value seems fine, since 1.2 :integer -> 1 (formatted) -> ONE plural category (selection on formatted value).

"value": 1.2
}
],
"verify": "=1.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto, but double problem: formatting should return 1. The matching ought not to happen on the localized formatted string, but even if it did, the resulting string would be =1,2, right? Also, does our syntax support , in a number literal? It doesn't seem so.

"description": "",
"tests": [
]
}
Copy link
Collaborator

@echeran echeran Apr 10, 2024

Choose a reason for hiding this comment

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

is this file proper JSON? the object that begins on line 1 ends on line 6.

beyond that, this file and some others that follow don't specify the default locale, FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants