本文整理汇总了Python中pattern.Pattern.load方法的典型用法代码示例。如果您正苦于以下问题:Python Pattern.load方法的具体用法?Python Pattern.load怎么用?Python Pattern.load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pattern.Pattern
的用法示例。
在下文中一共展示了Pattern.load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from pattern import Pattern [as 别名]
# 或者: from pattern.Pattern import load [as 别名]
num_users = 0
if len(value["user"]) > 0:
num_users = len(value["user"])
selected_users = value["user"]
else:
num_users = float(self.attributes["user"]["domain"])*float(value["groupSupport"])
while len(selected_users) < num_users:
selected = random.randrange(1, int(self.attributes["user"]["domain"]))
selected_user = self.attributes["user"]["represent"] + str(selected)
if selected_user not in selected_users:
selected_users.append(selected_user)
for user in selected_users:
if user not in self.exp_sequences:
self.exp_sequences[user] = {}
self.exp_sequences[user][key] = expanded
if __name__ == '__main__':
attribute = Attribute()
attribute.load_dist_json()
attribute.load_attr_cvs()
pattern = Pattern(attribute.sem_to_rep)
pattern.load()
expanded_seq = Sequencepat(attribute.distribution, pattern.patterns)
expanded_seq.expand()
#print expanded_seq.exp_sequences
print json.dumps(expanded_seq.exp_sequences)