216553203df0f6ab5c9af2b7b46255dbfb69a04c,opennmt/tests/text_test.py,TextTest,testToWordsWithSpacer,#TextTest#Any#Any#,50
Before Change
expected = tf.constant(expected)
words = text.tokens_to_words(tokens, subword_token="▁", is_spacer=True)
words = words.to_tensor()
words, expected = self.evaluate([words, expected])
self.assertAllEqual(words, expected)
def _testPharaohAlignments(self, line, lengths, expected_matrix):
matrix = text.alignment_matrix_from_pharaoh(
After Change
[["a", "▁b▁", "c", "d", "▁", "e"], [["a"], ["▁b▁"], ["c", "d"], ["▁", "e"]]],
])
def testToWordsWithSpacer(self, tokens, expected):
expected = tf.nest.map_structure(tf.compat.as_bytes, expected)
tokens = tf.constant(tokens)
words = text.tokens_to_words(tokens, subword_token="▁", is_spacer=True)
self.assertAllEqual(words.to_list(), expected)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 216553203df0f6ab5c9af2b7b46255dbfb69a04c
Time: 2019-10-10
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/text_test.py
Class Name: TextTest
Method Name: testToWordsWithSpacer
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 216553203df0f6ab5c9af2b7b46255dbfb69a04c
Time: 2019-10-10
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/text_test.py
Class Name: TextTest
Method Name: testToWordsWithJoiner
Project Name: google-research/google-research
Commit Name: da6b040e254710f0df907d838db51f4f2cc9bf93
Time: 2021-03-08
Author: ldennis@google.com
File Name: social_rl/multiagent_tfagents/multiagent_ppo.py
Class Name: MultiagentPPO
Method Name: get_single_agent_specs
Project Name: OpenNMT/OpenNMT-tf
Commit Name: d841dbe9dcce23d1583b89f4ff459a5db792b4f5
Time: 2019-02-06
Author: guillaumekln@users.noreply.github.com
File Name: opennmt/tests/inputter_test.py
Class Name: InputterTest
Method Name: _testTokensToChars