Skip to content

Instantly share code, notes, and snippets.

@halfak
Last active November 19, 2020 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halfak/38ff73b5e3cde579a0c41f0d46b98f6a to your computer and use it in GitHub Desktop.
Save halfak/38ff73b5e3cde579a0c41f0d46b98f6a to your computer and use it in GitHub Desktop.
==================================================================================================== FAILURES =====================================================================================================
_________________________________________________________________________________________________ test_cjk_chars __________________________________________________________________________________________________
def test_cjk_chars():
cache = {p_text: "This is 55 {{るは}} a string.",
r_text: "This is 56 [[壌のは]] a string."}
assert solve(revision.cjk_chars, cache=cache) == 3
assert solve(revision.parent.cjk_chars, cache=cache) == 2
> assert solve(revision.diff.cjk_chars_added, cache=cache) == 2
E AssertionError: assert 0 == 2
E + where 0 = solve(<feature.wikitext.revision.diff.cjk_chars_added>, cache={<datasource.revision.parent.text>: 'This is 55 {{るは}} a string.', <datasource.revision.text>: 'This is 56 [[壌のは]] a s...mber'), Token(' ', type='whitespace'), ...], <datasource.wikitext.revision.cjks>: [Token('壌のは', type='cjk_word')], ...})
E + where <feature.wikitext.revision.diff.cjk_chars_added> = {wikitext.revision.diff}.cjk_chars_added
E + where {wikitext.revision.diff} = {wikitext.revision}.diff
tests/features/wikitext/tests/test_chars.py:92: AssertionError
____________________________________________________________________________________________________ test_cjks ____________________________________________________________________________________________________
def test_cjks():
cache = {p_text: "This is 55 {{るは}} a string.",
r_text: "This is 56 [[壌のは]] a string."}
> assert solve(revision.diff.cjks_added, cache=cache) == 2
E AssertionError: assert 0.0 == 2
E + where 0.0 = solve(<feature.wikitext.revision.diff.cjks_added>, cache={<datasource.revision.parent.text>: 'This is 55 {{るは}} a string.', <datasource.revision.text>: 'This is 56 [[壌のは]] a s...n('a', type='word'), Token(' ', type='whitespace'), Token('string', type='word'), Token('.', type='period')])])]), ...})
E + where <feature.wikitext.revision.diff.cjks_added> = {wikitext.revision.diff}.cjks_added
E + where {wikitext.revision.diff} = {wikitext.revision}.diff
tests/features/wikitext/tests/test_edit_tokens.py:104: AssertionError
___________________________________________________________________________________________________ test_tokens ___________________________________________________________________________________________________
def test_tokens():
> assert solve(revision.tokens, cache={r_text: text}) == 97
E assert 81.0 == 97
E + where 81.0 = solve(<feature.len(<datasource.tokenized(datasource.revision.text)>)>, cache={<datasource.revision.text>: "\nThis is an m80. It has 50 grams of TNT. Here's some japanese:\n修造のための勧進を担った組織の総称。[//g...e='whitespace'), Token('an', type='word'), ...], <feature.len(<datasource.tokenized(datasource.revision.text)>)>: 81.0})
E + where <feature.len(<datasource.tokenized(datasource.revision.text)>)> = {wikitext.revision}.tokens
tests/features/wikitext/tests/test_tokenized.py:20: AssertionError
================================================================================================ warnings summary =================================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment