Skip to content

Commit

Permalink
[Release 0.07.5] Release of version 0.07.5
Browse files Browse the repository at this point in the history
  • Loading branch information
da115115 committed Mar 2, 2020
1 parent 3e75973 commit 9ee4e2b
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 30 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include (config/project_config_embeddable.cmake)
project (opentrep)
set_project_names (opentrep OpenTREP)
set_project_brief ("C++ Open Travel Request Parsing Library")
set_project_versions (0 07 4)
set_project_versions (0 07 5)

##
# Project options
Expand Down Expand Up @@ -67,7 +67,7 @@ packaging_set_other_options (TBZ2 "TBZ2;TGZ")
## Dependencies ##
########################################
#
get_external_libs (git "python 3.4" "boost 1.48" "icu 4.2" protobuf readline
get_external_libs (git "python 3.6" "boost 1.48" "icu 4.2" protobuf readline
"xapian 1.0" "soci 3.0" "sqlite 3.0" "mysql 5.1" doxygen)


Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Mon Mar 02 2020 Denis Arnaud <denis.arnaud_fedora at m4x.org> 0.07.5
- Updated the code for the new OPTD data format (Geonames coordinates
have been added)

* Sun Nov 10 2019 Denis Arnaud <denis.arnaud_fedora at m4x.org> 0.07.4
- FindBoost.cmake now supports older CMake versions

Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* 2020-03-02:
- Version 0.07.5
- Updated the code for the new OPTD data format (Geonames coordinates
have been added)

* 2019-11-10:
- Version 0.07.4
- FindBoost.cmake now supports older CMake versions
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ GitHub generates
[tar-balls on the fly for every tagged release](https://github.com/trep/opentrep/releases).
For instance:
```bash
$ wget https://github.com/trep/opentrep/archive/opentrep-0.07.4.tar.gz
$ wget https://github.com/trep/opentrep/archive/opentrep-0.07.5.tar.gz
```

Note that SourceForge also stores some
Expand Down Expand Up @@ -434,7 +434,7 @@ To customize OpenTREP to your environment, you can alter
the installation directory:
```bash
export INSTALL_BASEDIR="${HOME}/dev/deliveries"
export TREP_VER="0.07.4"
export TREP_VER="0.07.5"
if [ -d /usr/lib64 ]; then LIBSUFFIX="64"; fi
export LIBSUFFIX_4_CMAKE="-DLIB_SUFFIX=$LIBSUFFIX"
```
Expand Down Expand Up @@ -767,7 +767,7 @@ DYLD_INSERT_LIBRARIES=/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/l
* A work around is to explicitly use the MacOS native Python interpreter:
```bash
$ /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python ./opentrep/python/pyopentrep -d /tmp/opentrep/xapian_traveldb "nce sfo"
OPTD-maintained list of POR (points of reference): '~/dev/deliveries/opentrep-0.07.4/share/opentrep/data/por/test_optd_por_public.csv'
OPTD-maintained list of POR (points of reference): '~/dev/deliveries/opentrep-0.07.5/share/opentrep/data/por/test_optd_por_public.csv'
Xapian-based travel database/index: '/tmp/opentrep/xapian_traveldb0'
SQLite database: '/tmp/opentrep/sqlite_travel.db'
searchString: nce sfo
Expand Down
2 changes: 1 addition & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fi
#
VERSION_MAJOR=0
VERSION_MINOR=07
VERSION_PATCH=4
VERSION_PATCH=5
VERSION_TMP_STRING=`grep "set_project_versions" CMakeLists.txt | sed -e "s/set_project_versions.*\([0-9]\+.\+[0-9]\+.\+[0-9]\+\).\+/\1/"`
VERSION_STRING=`echo "${VERSION_TMP_STRING}" | grep "^[0-9]\+.[0-9]\+.[0-9]\+$"`

Expand Down
20 changes: 10 additions & 10 deletions data/por/test_optd_por_public.csv

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@

<center>
<p><font size="-2">
&copy;2009-2018 - <a href="#">Privacy</a> -
&copy;2009-2020 - <a href="#">Privacy</a> -
<a href="#">About Travel Search</a>
</font>
</center>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<a href="#">About Travel Search</a>
</font>
<p><font size=-2>
&copy;2009-2018 - <a href="#">Privacy</a>
&copy;2009-2020 - <a href="#">Privacy</a>
</font></p>
</center>

Expand Down
48 changes: 45 additions & 3 deletions opentrep/Location.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,20 @@ namespace OPENTREP {
return _wikiLink;
}

/**
* Get the Geonames latitude.
*/
const Latitude_T& getGeonameLatitude() const {
return _geonameLatitude;
}

/**
* Get the Geonames longitude.
*/
const Longitude_T& getGeonameLongitude() const {
return _geonameLongitude;
}

/**
* Get the map of name lists.
*/
Expand Down Expand Up @@ -787,6 +801,20 @@ namespace OPENTREP {
_wikiLink = WikiLink_T (iWikiLink);
}

/**
* Set the Geonames latitude.
*/
void setGeonameLatitude (const Latitude_T& iLatitude) {
_geonameLatitude = iLatitude;
}

/**
* Set the Geonames longitude.
*/
void setGeonameLongitude (const Longitude_T& iLongitude) {
_geonameLongitude = iLongitude;
}

/**
* Add a name for that location.
*
Expand Down Expand Up @@ -999,9 +1027,11 @@ namespace OPENTREP {
const ICAOCode_T&, const FAACode_T&,
const CommonName_T&, const ASCIIName_T&,
const EnvelopeID_T&,
const Date_T& iDateFrom, const Date_T& iDateEnd, const Comment_T&,
const Date_T& iDateFrom, const Date_T& iDateEnd,
const Comment_T&,
const CityDetailsList_T&,
const StateCode_T&, const CountryCode_T&, const AltCountryCode_T&,
const StateCode_T&,
const CountryCode_T&, const AltCountryCode_T&,
const CountryName_T&, const WAC_T&, const WACName_T&,
const CurrencyCode_T&,
const ContinentName_T&,
Expand All @@ -1016,7 +1046,9 @@ namespace OPENTREP {
const TimeZone_T&,
const GMTOffset_T&, const DSTOffset_T&, const RawOffset_T&,
const Date_T& iModDate, const TvlPORListString_T&,
const WikiLink_T&, const PageRank_T&,
const WikiLink_T&,
const Latitude_T&, const Longitude_T&,
const PageRank_T&,
const std::string& iOriginalKeywords,
const std::string& iCorrectedKeywords,
const MatchingPercentage_T& iPercentage,
Expand Down Expand Up @@ -1308,6 +1340,16 @@ namespace OPENTREP {
*/
WikiLink_T _wikiLink;

/**
* Geonames latitude (e.g., 41.978603).
*/
Latitude_T _geonameLatitude;

/**
* Geonames longitude (e.g., -87.904842).
*/
Longitude_T _geonameLongitude;

/**
* PageRank/importance (e.g., ATL is 94.66% and BSL is 8.14%).
*
Expand Down
15 changes: 12 additions & 3 deletions opentrep/basic/Location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace OPENTREP {
_currencyCode ("ZZZ"),
_continentCode (ContinentCode_T ("NA")),
_continentName (ContinentName_T ("NotAvailable")),
_latitude (0), _longitude (0),
_latitude (0.0), _longitude (0.0),
_featClass (FeatureClass_T ("Z")), _featCode (FeatureCode_T ("ZZZZ")),
_admin1Code (Admin1Code_T ("")),
_admin1UtfName (Admin1UTFName_T ("")),
Expand All @@ -44,6 +44,7 @@ namespace OPENTREP {
_gmtOffset (0), _dstOffset (0), _rawOffset (0),
_modificationDate (2000, 01, 01),
_wikiLink (WikiLink_T ("http://en.wikipedia.org")),
_geonameLatitude (0.0), _geonameLongitude (0.0),
_pageRank (K_DEFAULT_PAGE_RANK),
_originalKeywords ("NA"), _correctedKeywords ("NA"),
_percentage (0), _editDistance (0), _allowableEditDistance (0),
Expand Down Expand Up @@ -86,7 +87,10 @@ namespace OPENTREP {
_timeZone (iLocation._timeZone), _gmtOffset (iLocation._gmtOffset),
_dstOffset (iLocation._dstOffset), _rawOffset (iLocation._rawOffset),
_modificationDate (iLocation._modificationDate),
_wikiLink (iLocation._wikiLink), _pageRank (iLocation._pageRank),
_wikiLink (iLocation._wikiLink),
_geonameLatitude (iLocation._geonameLatitude),
_geonameLongitude (iLocation._geonameLongitude),
_pageRank (iLocation._pageRank),
_nameMatrix (iLocation._nameMatrix),
_originalKeywords (iLocation._originalKeywords),
_correctedKeywords (iLocation._correctedKeywords),
Expand Down Expand Up @@ -137,6 +141,8 @@ namespace OPENTREP {
const Date_T& iModDate,
const TvlPORListString_T& iTvlPORListString,
const WikiLink_T& iWikiLink, const PageRank_T& iPageRank,
const Latitude_T& iGeonameLatitude,
const Longitude_T& iGeonameLongitude,
const std::string& iOriginalKeywords,
const std::string& iCorrectedKeywords,
const MatchingPercentage_T& iPercentage,
Expand Down Expand Up @@ -171,7 +177,9 @@ namespace OPENTREP {
_timeZone (iTimeZone),
_gmtOffset (iGMTOffset), _dstOffset (iDSTOffset), _rawOffset (iRawOffset),
_modificationDate (iModDate),
_wikiLink (iWikiLink), _pageRank (iPageRank),
_wikiLink (iWikiLink),
_geonameLatitude (iGeonameLatitude), _geonameLongitude (iGeonameLongitude),
_pageRank (iPageRank),
_originalKeywords (iOriginalKeywords),
_correctedKeywords (iCorrectedKeywords),
_percentage (iPercentage), _editDistance (iEditDistance),
Expand Down Expand Up @@ -238,6 +246,7 @@ namespace OPENTREP {
<< ", " << _modificationDate
<< ", " << _tvlPORListString
<< ", " << _wikiLink
<< ", " << _geonameLatitude << ", " << _geonameLongitude
<< ", " << _originalKeywords << ", " << _correctedKeywords
<< ", " << _percentage << "%"
<< ", " << _editDistance << ", " << _allowableEditDistance;
Expand Down
44 changes: 42 additions & 2 deletions opentrep/bom/PORParserHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,35 @@ namespace OPENTREP {
// OPENTREP_LOG_DEBUG ("Wiki link: " << _location.getWikiLink());
}

// //////////////////////////////////////////////////////////////////
storeGeonameLatitude::storeGeonameLatitude (Location& ioLocation)
: ParserSemanticAction (ioLocation) {
}

// //////////////////////////////////////////////////////////////////
void storeGeonameLatitude::operator() (double iLatitude,
bsq::unused_type,
bsq::unused_type) const {
_location.setGeonameLatitude (iLatitude);
// DEBUG
//OPENTREP_LOG_DEBUG ("Geoname latitude: " << _location.getGeonameLatitude());
}

// //////////////////////////////////////////////////////////////////
storeGeonameLongitude::storeGeonameLongitude (Location& ioLocation)
: ParserSemanticAction (ioLocation) {
}

// //////////////////////////////////////////////////////////////////
void storeGeonameLongitude::operator() (double iLongitude,
bsq::unused_type,
bsq::unused_type) const {
_location.setGeonameLongitude (iLongitude);

// DEBUG
//OPENTREP_LOG_DEBUG ("Geoname longitude: " << _location.getGeonameLongitude());
}

// //////////////////////////////////////////////////////////////////
storeAltLangCodeFull::storeAltLangCodeFull (Location& ioLocation)
: ParserSemanticAction (ioLocation) {
Expand Down Expand Up @@ -1141,6 +1170,8 @@ namespace OPENTREP {
ccy_code varchar(3)
unlc_list varchar(100)
uic_list varchar(100)
geoname_lat decimal(10,7)
geoname_lon decimal(10,7)
iata_code^icao_code^faa_code^is_geonames^geoname_id^envelope_id^
name^asciiname^
Expand All @@ -1156,7 +1187,8 @@ namespace OPENTREP {
state_code^location_type^wiki_link^
alt_name_section^
wac^wac_name^ccy_code^
unlc_list^uic_list
unlc_list^uic_list^
geoname_lat^geoname_lon
*/

/**
Expand Down Expand Up @@ -1233,6 +1265,7 @@ namespace OPENTREP {
por_details_additional =
wac >> '^' >> wac_name >> '^' >> -ccy_code
>> '^' >> -unlc_section >> '^' >> -uic_section
>> '^' >> -geoname_lat >> '^' >> -geoname_lon
;

iata_code =
Expand Down Expand Up @@ -1453,6 +1486,10 @@ namespace OPENTREP {
bsq::repeat(1,2)[bsu::char_("hp")]
;

geoname_lat = bsq::double_[storeGeonameLatitude(_location)];

geoname_lon = bsq::double_[storeGeonameLongitude(_location)];

por_type =
bsq::repeat(1,3)[bsu::char_("ABCGHOPRZ")][storePORType(_location)]
;
Expand Down Expand Up @@ -1581,6 +1618,8 @@ namespace OPENTREP {
BOOST_SPIRIT_DEBUG_NODE (uic_details);
BOOST_SPIRIT_DEBUG_NODE (uic_code);
BOOST_SPIRIT_DEBUG_NODE (uic_qualifiers);
BOOST_SPIRIT_DEBUG_NODE (geoname_lat);
BOOST_SPIRIT_DEBUG_NODE (geoname_lon);
}

// Instantiation of rules
Expand Down Expand Up @@ -1608,7 +1647,8 @@ namespace OPENTREP {
lang_code_opt, lang_code_2char, lang_code_ext, lang_code_hist,
por_details_additional, wac, wac_name, ccy_code,
unlc_section, unlc_details, unlocode_code, unlc_qualifiers,
uic_section, uic_details, uic_code, uic_qualifiers;
uic_section, uic_details, uic_code, uic_qualifiers,
geoname_lat, geoname_lon;

// Parser Context
Location& _location;
Expand Down
28 changes: 26 additions & 2 deletions opentrep/bom/PORParserHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,26 @@ namespace OPENTREP {
boost::spirit::qi::unused_type) const;
};

/** Store the parsed Geonames latitude value. */
struct storeGeonameLatitude : public ParserSemanticAction {
/** Actor Constructor. */
storeGeonameLatitude (Location&);
/** Actor Function (functor). */
void operator() (double,
boost::spirit::qi::unused_type,
boost::spirit::qi::unused_type) const;
};

/** Store the parsed Geonames longitude value. */
struct storeGeonameLongitude : public ParserSemanticAction {
/** Actor Constructor. */
storeGeonameLongitude (Location&);
/** Actor Function (functor). */
void operator() (double,
boost::spirit::qi::unused_type,
boost::spirit::qi::unused_type) const;
};

/** Store the full language code of an alternate name. */
struct storeAltLangCodeFull : public ParserSemanticAction {
/** Actor Constructor. */
Expand All @@ -565,7 +585,9 @@ namespace OPENTREP {
boost::spirit::qi::unused_type) const;
};

/** Store the first 2 characters of the language code of an alternate name. */
/**
* Store the first 2 characters of the language code of an alternate name
*/
struct storeAltLangCode2Char : public ParserSemanticAction {
/** Actor Constructor. */
storeAltLangCode2Char (Location&);
Expand All @@ -575,7 +597,9 @@ namespace OPENTREP {
boost::spirit::qi::unused_type) const;
};

/** Store the country-specific part of the language code of an alternate name. */
/**
* Store the country-specific part of the language code of an alternate name
*/
struct storeAltLangCodeExt : public ParserSemanticAction {
/** Actor Constructor. */
storeAltLangCodeExt (Location&);
Expand Down
4 changes: 2 additions & 2 deletions opentrep/bom/Place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace OPENTREP {
Admin3Code_T (""), Admin4Code_T (""),
0, 0, 0, TimeZone_T (""), 0, 0, 0,
Date_T (2000, 01, 01), TvlPORListString_T (""),
WikiLink_T (""), K_DEFAULT_PAGE_RANK, "", "", 0, 0, 0,
WikiLink_T (""), 0.0, 0.0, K_DEFAULT_PAGE_RANK, "", "", 0, 0, 0,
RawDataString_T ("")),
_docID (0) {
}
Expand All @@ -56,7 +56,7 @@ namespace OPENTREP {
Admin3Code_T (""), Admin4Code_T (""),
0, 0, 0, TimeZone_T (""), 0, 0, 0,
Date_T (2000, 01, 01), TvlPORListString_T (""),
WikiLink_T (""), K_DEFAULT_PAGE_RANK, "", "", 0, 0, 0,
WikiLink_T (""), 0.0, 0.0, K_DEFAULT_PAGE_RANK, "", "", 0, 0, 0,
RawDataString_T ("")),
_docID (0) {
}
Expand Down
Loading

0 comments on commit 9ee4e2b

Please sign in to comment.