function as rule, with and without raw text processing