question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

places().length for two cities name with spaces equal to 1

See original GitHub issue

Hi,

I think i found a new issues.

So two cities name like “stockholm warsaw” equal to 1. if it’s two cities name like “stockholm to warsaw” it will be equal to 2. Why the “to” needed, nlp was not human, the result should be the same like the second example.

thanks

my current fix for now,

var foundTo = text.search("to");
console.log("FOUND TO"+foundTo);
     if(foundTo == -1){
          text = text.replace(/ /," to ");
       }

it will replace the first space with “to”.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rhezacommented, Jun 22, 2016

Just to make sure you understand. The “CityA CityB” should equal to 2 like on “CityA to CityB”.

So, “CityA CityB” length = 2 “CityA to CityB” length = 2

Thanks

1reaction
rhezacommented, Jul 4, 2016

Yeah, Looks like it still failing on certain circumstances, especially places added with lexicon. Will post the full log if i have time. Thank you so much for your effort.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query the two cities in STATION with the shortest and longest ...
Query: Query the 2 cities contained in STATION table with the shortest and longest CITY names, as well as their respective lengths (i.e.:...
Read more >
How do we define cities, towns, and rural areas?
Driven by population size and density. Population size is used by more than half of the national definitions of urban and rural areas....
Read more >
Single source shortest path between two cities - GeeksforGeeks
The task is to find the cheapest cost path from given source to destination from K stops. Examples: Input: N = 3, edges...
Read more >
Models of Urban Structure
When a country has two large cities of similar size in separate regional areas; the rank-size rule may apply regionally –– as in...
Read more >
List of long place names - Wikipedia
This is a list of long place names. Contents. 1 Single-word names. 1.1 25 letters or more; 1.2 20-24 letters; 1.3 14–19 letters....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found