本文整理汇总了Python中tagger.Tagger.makeRegex方法的典型用法代码示例。如果您正苦于以下问题:Python Tagger.makeRegex方法的具体用法?Python Tagger.makeRegex怎么用?Python Tagger.makeRegex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tagger.Tagger
的用法示例。
在下文中一共展示了Tagger.makeRegex方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRegexEscapeExclamation
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexEscapeExclamation(self):
self.assertEqual(Tagger.makeRegex('%!'), '!')
示例2: testRegexEscapeAsterisk
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexEscapeAsterisk(self):
self.assertEqual(Tagger.makeRegex('%*'), '\*')
示例3: testRegexEscapeDot
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexEscapeDot(self):
self.assertEqual(Tagger.makeRegex('%.'), '\.')
示例4: testRegexEscapePipe
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexEscapePipe(self):
self.assertEqual(Tagger.makeRegex('%|'), '\|')
示例5: testRegexEscapeBackslash
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexEscapeBackslash(self):
self.assertEqual(Tagger.makeRegex('\\\\'), r'\\\\')
示例6: testRegexNumbers
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexNumbers(self):
self.assertEqual(Tagger.makeRegex('12314'), '12314')
示例7: testRegexSpecialLowerUpperLetters
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexSpecialLowerUpperLetters(self):
self.assertEqual(Tagger.makeRegex('%w'), '[a-zA-Z]')
示例8: testRegexEscapeRightParenthesis
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexEscapeRightParenthesis(self):
self.assertEqual(Tagger.makeRegex('%)'), '\)')
示例9: testRegexSpecialLowercaseLetters
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexSpecialLowercaseLetters(self):
self.assertEqual(Tagger.makeRegex('%l'), '[a-z]')
示例10: testRegexSpecialUppercaseLetters
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexSpecialUppercaseLetters(self):
self.assertEqual(Tagger.makeRegex('%L'), '[A-Z]')
示例11: testRegexSpecialNumbers
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexSpecialNumbers(self):
self.assertEqual(Tagger.makeRegex('%d'), '\d')
示例12: testRegexSpecialArbitraryLetter
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexSpecialArbitraryLetter(self):
self.assertEqual(Tagger.makeRegex('%a'), '.')
示例13: testRegexSpecialWhitespace
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexSpecialWhitespace(self):
self.assertEqual(Tagger.makeRegex('%s'), '\s')
示例14: testRegexEscapePlus
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexEscapePlus(self):
self.assertEqual(Tagger.makeRegex('%+'), '\+')
示例15: testRegexSpecialLowerUpperLettersAndNumbers
# 需要导入模块: from tagger import Tagger [as 别名]
# 或者: from tagger.Tagger import makeRegex [as 别名]
def testRegexSpecialLowerUpperLettersAndNumbers(self):
self.assertEqual(Tagger.makeRegex('%W'), '[a-zA-Z0-9]')