Map clues

In previous chapter, there are already some words on mapping clues and mapping attributes. Here let's make a summary.

Steps to map clues

There are two main steps to map a clue as follows:

  1. Map a DOM node to the clue. The node takes different roles in different cases. In case of mapping an Info clue, the node is the exact one embracing the URL information. In case of mapping a marker clue, a pattern clue or a relative clue, the node specify a scope from which clues are to be extracted.
  2. Set or map the clue's attributes. For example, marks, patterns, referees and referrers can or must be mapped.


Constraints on mappings

Only nodes in specific types can be mapped to specific clues or attributes. The constraints are listed as follows:

  • To Info Clues, only HTML A elements can be mapped.
  • For Marker Clues:
    • To the clue, any nodes in type of HTML Element can be mapped. To make sense, the node should has a sub-tree below it. In other words, the node should denote a scope of the HTML page.
    • To marks, only a text node embraced by an HTML A element can be mapped.
  • For Pattern Clues:
    • To the clue, any nodes in type of HTML Element can be mapped. To make sense, the node should has a sub-tree below it. In other words, the node should denote a scope of the HTML page.
    • To patterns, only HTML A element can be mapped.
  • For Relative Clues:
    • To the clue, any nodes in type of HTML Element can be mapped. To make sense, the node should has a sub-tree below it. In other words, the node should denote a scope of the HTML page.
    • To the referee, any nodes in type of HTML Element can be mapped.
    • To the referrer, only the HTML A element being the elder brother of the referee can be mapped.