本文整理汇总了Python中quex.engine.misc.interval_handling.NumberSet.get_complement方法的典型用法代码示例。如果您正苦于以下问题:Python NumberSet.get_complement方法的具体用法?Python NumberSet.get_complement怎么用?Python NumberSet.get_complement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quex.engine.misc.interval_handling.NumberSet
的用法示例。
在下文中一共展示了NumberSet.get_complement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __get_remaining_set
# 需要导入模块: from quex.engine.misc.interval_handling import NumberSet [as 别名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import get_complement [as 别名]
def __get_remaining_set(self):
ignored = (E_CharacterCountType.BAD,
E_CharacterCountType.BEGIN_NEWLINE_SUPPRESSOR,
E_CharacterCountType.BEGIN_NEWLINE,
E_CharacterCountType.END_NEWLINE)
result = NumberSet()
for character_set, info in self.__map:
if info.cc_type in ignored: continue
result.unite_with(character_set)
return result.get_complement(Setup.buffer_codec.source_set)
示例2: test
# 需要导入模块: from quex.engine.misc.interval_handling import NumberSet [as 别名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import get_complement [as 别名]
def test(X):
print "#_______________________________________________"
nset = NumberSet([ Interval(x, y) for x, y in X])
clone = nset.clone()
print "#NumberSet: %s" % nset
result = nset.clone()
result.complement(all)
print "#NumberSet.inverse: %s" % result
assert result.is_equal(nset.get_complement(all))
assert result.intersection(nset).is_empty()
assert result.union(nset).is_all()