libosmscout 1.1.1
Loading...
Searching...
No Matches
GenTextIndex.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_IMPORT_GENTEXTINDEX_H
2#define OSMSCOUT_IMPORT_GENTEXTINDEX_H
3
4/*
5 This source is part of the libosmscout library
6 Copyright (C) 2013 Preet Desai
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#include <marisa.h>
24
26#include <osmscout/ObjectRef.h>
27
29
31
32namespace osmscout
33{
34 class TextIndexGenerator CLASS_FINAL : public ImportModule
35 {
36 public:
37 void GetDescription(const ImportParameter& parameter,
38 ImportModuleDescription& description) const override;
39
40 bool Import(const TypeConfigRef& typeConfig,
41 const ImportParameter &parameter,
42 Progress &progress) override;
43
44 private:
45 uint8_t GetFileOffsetSizeBytes(const ImportParameter &parameter,
46 Progress &progress);
47
48 bool AddNodeTextToKeysets(const ImportParameter &parameter,
49 Progress &progress,
50 const TypeConfig &typeConfig,
51 uint8_t offsetSizeBytes);
52
53 bool AddWayTextToKeysets(const ImportParameter &parameter,
54 Progress &progress,
55 const TypeConfig &typeConfig,
56 uint8_t offsetSizeBytes);
57
58 bool AddAreaTextToKeysets(const ImportParameter &parameter,
59 Progress &progress,
60 const TypeConfig &typeConfig,
61 uint8_t offsetSizeBytes);
62
63 bool BuildKeyStr(const std::string& text,
64 uint8_t offsetSizeBytes,
65 FileOffset offset,
66 const RefType& reftype,
67 std::string& keyString) const;
68
69 bool AddKeyStr(const std::string& text,
70 uint8_t offsetSizeBytes,
71 FileOffset offset,
72 const RefType& reftype,
73 marisa::Keyset *keyset,
74 ImportParameter::TextIndexVariant variant) const;
75
76 // keysets used to store text data and generate tries
77 marisa::Keyset keysetPoi;
78 marisa::Keyset keysetLocation;
79 marisa::Keyset keysetRegion;
80 marisa::Keyset keysetOther;
81 };
82}
83
84
85#endif // OSMSCOUT_IMPORT_GENTEXTINDEX_H
Definition Area.h:88
void GetDescription(const ImportParameter &parameter, ImportModuleDescription &description) const override
bool Import(const TypeConfigRef &typeConfig, const ImportParameter &parameter, Progress &progress) override
Definition ImportModule.h:101
uint64_t FileOffset
Definition OSMScoutTypes.h:46
std::shared_ptr< TypeConfig > TypeConfigRef
Definition TypeConfig.h:1396
Definition Area.h:39
RefType
Definition ObjectRef.h:139