Open main menu

Gramps β

Changes

Addon:Place completion tool

1,871 bytes added, 11:43, 2 February 2009
Parse title details
The parsing fields have entry fields allowing you to give your own parsing. Parsing uses regular expressions. You can use this to parse your title, and to parse a lat/lon file in your own way. For reference, here an overview of the parsing codes used for the predefined parses:
=== Parse title details ===
In 'Parsing and Conversion of existing title or position', 'Parse title' and 'Change title into' provide some pre-defined options for extracting location values from a Place Title. Otherwise regex parsing is needed. Write your regex in 'Parse title:'.Click on 'Find', which shows the proposed changes. Then click 'Apply'. In many 16th and 17th century English IGI records the Place Title takes the form of 3 strings (Town, County, Country) or 4 strings (Parish, District, County, Country) for example: (a) Chester le Street, Durham, England - 3-string (b) Of Middleton-in-Teesdale, Durham, England - 3-string (c) Bishoply,Stanhope, Durham, England - 4-string (d) Of St. Margaret's, Stanhope, Durham, England - 4-string  For the 3-string record the following regex, treating the comma character as an end-of-string delimiter, will distribute the 3 strings correctly to City, County, Country locations, leaving 4-string records untouched. Regex A: \s*(Of[,]*\s*)*(?P<city>[^,]+?)[,]\s*(?P<county>[^,]+?)[,]\s*((?P<country>[^,]+?)){1,1}$  For 4-string records the following regex will distribute the 4 strings correctly to Parish, City, County, Country locations, leaving 3-string records untouched. Regex B: \s*(Of[,]*\s*)*(?P<parish>[^,]+?)[,]\s*(?P<city>[^,]+?)[,]\s*(?P<county>[^,]+?)[,]\s*((?P<country>[^,]+?)){1,1}$  "Bogus" 4-string records: a not uncommon error in these old records is for 'Of' to be followed by a comma, e.g. (e) Of, Houghton-le-Spring, Durham, England Regex A will parse 3-string records correctly and Regex B 4-string records. However Regex B will attempt to treat a 3-string record with 'Of,' as if it were a 4-string record. This would give it a Parish and set the name to "Of" ! To avoid this,click on 'Find' to display the records proposed for change and delete all the 3-string 'Of,' records before clicking 'Apply'   The following predefined regex expressions are usedas follows, where for brevity we use some variables defined lower.
Note: For those new to Python and Regex please review the HOWTO here:
67
edits