コード例 #1
0
ファイル: test_approx_match.py プロジェクト: adjustive/enki
 def test_12(self):
     index = lcs(searchAnchor = 6,
             # Place searchAnchor between ``bwxyzc`` and ``d``.
             searchText = 'bwxyzcd',
             targetText = 'bqwc?xyzaad')[0]
             # The expected targetText index is between ``bqwc?xyza`` and ``d``.
     self.assertIn(index, (8, 9, 10))
コード例 #2
0
ファイル: test_approx_match.py プロジェクト: adjustive/enki
 def test_14(self):
     index = lcs(searchAnchor = 1,
                 returnLcsString = True,
                 # Place searchAnchor between ``a`` and ``b``.
                 searchText = 'ab',
                 targetText = 'a--b')[0]
                 # The expected targetText index is between ``a`` and ``b``.
     self.assertIn(index, (1, 2, 3))
コード例 #3
0
 def test_12(self):
     index = lcs(
         searchAnchor=6,
         # Place searchAnchor between ``bwxyzc`` and ``d``.
         searchText='bwxyzcd',
         targetText='bqwc?xyzaad')[0]
     # The expected targetText index is between ``bqwc?xyza`` and ``d``.
     self.assertIn(index, (8, 9, 10))
コード例 #4
0
ファイル: test_approx_match.py プロジェクト: gpa14/enki
 def test_9(self):
     string = lcs(
         searchAnchor=0,
         returnLcsString=True,
         searchText="age = None# `exclude_patterns# <http://sphinx-doc.org/config.html#confval-exclude_patterns>`_: List of# patterns, re",
         targetText="for a list of supported languages.##language = None exclude_patterns: List of patterns, re",
     )[1]
     self.assertEqual(string, "a  o upte ngg.lnaexclude_patterns: List of patterns, re")
コード例 #5
0
ファイル: test_approx_match.py プロジェクト: gpa14/enki
 def test_11(self):
     index = lcs(
         searchAnchor=9,
         # Place searchAnchor between ``bqwc?xyza`` and ``ad``.
         searchText="bqwc?xyzaad",
         targetText="bwxyzcd",
     )[0]
     # The expected targetText index is between ``bwxyzc`` and ``d``.
     self.assertIn(index, (5, 6))
コード例 #6
0
 def test_14(self):
     index = lcs(
         searchAnchor=1,
         returnLcsString=True,
         # Place searchAnchor between ``a`` and ``b``.
         searchText='ab',
         targetText='a--b')[0]
     # The expected targetText index is between ``a`` and ``b``.
     self.assertIn(index, (1, 2, 3))
コード例 #7
0
ファイル: test_approx_match.py プロジェクト: adjustive/enki
 def test_15(self):
     index = lcs(searchAnchor = 10,
                 returnLcsString = True,
                 # Place searchAnchor between ``Chapter 1:`` and
                 # ``Once upon a time``.
                 searchText = 'Chapter 1:Once upon a time',
                 targetText = ':---------Once upon a time')[0]
                 # The expected targetText index is between ``:---------``
                 # and ``Once upon a time``.
     self.assertEqual(index, 10)
コード例 #8
0
ファイル: test_approx_match.py プロジェクト: adjustive/enki
 def test_10(self):
     print os.getcwd()
     with open("D:\\enki\\tests\\test_plugins\\test_ApproxMatch.py", 'r') as file:
         searchText = file.read()
     targetText = searchText
     string = lcs(searchAnchor = 0,
                  returnLcsString = True,
                  searchText = searchText,
                  targetText = targetText)[1]
     self.assertEqual(string, searchText)
コード例 #9
0
ファイル: test_approx_match.py プロジェクト: adjustive/enki
 def test_16(self):
     index = lcs(searchAnchor = 16,
                 returnLcsString = True,
                 # Place searchAnchor between ``Once upon a time`` and
                 # ``, there lived``.
                 searchText = 'Once upon a time, there lived',
                 targetText = 'Once upon a time------------,')[0]
                 # The expected targetText index is between
                 # ``Once upon a time`` and ``------------,``.
     self.assertEqual(index, 16)
