Ignore:
Timestamp:
Apr 8, 2018, 5:31:54 PM (12 months ago)
Author:
cameron
Message:

InternalSearchEngine?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/PropertyObjects.cpp

    r5892 r5954  
    11/*
    2  *  Copyright (c) 2017 International Characters, Inc.
     2 *  Copyright (c) 2018 International Characters, Inc.
    33 *  This software is licensed to the public under the Open Software License 3.0.
    44 *  icgrep is a trademark of International Characters, Inc.
     
    9090   
    9191    PropertyValueAccumulator accum(accumulatedValues);
    92     grepBuffer(pattern, aligned, n, & accum);
     92   
     93    grep::InternalSearchEngine engine;
     94    engine.setRecordBreak(grep::GrepRecordBreakKind::LF);
     95    engine.grepCodeGen(pattern, nullptr, & accum);
     96    engine.doGrep(aligned, n);
     97    //grepBuffer(pattern, aligned, n, & accum);
    9398    alloc.deallocate(aligned, 0);
    9499   
    95100    UnicodeSet a;
    96101    for (const auto & v : accumulatedValues) {
     102       
    97103        int e = GetPropertyValueEnumCode(v);
    98104        a.insert(GetCodepointSet(e));
     
    213219   
    214220    PropertyValueAccumulator accum(accumulatedValues);
    215     grepBuffer(pattern, aligned, n, & accum);
     221    grep::InternalSearchEngine engine;
     222    engine.setRecordBreak(grep::GrepRecordBreakKind::LF);
     223    engine.grepCodeGen(pattern, nullptr, & accum);
     224    engine.doGrep(aligned, n);
    216225    alloc.deallocate(aligned, 0);
    217226   
     
    335344const UnicodeSet NumericPropertyObject::GetCodepointSetMatchingPattern(re::RE * pattern) {
    336345    SetByLineNumberAccumulator accum(mExplicitCps, mNaNCodepointSet);
    337     grepBuffer(pattern, mStringBuffer, mBufSize, &accum);
     346    grep::InternalSearchEngine engine;
     347    engine.setRecordBreak(grep::GrepRecordBreakKind::LF);
     348    engine.grepCodeGen(pattern, nullptr, & accum);
     349    engine.doGrep(mStringBuffer, mBufSize);
     350    //grepBuffer(pattern, mStringBuffer, mBufSize, &accum);
    338351    return accum.getAccumulatedSet();
    339352}
     
    374387    }
    375388    SetByLineNumberAccumulator accum(mExplicitCps, mNullCodepointSet);
    376     grepBuffer(pattern, mStringBuffer, mBufSize, & accum);   
     389    grep::InternalSearchEngine engine;
     390    engine.setRecordBreak(grep::GrepRecordBreakKind::LF);
     391    engine.grepCodeGen(pattern, nullptr, & accum);
     392    engine.doGrep(mStringBuffer, mBufSize);
     393
    377394    matched.insert(accum.getAccumulatedSet());
    378395    return matched;
     
    407424    UnicodeSet base_set = mBaseObject.GetCodepointSetMatchingPattern(pattern) - mOverriddenSet;
    408425    SetByLineNumberAccumulator accum(mExplicitCps, UnicodeSet());
    409     grepBuffer(pattern, mStringBuffer, mBufSize, & accum);
     426    grep::InternalSearchEngine engine;
     427    engine.setRecordBreak(grep::GrepRecordBreakKind::LF);
     428    engine.grepCodeGen(pattern, nullptr, & accum);
     429    engine.doGrep(mStringBuffer, mBufSize);
    410430    base_set.insert(accum.getAccumulatedSet());
    411431    return base_set;
Note: See TracChangeset for help on using the changeset viewer.