etymology / backend /sql /ingestion /06_create_macros.sql
lucharo's picture
Super-squash branch 'main' using huggingface_hub
13812dc
raw
history blame contribute delete
373 Bytes
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);