3.2.1 title Rules

“title rules” are rules that are matched against each entry’s title. You may match by substring, regexp or whole word. The match may be case sensitive or case-insensitive. Of course, the rule needs to specify the amount to be added to an entry’s score on successful match.

In the score file (see The Score File), title rules are represented by a property list of up to seven attributes:

  1. :text: The match text.
  2. :value: The match value. This is an integer specifying the amount by which the entry’s score should be adjusted, should the text match
  3. :type: The match type.

    This is a symbol, and must be one of s, S, r, R, w or W for case-insensitive substring match, case-sensitive substring match, case-insensitive regexp match or case-sensitive regexp match, and case-insensitive or case-sensitive whole word match, respectively.

    Note that regular expressions use Emacs Lisp regular expression syntax (see Regular Expressions in Emacs Lisp).

    Whole word matching just feeds the match text to word-search-regexp (see String Search in Emacs Lisp) before doing a regexp search.

  4. :tags: Tag scoping rules.

    You may wish to apply this rule only to entries that have certain tags (or that do not have certain tags). See Scoping Rules by Tags for how to do that.

    This property is optional.

  5. :feeds: Feed scoping rules.

    You may wish to apply this rule only to entries that came from certain feeds (or did not come from certain feeds). See Scoping Rules by Feed for how to do that.

    This property is optional.

  6. :comment: Rule comment

    An optional, free-form note on this rule. Since Lisp comments will be lost on read, this provides a way for the score file author to annotate rules.

So, for instance, the following rule:

("title"
  (:text "rust.*who.s hiring" :value 1500 :type r))

would match each entry’s title against the regular expression “rust.*who.s hiring” (without regard to case) and adds 1500 to the score of any entry that matches.

Note that it takes advantage of the fact that only the :text, :value & :type properties are required.