コード例 #10
0
 def test_16(self):
     index = lcs(
         searchAnchor=16,
         returnLcsString=True,
         # Place searchAnchor between ``Once upon a time`` and
         # ``, there lived``.
         searchText='Once upon a time, there lived',
         targetText='Once upon a time------------,')[0]
     # The expected targetText index is between
     # ``Once upon a time`` and ``------------,``.
     self.assertEqual(index, 16)
コード例 #11
0
ファイル: test_approx_match.py プロジェクト: gpa14/enki
 def test_8(self):
     string = lcs(
         searchAnchor=0,
         returnLcsString=True,
         searchText="# The :doc:`README` user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.",
         targetText="The CodeChat user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.",
     )[1]
     self.assertEqual(
         string,
         "The d user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.",
     )
コード例 #12
0
 def test_9(self):
     string = lcs(
         searchAnchor=0,
         returnLcsString=True,
         searchText=
         'age = None# `exclude_patterns# <http://sphinx-doc.org/config.html#confval-exclude_patterns>`_: List of# patterns, re',
         targetText=
         'for a list of supported languages.##language = None exclude_patterns: List of patterns, re'
     )[1]
     self.assertEqual(
         string, 'a  o upte ngg.lnaexclude_patterns: List of patterns, re')
コード例 #13
0
 def test_15(self):
     index = lcs(
         searchAnchor=10,
         returnLcsString=True,
         # Place searchAnchor between ``Chapter 1:`` and
         # ``Once upon a time``.
         searchText='Chapter 1:Once upon a time',
         targetText=':---------Once upon a time')[0]
     # The expected targetText index is between ``:---------``
     # and ``Once upon a time``.
     self.assertEqual(index, 10)
コード例 #14
0
 def test_8(self):
     string = lcs(
         searchAnchor=0,
         returnLcsString=True,
         searchText=
         '# The :doc:`README` user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.',
         targetText=
         'The CodeChat user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.'
     )[1]
     self.assertEqual(
         string,
         'The d user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.'
     )
コード例 #15
0
ファイル: test_approx_match.py プロジェクト: adjustive/enki
    def test_13(self):
        index = lcs(searchAnchor = 30,
                    returnLcsString = True,
                    # Place searchAnchor between ``| '`` and ``Text after block 1,2, and 3``.
                    searchText = '------------+-------------+\n' +
                                 '| Text after block 1,2, and 3   ',
                    targetText = """a 2

Bael 2
Coco 3 Cherry 3
Text after block 1,2, and 3""")[0]
                    # The expected targetText index is at the beginning of the
                    # line ``Text after block 1,2, and 3``.
        self.assertEqual(index, 28)
コード例 #16
0
    def test_13(self):
        index = lcs(
            searchAnchor=30,
            returnLcsString=True,
            # Place searchAnchor between ``| '`` and ``Text after block 1,2, and 3``.
            searchText='------------+-------------+\n' +
            '| Text after block 1,2, and 3   ',
            targetText="""a 2

Bael 2
Coco 3 Cherry 3
Text after block 1,2, and 3""")[0]
        # The expected targetText index is at the beginning of the
        # line ``Text after block 1,2, and 3``.
        self.assertEqual(index, 28)
コード例 #17
0
ファイル: test_approx_match.py プロジェクト: gpa14/enki
 def test_3(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="abc", targetText="abc")[1]
     self.assertEqual(string, "abc")
コード例 #18
0
 def test_7(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='abc\ndef',
                  targetText='gh\nijkl')[1]
     self.assertEqual(string, '\n')
コード例 #19
0
 def test_6(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Niederösterreich',
                  targetText='Oberösterreich')[1]
     self.assertEqual(string, 'erösterreich')
