本文整理匯總了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()