You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-14
Original file line number
Diff line number
Diff line change
@@ -88,33 +88,33 @@ Retrieves a list of the currently loaded and available 3 word address languages.
88
88
The returned payload from the `available-languages` method is described in the [what3words REST API documentation](https://docs.what3words.com/api/v3/#available-languages).
89
89
90
90
91
-
## isPossible3wa
91
+
## is_possible_3wa
92
92
This method takes a string as a parameter and returns whether the string is in the format of a 3WA (eg “filled.count.soap”). Return type is boolean. NOTE: Does not check if it is an actual existing 3WA.
93
93
94
94
```
95
-
isPossible3wa(“filled.count.soap”) returns True
96
-
isPossible3wa(“not a 3wa”) returns False
97
-
isPossible3wa(“not.3wa address”) returns False
95
+
is_possible_3wa(“filled.count.soap”) returns True
96
+
is_possible_3wa(“not a 3wa”) returns False
97
+
is_possible_3wa(“not.3wa address”) returns False
98
98
```
99
99
100
-
## findPossible3wa
100
+
## find_possible_3wa
101
101
102
102
This method takes a string as a parameter and searches the string for any possible instances of a 3WA - e.g. "leave in my porch at word.word.word." Likely to be the main method that is called on the delivery notes. Returns an array of matched items. Returns an empty array if no matches are found. NOTE: Does not check if it is an actual existing 3WA.
103
103
104
104
```
105
-
findPossible3wa(“Please leave by my porch at filled.count.soap”) will return [‘filled.count.soap’]
106
-
findPossible3wa(“Please leave by my porch at filled.count.soap or deed.tulip.judge”) will return [‘filled.count.soap’, ‘deed.tulip.judge’]
107
-
findPossible3wa(“Please leave by my porch at”) will return []
105
+
find_possible_3wa(“Please leave by my porch at filled.count.soap”) will return [‘filled.count.soap’]
106
+
find_possible_3wa(“Please leave by my porch at filled.count.soap or deed.tulip.judge”) will return [‘filled.count.soap’, ‘deed.tulip.judge’]
107
+
find_possible_3wa(“Please leave by my porch at”) will return []
108
108
```
109
109
110
-
## isValid3wa
110
+
## is_valid_3wa
111
111
112
-
This method takes a string as a parameter and first passes it through the W3W regex filter (akin to calling isPossible3wa() on the string) and then calls the W3W api to verify it is a real 3WA.
112
+
This method takes a string as a parameter and first passes it through the W3W regex filter (akin to calling is_possible_3wa() on the string) and then calls the W3W api to verify it is a real 3WA.
113
113
114
114
```
115
-
isValid3wa(“filled.count.soap”) returns True
116
-
isValid3wa(“filled.count.”) returns False
117
-
isValid3wa(“python.is.cool”) returns False
115
+
is_valid_3wa(“filled.count.soap”) returns True
116
+
is_valid_3wa(“filled.count.”) returns False
117
+
is_valid_3wa(“python.is.cool”) returns False
118
118
```
119
119
120
120
## Code examples
@@ -160,7 +160,7 @@ Anyone and everyone is welcome to contribute.
160
160
161
161
162
162
# Revision History
163
-
163
+
*`v3.4.0` 28/11/24 - Support locale for the autosuggest and update the readme file
164
164
*`v3.3.0` 30/09/24 - Support locale, update regex, format and tests
165
165
*`v3.2.0` 08/03/22 - Added regex functions
166
166
*`v3.1.1` 04/10/19 - Fix bugs related to setting default language value, and autosuggest input-type
0 commit comments