72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
# File 'lib/forkforge/internal/unicode_data.rb', line 72
def decompose_cp cp, tags = []
normalized = __to_code_point cp
mapping = get_character_decomposition_mapping cp
return normalized if mapping.vacant?
cps = mapping.split ' '
return normalized if ![*tags].vacant? && \
cps.inject(false) { |memo, cp|
memo || (CharacterDecompositionMapping::Tag::tag?(cp) && ![*tags].include?(CharacterDecompositionMapping::Tag::tag(cp).sym))
}
cps.reject { |cp|
Forkforge::CharacterDecompositionMapping::Tag::tag? cp
}.map { |cp| decompose_cp cp, tags }
end
|