Ignore:
Timestamp:
Nov 7, 2016, 3:54:09 PM (3 years ago)
Author:
xwa163
Message:
  1. Extend Regex Syntax, include: (a) RL2.6 of UTS#18, support regex in property value. e.g. \p{script=/.*hir.*/} (b) Support syntax of property expression when parsing boundary. e.g. \b{greek} (c) Extend property expression in non capture group. e.g. (?\p{upper}:\p{greek}\p{script=hira})
  2. Add related test cases
File:
1 edited

Legend:

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

    r5159 r5206  
    3030int PropertyObject::GetPropertyValueEnumCode(const std::string & value_spec) {
    3131    throw std::runtime_error("Property " + value_spec + " unsupported.");
     32}
     33const std::string& PropertyObject::GetPropertyValueGrepString() {
     34    throw std::runtime_error("Property Value Grep String unsupported.");
    3235}
    3336
     
    7376};
    7477
    75    
     78const std::string& EnumeratedPropertyObject::GetPropertyValueGrepString() {
     79    if (!property_value_grep_string.size()) {
     80        for (unsigned i = 0; i != property_value_full_names.size(); i++) {
     81            property_value_grep_string += canonicalize_value_name(property_value_full_names[i]) + "\n";
     82        }
     83        for (unsigned i = 0; i != property_value_enum_names.size(); i++) {
     84            property_value_grep_string += canonicalize_value_name(property_value_enum_names[i]) + "\n";
     85        }
     86    }
     87    return property_value_grep_string;
     88}
     89
    7690int EnumeratedPropertyObject::GetPropertyValueEnumCode(const std::string & value_spec) {
    7791    // The canonical full names are not stored in the precomputed alias map,
     
    123137}
    124138
     139const std::string& ExtensionPropertyObject::GetPropertyValueGrepString() {
     140    return property_object_table[base_property]->GetPropertyValueGrepString();
     141}
     142
    125143const UnicodeSet & BinaryPropertyObject::GetCodepointSet(const std::string & value_spec) {
    126144    int property_enum_val = Binary_ns::Y;
     
    146164}
    147165
     166const std::string& BinaryPropertyObject::GetPropertyValueGrepString() {
     167    if (!property_value_grep_string.size()) {
     168        for (auto iter = Binary_ns::aliases_only_map.begin(), end = Binary_ns::aliases_only_map.end(); iter != end; ++iter) {
     169            property_value_grep_string += iter->first + "\n";
     170        }
     171    }
     172    return property_value_grep_string;
    148173}
     174
     175}
Note: See TracChangeset for help on using the changeset viewer.