File size: 373 Bytes
13812dc
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
CREATE OR REPLACE MACRO is_phrase(lexeme) AS
    lexeme LIKE '% %';

CREATE OR REPLACE MACRO is_proper_noun(lexeme) AS
    regexp_matches(lexeme, '^[A-Z][a-z]');

CREATE OR REPLACE MACRO is_clean_word(lexeme) AS
    NOT is_phrase(lexeme) AND NOT is_proper_noun(lexeme);

CREATE OR REPLACE MACRO has_etymology(word_ix) AS
    word_ix IN (SELECT DISTINCT source FROM links);