示例#1
0
    def testDecodeSyntheticWord_WordSmallJJ_expectTranslation_99(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result = embedding.decode_synthetic_word('jj')

        #assert
        assertThat(result).matches('99')
示例#2
0
    def testDecodeSyntheticWord_Empty_expectEmpty(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result = embedding.decode_synthetic_word('')

        #assert
        assertThat(result).is_empty()
示例#3
0
    def testDedodeEmbeddingLine_Embedding47_expectSizeOfEmbeddigIs512(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        _, result = embedding.decode_embedding_line(EMBEDDING_OF_47)

        #assert
        assertThat(result).is_nuple(512)
示例#4
0
    def testDedodeEmbeddingLine_Embedding47_expectHasOneDimension(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        _, result = embedding.decode_embedding_line(EMBEDDING_OF_47)

        #assert
        assertThat(result).has_dimensionality(1)
示例#5
0
    def testDecodeEmbeddingLine_Embedding47_expectDecodedIndexIsNotZero(self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result, _ = embedding.decode_embedding_line(EMBEDDING_OF_47)

        #assert
        assertThat(result).is_not_zero()
示例#6
0
    def testDecodeSyntheticWord_WordSmallBCDEFGHIJA_expectTranslation_1234567890(
            self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result = embedding.decode_synthetic_word('bcdefghija')

        #assert
        assertThat(result).matches('1234567890')
示例#7
0
    def testDecodeEmbeddingLine_TheUnknownEmbedding_expectDecodedIndexIsZero(
            self):
        # arrange
        embedding = dl4jembeddings.DL4jModifiedEmbeddings()

        #act
        result, _ = embedding.decode_embedding_line(EMBEDDING_OF_UNKNOWN)

        #assert
        assertThat(result).is_zero()