本文整理匯總了Python中term.Term.from_list方法的典型用法代碼示例。如果您正苦於以下問題:Python Term.from_list方法的具體用法?Python Term.from_list怎麽用?Python Term.from_list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類term.Term
的用法示例。
在下文中一共展示了Term.from_list方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: visible_children
# 需要導入模塊: from term import Term [as 別名]
# 或者: from term.Term import from_list [as 別名]
def visible_children(asker, object):
expanded = convert.check_hard(asker, is_expanded(), object)
object = asker.refresh(object)
if not expanded:
return asker.reply(answer=T.from_list([]))
else:
children = asker.ask(fields.get_field(all_children(), object)).firm_answer
return asker.reply(answer=children)
示例2: add_children_on_expanded
# 需要導入模塊: from term import Term [as 別名]
# 或者: from term.Term import from_list [as 別名]
def add_children_on_expanded(asker, old, new, bindings):
children = []
for p in lists.iterator(asker, lists.from_dict(bindings)):
k = asker.ask(fields.get_field(first(), p)).firm_answer
v = asker.ask(fields.get_field(second(), p)).firm_answer
prefix = strings.string_concat(k, T.from_str(": "))
new_node = node_from_term(asker, v)
new_node = updates.update(
updates.apply_to(headline(), strings.prepend_str(prefix)),
new_node
)
children.append(new_node)
return asker.reply(answer=updates.update(
fields.set_field(all_children(), T.from_list(children)),
new
))
示例3: T
# 需要導入模塊: from term import Term [as 別名]
# 或者: from term.Term import from_list [as 別名]
import convert
import representations
import properties
import updates
import outlines
import builtins
import computations
import term
import termtypes
import state
import views
import functions
import strings
from term import Term as T
k = updates.update(updates.trivial(), T.from_int(0))
d = T('test [a]', a=k)
Q = T('a question about [this]', this=k)
asker = ask.Asker(Q)
a = T('a')
b = T('b')
c = T('c')
l1 = T.from_list([a, b, c])
l2 = T.from_list([a, a, a])
l12 = lists.zip(l1, l2)
d = dictionaries.from_items(l12)
示例4: render_char
# 需要導入模塊: from term import Term [as 別名]
# 或者: from term.Term import from_list [as 別名]
def render_char(asker, x):
return asker.reply(answer=T.simple_str(T.from_list([c])))
示例5: get_starting_view
# 需要導入模塊: from term import Term [as 別名]
# 或者: from term.Term import from_list [as 別名]
def get_starting_view(asker, query):
head = fields.get(asker, representations.head(), query)
bindings = fields.get(asker, representations.bindings(), query)
initial_lines = T.from_list([head, T.from_str("---")])
return asker.reply(answer=view(initial_lines, bindings))
示例6: make_list_expr
# 需要導入模塊: from term import Term [as 別名]
# 或者: from term.Term import from_list [as 別名]
def make_list_expr(l):
return T(make_list_expr.head, l=T.from_list(l))