Skip to content

Latest commit

 

History

History
123 lines (91 loc) · 3.17 KB

concepts.md

File metadata and controls

123 lines (91 loc) · 3.17 KB

<< back

Learn basics

To know how to build our asker input files, we need to learn these keywords:

  • map
  • concept
  • names
  • tags
  • def

Let's start!.


Text plain editor

  • Create a text file, called for example: demo/furniture.haml.
  • map: Once, at first line, we write keyword map. Example:
%map{ lang: 'en', context: 'furniture, home', version: '1'}
Attribute Description
lang Output texts will be created in English. Valid values: en, es
context Comma separated labels that define map content
version Input file format version. Valid value: 1

This input file will contain concepts about furniture context. Use diferents input files to define diferents contexts.

Use separated contexts is good idea. Sometimes, diferents concept from diferents contexts has the same names value. For example:

  • free as free of charge, costless.
  • free as in freedom.
  • concept, names, tags: So we identify our first concept:
  %concept
    %names chair
    %tags single, seat, leg, backrest
Param Description
names Comma separated concept's names
tags Comma separated words that help to characterize this concept
  • def: Use def keyword to add concept meaning. The def content must be uniquely associated to our concept. You can use def more than once.
  %concept
    %names chair
    %tags single, seat, leg, backrest
    %def Single seat with legs and backrest
    %def Furniture that is placed around the table to sit

At this time, we may generate questions with:

asker docs/examles/home/furniture.haml

Formats

HAML is a special format. It's necesary write exactly:

  • 0 spaces before map.
  • 2 spaces before concept.
  • 4 spaces before names, tags and def.

It's posible write the same using XML format instead. Take a look:

<map lang='en' context='furniture, home' version='1'>
  <concept>
    <names>chair</names>
    <tags>single, seat, leg, backrest</tags>
    <def>Single seat with legs and backrest</def>
    <def>Furniture that is placed around the table to sit</def>
  </concept>
</map>

Notice that furniture.haml is HAML file and furniture.xml a XML file. Both are valid.

HAML format files are the same as XML format files. Internaly HAML files are translated automaticaly to an XML equivalent.

Why write into HAML instead of XML? HAML It's easier (for me). You don't have to close every tag, only be carefuly with indentation.

If you prefer, you could write your input files using XML.

Increase questions number

Adding more concepts will increase questions number generated by ASKER:

  %concept
    %names couch
    %tags furniture, seat, two, threee, people, bench, armrest

  %concept
    %names table
    %tags furniture, flat, top, leg, surface, work, eat

  %concept
    %names bed
    %tags furniture, place, sleep, relax

Examples:

>> Learn about files