示例#1
0
Hash*
Normalizer_dump(Normalizer *self) {
    Normalizer_Dump_t super_dump
        = SUPER_METHOD_PTR(NORMALIZER, Lucy_Normalizer_Dump);
    Hash *dump = super_dump(self);
    int options = self->options;

    CharBuf *form = options & UTF8PROC_COMPOSE ?
                    options & UTF8PROC_COMPAT ?
                    CB_new_from_trusted_utf8("NFKC", 4) :
                    CB_new_from_trusted_utf8("NFC", 3) :
                        options & UTF8PROC_COMPAT ?
                        CB_new_from_trusted_utf8("NFKD", 4) :
                        CB_new_from_trusted_utf8("NFD", 3);

    Hash_Store_Str(dump, "normalization_form", 18, (Obj*)form);

    BoolNum *case_fold = Bool_singleton(options & UTF8PROC_CASEFOLD);
    Hash_Store_Str(dump, "case_fold", 9, (Obj*)case_fold);

    BoolNum *strip_accents = Bool_singleton(options & UTF8PROC_STRIPMARK);
    Hash_Store_Str(dump, "strip_accents", 13, (Obj*)strip_accents);

    return dump;
}
Hash*
SnowStemmer_Dump_IMP(SnowballStemmer *self) {
    SnowballStemmerIVARS *const ivars = SnowStemmer_IVARS(self);
    SnowStemmer_Dump_t super_dump
        = SUPER_METHOD_PTR(SNOWBALLSTEMMER, LUCY_SnowStemmer_Dump);
    Hash *dump = super_dump(self);
    Hash_Store_Utf8(dump, "language", 8, (Obj*)Str_Clone(ivars->language));
    return dump;
}
示例#3
0
Obj*
NoMatchQuery_dump(NoMatchQuery *self) {
    NoMatchQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(NOMATCHQUERY, Lucy_NoMatchQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Str(dump, "fails_to_match", 14,
                   (Obj*)Bool_singleton(self->fails_to_match));
    return (Obj*)dump;
}
示例#4
0
文件: PolyQuery.c 项目: apache/lucy
Obj*
PolyQuery_Dump_IMP(PolyQuery *self) {
    PolyQueryIVARS *ivars = PolyQuery_IVARS(self);
    PolyQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(POLYQUERY, LUCY_PolyQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Utf8(dump, "children", 8, Freezer_dump((Obj*)ivars->children));
    return (Obj*)dump;
}
示例#5
0
Hash*
EasyAnalyzer_dump(EasyAnalyzer *self) {
    EasyAnalyzerIVARS *const ivars = EasyAnalyzer_IVARS(self);
    EasyAnalyzer_Dump_t super_dump
        = SUPER_METHOD_PTR(EASYANALYZER, Lucy_EasyAnalyzer_Dump);
    Hash *dump = super_dump(self);
    Hash_Store_Str(dump, "language", 8, (Obj*)CB_Clone(ivars->language));
    return dump;
}
示例#6
0
Obj*
RegexTokenizer_Dump_IMP(RegexTokenizer *self) {
    RegexTokenizerIVARS *const ivars = RegexTokenizer_IVARS(self);
    RegexTokenizer_Dump_t super_dump
        = SUPER_METHOD_PTR(REGEXTOKENIZER, LUCY_RegexTokenizer_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Utf8(dump, "pattern", 7, (Obj*)Str_Clone(ivars->pattern));
    return (Obj*)dump;
}
示例#7
0
Obj*
Tokenizer_dump(Tokenizer *self)
{
    Tokenizer_dump_t super_dump
        = (Tokenizer_dump_t)SUPER_METHOD(&TOKENIZER, Tokenizer, Dump);
    Hash *dump = (Hash*)ASSERT_IS_A(super_dump(self), HASH);
    Hash_Store_Str(dump, "pattern", 7, Obj_Dump(self->pattern));
    return (Obj*)dump;
}
示例#8
0
文件: HitDoc.c 项目: hernan604/lucy
Hash*
HitDoc_Dump_IMP(HitDoc *self) {
    HitDocIVARS *const ivars = HitDoc_IVARS(self);
    HitDoc_Dump_t super_dump
        = SUPER_METHOD_PTR(HITDOC, LUCY_HitDoc_Dump);
    Hash *dump = super_dump(self);
    Hash_Store_Utf8(dump, "score", 5, (Obj*)Str_newf("%f64", ivars->score));
    return dump;
}
Obj*
PhraseQuery_Dump_IMP(PhraseQuery *self) {
    PhraseQueryIVARS *ivars = PhraseQuery_IVARS(self);
    PhraseQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(PHRASEQUERY, LUCY_PhraseQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
    Hash_Store_Utf8(dump, "terms", 5, Freezer_dump((Obj*)ivars->terms));
    return (Obj*)dump;
}
示例#10
0
文件: TermQuery.c 项目: apache/lucy
Obj*
TermQuery_Dump_IMP(TermQuery *self) {
    TermQueryIVARS *ivars = TermQuery_IVARS(self);
    TermQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(TERMQUERY, LUCY_TermQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
    Hash_Store_Utf8(dump, "term", 4, Freezer_dump(ivars->term));
    return (Obj*)dump;
}
示例#11
0
Obj*
PolyAnalyzer_Dump_IMP(PolyAnalyzer *self) {
    PolyAnalyzerIVARS *const ivars = PolyAnalyzer_IVARS(self);
    PolyAnalyzer_Dump_t super_dump
        = SUPER_METHOD_PTR(POLYANALYZER, LUCY_PolyAnalyzer_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    if (ivars->analyzers) {
        Hash_Store_Utf8(dump, "analyzers", 9,
                        Freezer_dump((Obj*)ivars->analyzers));
    }
    return (Obj*)dump;
}
示例#12
0
Obj*
SnowStop_Dump_IMP(SnowballStopFilter *self) {
    SnowballStopFilterIVARS *ivars = SnowStop_IVARS(self);
    SnowStop_Dump_t super_dump
        = SUPER_METHOD_PTR(SNOWBALLSTOPFILTER, LUCY_SnowStop_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    if (ivars->stoplist) {
        Hash_Store_Utf8(dump, "stoplist", 8,
                        Freezer_dump((Obj*)ivars->stoplist));
    }
    return (Obj*)dump;
}
示例#13
0
Obj*
ProximityQuery_Dump_IMP(ProximityQuery *self) {
    ProximityQueryIVARS *ivars = ProximityQuery_IVARS(self);
    ProximityQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(PROXIMITYQUERY, LUCY_ProximityQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
    Hash_Store_Utf8(dump, "terms", 5, Freezer_dump((Obj*)ivars->terms));
    Hash_Store_Utf8(dump, "within", 6,
                    (Obj*)Str_newf("%i64", (int64_t)ivars->within));
    return (Obj*)dump;
}
示例#14
0
文件: LeafQuery.c 项目: apache/lucy
Obj*
LeafQuery_Dump_IMP(LeafQuery *self) {
    LeafQueryIVARS *ivars = LeafQuery_IVARS(self);
    LeafQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(LEAFQUERY, LUCY_LeafQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    if (ivars->field) {
        Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
    }
    Hash_Store_Utf8(dump, "text", 4, Freezer_dump((Obj*)ivars->text));
    return (Obj*)dump;
}
示例#15
0
文件: RangeQuery.c 项目: apache/lucy
Obj*
RangeQuery_Dump_IMP(RangeQuery *self) {
    RangeQueryIVARS *ivars = RangeQuery_IVARS(self);
    RangeQuery_Dump_t super_dump
        = SUPER_METHOD_PTR(RANGEQUERY, LUCY_RangeQuery_Dump);
    Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
    Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
    if (ivars->lower_term) {
        Hash_Store_Utf8(dump, "lower_term", 10,
                        Freezer_dump((Obj*)ivars->lower_term));
    }
    if (ivars->upper_term) {
        Hash_Store_Utf8(dump, "upper_term", 10,
                        Freezer_dump((Obj*)ivars->upper_term));
    }
    Hash_Store_Utf8(dump, "include_lower", 13,
                    (Obj*)Bool_singleton(ivars->include_lower));
    Hash_Store_Utf8(dump, "include_upper", 13,
                    (Obj*)Bool_singleton(ivars->include_upper));
    return (Obj*)dump;
}
示例#16
0
Hash*
CaseFolder_Dump_IMP(CaseFolder *self) {
    CaseFolder_Dump_t super_dump
        = SUPER_METHOD_PTR(CASEFOLDER, LUCY_CaseFolder_Dump);
    return super_dump(self);
}