| 229 | } |
| 230 | |
| 231 | bool MatchFeatureByPostcode(EditableMapObject const & emo, TokenSlice const & slice) |
| 232 | { |
| 233 | auto const tokens = NormalizeAndTokenizeString(emo.GetPostcode()); |
| 234 | if (slice.Size() > tokens.size()) |
| 235 | return false; |
| 236 | for (size_t i = 0; i < slice.Size(); ++i) |
| 237 | { |
| 238 | if (slice.IsPrefix(i)) |
| 239 | { |
| 240 | if (!StartsWith(tokens[i], slice.Get(i).GetOriginal())) |
| 241 | return false; |
| 242 | } |
| 243 | else if (tokens[i] != slice.Get(i).GetOriginal()) |
| 244 | { |
| 245 | return false; |
| 246 | } |
| 247 | } |
| 248 | return true; |
| 249 | } |
| 250 | |
| 251 | template <typename Value, typename DFA> |
| 252 | Retrieval::ExtendedFeatures RetrieveAddressFeaturesImpl(Retrieval::TrieRoot<Value> const & root, |
no test coverage detected