Oyelowo / surreal-orm

Powerful & expressive ORM/query-builder/static checker for raw queries/Fully Automated migration tooling , designed to offer an intuitive API, strict type-checking, novel features, & full specification support. It provides a fresh perspective in data management. Currently supports SurrealDB engine. RDMSs(PG, MYSQL etc) and others coming soon
85 stars 2 forks source link

Implement define analyzer statement #28

Closed Oyelowo closed 11 months ago

Oyelowo commented 11 months ago

Implement define analyzer statement

    use super::*;

    #[test]
    fn test_define_analyzer_statement() {
        use AnalyzerFilter::*;
        use Tokenizer::*;

        let analyzer = define_analyzer("ascii").tokenizers([Class]).filters([
            Lowercase,
            Ascii,
            Edgengram(2, 15),
            Snowball(SnowballLanguage::English),
        ]);

        assert_eq!(
            analyzer.build(),
            "DEFINE ANALYZER ascii TOKENIZERS Class FILTERS lowercase,ascii,edgengram(2, 15),snowball(english);"
        );
    }