def address_complete_ajax(): """return the full address of the client's request in ajax""" value = request.form.get('data') address_converted = WorkString(value) address_converted = address_converted.get_address_without_punctuation() api_geocode = DataApi(address_converted) address_complete = api_geocode.get_address_complete() return address_complete
def longitude_ajax(): """return the longitude of the client's request in ajax""" value = request.form.get('data') address_converted = WorkString(value) address_converted = address_converted.get_address_without_punctuation() api_geocode = DataApi(address_converted) longitude = api_geocode.get_longitude() print(longitude) return longitude
def wikipedia_url(): """return the url's article of the client's request in ajax""" value = request.form.get('data') address_converted = WorkString(value) address_converted = address_converted.get_address_selected() item_wikipedia = DataApiWikipedia() title_wikipedia = item_wikipedia.get_title_page_wikipedia\ (address_converted) url_wikipedia = item_wikipedia.get_url_page_wikipedia(title_wikipedia) return url_wikipedia
def wikipedia_article(): """return the wikipedia's article of the client's request in ajax""" value = request.form.get('data') address_converted = WorkString(value) address_converted = address_converted.get_address_selected() item_wikipedia = DataApiWikipedia() title_wikipedia = item_wikipedia.get_title_page_wikipedia\ (address_converted) extract_wikipedia = item_wikipedia.get_page_extract(title_wikipedia) print(address_converted) print(title_wikipedia) return extract_wikipedia
def test_get_address_selected(): """test if we retrieve user data without stop words""" address = WorkString(SENTENCE) assert address.get_address_selected() == SENTENCE_ADDRESS_SELECTED
def test_get_address_without_punctuation(): """test if we retrieve user data without punctuation""" address = WorkString(SENTENCE) assert address.get_address_without_punctuation() == \ SENTENCE_WITHOUT_PUNCTUATION
def test_get_sentence(): """test if we retrieve user data""" address = WorkString(SENTENCE) assert address.data == SENTENCE