本文整理汇总了Python中quex.engine.misc.interval_handling.NumberSet.clean方法的典型用法代码示例。如果您正苦于以下问题:Python NumberSet.clean方法的具体用法?Python NumberSet.clean怎么用?Python NumberSet.clean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quex.engine.misc.interval_handling.NumberSet
的用法示例。
在下文中一共展示了NumberSet.clean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_Composition_Exclusion
# 需要导入模块: from quex.engine.misc.interval_handling import NumberSet [as 别名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import clean [as 别名]
def load_Composition_Exclusion(self):
# Column 0 contains what is interesting ...
table = parse_table("CompositionExclusions.txt", NumberColumnList=[0])
number_set = NumberSet()
for row in table:
begin = row[0]
number_set.quick_append_interval(Interval(begin, begin + 1))
number_set.clean()
self.db["CE"].code_point_db = number_set
示例2: verify
# 需要导入模块: from quex.engine.misc.interval_handling import NumberSet [as 别名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import clean [as 别名]
def verify(A, TrafoInfo):
result = NumberSet()
for interval in A.get_intervals():
for x in range(interval.begin, interval.end):
for source_begin, source_end, target_begin in TrafoInfo:
if x >= source_begin and x < source_end:
offset = x - source_begin
y = target_begin + offset
result.quick_append_interval(Interval(y))
result.clean()
result.assert_consistency()
return result
示例3: create_random_number_set
# 需要导入模块: from quex.engine.misc.interval_handling import NumberSet [as 别名]
# 或者: from quex.engine.misc.interval_handling.NumberSet import clean [as 别名]
def create_random_number_set():
result = NumberSet()
for begin, end in create_random_interval_list(False):
result.quick_append_interval(Interval(begin, end))
result.clean()
return result