Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added docs for prefix_number and prefix_street #2172

Merged
merged 2 commits into from Dec 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 35 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -147,7 +147,9 @@ This list gives a brief summary of what each function does. Examples can be foun

Function | Note
-------- | -----
`regexp` | Allow regex find and/or replace on a given field. Useful to extract house number/street/city/region etc when the source has them in a single field
`prefixed_number` | Allow number to be extracted from the beginning of a single field (extracts `102` from `102 East Maple Street`).
`postfixed_street` | Allow street to be extracted from the end of a single field (extracts `East Maple Street` from `102 East Maple Street`).
`regexp` | Allow regex find and/or replace on a given field. Useful to extract house number/street/city/region etc when the source has them in a single field.
`join` | Allow multiple fields to be joined with a given delimiter.
`format` | Allow multiple fields to be formatted into a single string.

Expand Down Expand Up @@ -184,6 +186,36 @@ _Example_
"street": ["SITUS_STREET_PRE", "SITUS_STREET_NME", "SITUS_STREET_TYP", "SITUS_STREET_POST"]
```

###### prefixed_number and postfixed_street functions

The `prefixed_number` and `postfixed_street` functions are used to extract an address number and street from a field. While the same functionality can be accomplished using the `regexp` function, these convenience functions are meant to reduce copy/pasting of common regexes among various sources. The standard case for using these two functions is for a source in a country that has number-prefixed address formats, such as Australia, New Zealand, and the United States.

_Format_
```JSON
"{Attribute Tag}": {
"function": "prefixed_number",
"field": "{Field Name}"
}
"{Attribute Tag}": {
"function": "postfixed_street",
"field": "{Field Name}"
}
```

_Example_
```JSON
"number": {
"function": "prefixed_number",
"field": "SITUS_ADDRESS"
},
"street": {
"function": "postfixed_street",
"field": "SITUS_ADDRESS"
}
```

Using the above example, if the `SITUS_ADDRESS` field value is `102 East Maple Street`, `prefixed_number` and `postfixed_street` would extract the value `102` and `East Maple Street` for number and street, respectively.

###### regexp function

_Format_
Expand Down Expand Up @@ -221,6 +253,8 @@ _Example_
}
```

The source data should be examined to determine if the shorthand methods `prefixed_number` and `postfixed_street` could be used instead of `regexp`.

###### join function

The join function allows fields to be merged given an arbitrary delimiter. For delimiting
Expand Down Expand Up @@ -351,4 +385,3 @@ A few notes on formatting:

Although these are read by a machine, they are maintained by us mortals.
Following the formatting guidelines keeps the rest of us sane!