Download backend/sql/ingestion/06_create_macros.sql from lucharo/etymology: direct link, hf CLI and curl.
- Browser
- Download file 373 Bytes
-
https://huggingface.co/spaces/lucharo/etymology/resolve/main/backend/sql/ingestion/06_create_macros.sql
- Command line
-
hf download hf://spaces/lucharo/etymology/backend/sql/ingestion/06_create_macros.sql
-
curl -L -o 06_create_macros.sql https://huggingface.co/spaces/lucharo/etymology/resolve/main/backend/sql/ingestion/06_create_macros.sql
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); | |