Inform 7

exception textworld.generator.inform7.world2inform7.CouldNotCompileGameError[source]

Bases: RuntimeError

exception textworld.generator.inform7.world2inform7.TextworldInform7Warning[source]

Bases: UserWarning

class textworld.generator.inform7.world2inform7.Inform7Game(game)[source]

Bases: object

define_inform7_kinds()[source]

Generate Inform 7 kind definitions.

Return type

str

detect_action(i7_event, actions)[source]

Detect which action corresponds to a Inform7 event.

Parameters
  • i7_event (str) – Inform7 event detected.

  • actions (Iterable[Action]) – List of action to match the Inform7 event against.

Return type

Optional[Action]

Returns

Action corresponding to the provided Inform7 event.

gen_commands_from_actions(actions)[source]
Return type

List[str]

gen_source(seed=1234)[source]
Return type

str

gen_source_for_attribute(attr)[source]
Return type

Optional[str]

gen_source_for_attributes(attributes)[source]
Return type

str

gen_source_for_conditions(conds)[source]

Generate Inform 7 source for winning/losing conditions.

Return type

str

gen_source_for_map(src_room)[source]
Return type

str

gen_source_for_objects(objects)[source]
Return type

str

gen_source_for_rooms()[source]
Return type

str

get_human_readable_action(action)[source]
Return type

Action

get_human_readable_fact(fact)[source]
Return type

Proposition

VERSION = 1
textworld.generator.inform7.world2inform7.compile_inform7_game(source, output, verbose=False)[source]
Return type

None

textworld.generator.inform7.world2inform7.generate_inform7_source(game, seed=1234, use_i7_description=False)[source]
Return type

str

textworld.generator.inform7.world2inform7.split_string(string, name, cutoff=200)[source]