コード例 #20
0
ファイル: test_approx_match.py プロジェクト: gpa14/enki
 def test_6(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Niederösterreich", targetText="Oberösterreich")[
         1
     ]
     self.assertEqual(string, "erösterreich")
コード例 #21
0
ファイル: test_approx_match.py プロジェクト: gpa14/enki
 def test_4(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Fox", targetText="Bear")[1]
     self.assertEqual(string, "")
コード例 #22
0
ファイル: test_approx_match.py プロジェクト: lukeandrew/enki
 def test_6(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Niederösterreich',
                  targetSubstring = 'Oberösterreich')[2]
     self.assertEqual(string, 'erösterreich')
コード例 #23
0
ファイル: test_approx_match.py プロジェクト: lukeandrew/enki
 def test_4(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Fox',
                  targetSubstring = 'Bear')[2]
     self.assertEqual(string, '')
コード例 #24
0
ファイル: test_approx_match.py プロジェクト: gpa14/enki
 def test_7(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="abc\ndef", targetText="gh\nijkl")[1]
     self.assertEqual(string, "\n")
コード例 #25
0
 def test_5(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Fußball',
                  targetText='Football')[1]
     self.assertEqual(string, 'Fball')
コード例 #26
0
ファイル: test_approx_match.py プロジェクト: lukeandrew/enki
 def test_8(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = '# The :doc:`README` user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.',
                  targetSubstring = 'The CodeChat user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.')[2]
     self.assertEqual(string, 'The d user manual gives a broad overview of this system. In contrast, this document discusses the implementation specifics of the CodeChat system.')
コード例 #27
0
ファイル: test_approx_match.py プロジェクト: gpa14/enki
 def test_5(self):
     string = lcs(searchAnchor=0, returnLcsString=True, searchText="Fußball", targetText="Football")[1]
     self.assertEqual(string, "Fball")
コード例 #28
0
ファイル: test_approx_match.py プロジェクト: lukeandrew/enki
 def test_3(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'abc',
                  targetSubstring = 'abc')[2]
     self.assertEqual(string, 'abc')
コード例 #29
0
ファイル: test_approx_match.py プロジェクト: adjustive/enki
 def test_7(self):
     string = lcs(searchAnchor = 0,
                  returnLcsString = True,
                  searchText = 'abc\ndef',
                  targetText = 'gh\nijkl')[1]
     self.assertEqual(string, '\n')
コード例 #30
0
ファイル: test_approx_match.py プロジェクト: lukeandrew/enki
 def test_5(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'Fußball',
                  targetSubstring = 'Football')[2]
     self.assertEqual(string, 'Fball')
コード例 #31
0
 def test_3(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='abc',
                  targetText='abc')[1]
     self.assertEqual(string, 'abc')
コード例 #32
0
ファイル: test_approx_match.py プロジェクト: lukeandrew/enki
 def test_7(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'abc\ndef',
                  targetSubstring = 'gh\nijkl')[2]
     self.assertEqual(string, '\n')
コード例 #33
0
 def test_4(self):
     string = lcs(searchAnchor=0,
                  returnLcsString=True,
                  searchText='Fox',
                  targetText='Bear')[1]
     self.assertEqual(string, '')
コード例 #34
0
ファイル: test_approx_match.py プロジェクト: lukeandrew/enki
 def test_9(self):
     string = lcs(searchAnchor = 0,
                  searchPattern = 'age = None# `exclude_patterns# <http://sphinx-doc.org/config.html#confval-exclude_patterns>`_: List of# patterns, re',
                  targetSubstring = 'for a list of supported languages.##language = None exclude_patterns: List of patterns, re')[2]
     self.assertEqual(string, 'a  o upte ngg.lnaexclude_patterns: List of patterns, re')
コード例 #35
0
ファイル: test_approx_match.py プロジェクト: adjustive/enki
 def test_4(self):
     string = lcs(searchAnchor = 0,
                  returnLcsString = True,
                  searchText = 'Fox',
                  targetText = 'Bear')[1]
     self.assertEqual(string, '')