loop/error on sutup

41 views
Skip to first unread message

Victor DD

unread,
Aug 16, 2015, 2:22:30 PM8/16/15
to openmundi
Hi, 
I have problem with try setutp all. In mod debug, with verbose, the shel show me ever "NameTokenizer". Do you have Idea? I can't create the database like this. How to create the databasea also another wy?

Thank you.

Gerald Bauer

unread,
Aug 16, 2015, 4:37:43 PM8/16/15
to Victor DD, openmundi
Hello,
Can you post the stack trace (error messages)? Hard to tell from
your description.

The "easiest" and recommend way to build the world.db is using
datafiles [1] e.g.

$ worlddb new world

Cheers.

[1] github.com/openmundi/datafile

Victor DD

unread,
Aug 17, 2015, 4:08:12 AM8/17/15
to openmundi, victord...@gmail.com
I need export all in sql, because i work with php e mysql. I must create a services API with countries, states and cities of the world. 
Can I export in sql all data? with the tools and fixtures?

Victor DD

unread,
Aug 17, 2015, 5:14:09 AM8/17/15
to openmundi, victord...@gmail.com
I understand the error finally.
The problem is in line 13 of file world.db/asia/pk-pakistan/cities.txt, when parse this line:

Pex̌awar|Pishōr|Pishāwar [Peshawar|Pekhawar], 1_218_773, m:1.8m  ## Khyber Pakhtunkhwa

found the pipe "|" and go to on error :

[debug] [NameTokenizer] eos?: false, rest: >[Peshawar<

I change the line into:

Peshawar [Peshawar], 1_218_773, m:1.8m  ## Khyber Pakhtunkhwa

Il giorno domenica 16 agosto 2015 22:37:43 UTC+2, Gerald Bauer ha scritto:

Gerald Bauer

unread,
Aug 17, 2015, 8:02:21 AM8/17/15
to Victor DD, openmundi
Hello,

FYI: If you use the "old" build script using Rake e.g. Rakefile [1]
you can import the data into MySQL. Change the db settings e.g.:

DB_CONFIG = {
adapter: 'sqlite3',
database: WORLD_DB_PATH
}

to something like:

DB_CONFIG = {
adapter: 'mysql',
host: 'localhost',
database: 'world',
username: 'root',
password: 'secret'
}

Cheers.

[1] https://github.com/openmundi/build/blob/master/Rakefile

Victor DD

unread,
Aug 17, 2015, 8:15:06 AM8/17/15
to openmundi, victord...@gmail.com
Hi Gerald,
I understand but the problem is that go in error when parse the data in txt. In my opinion there's a logic error here: https://github.com/textkit/textutils/blob/master/lib/textutils/parser/name_tokenizer.rb#L25-L45

The data of txt in more point have a pipe "|" inside the curly brackets:

Hovedstaden [Greater Copenhagen|Capital Region],

So in this case the parts (in the source code) return 

array(
1=>Hovedstaden [Greater Copenhagen
2 =>Capital Region]
)

What do you about this? 

Thanks.

Gerald Bauer

unread,
Aug 17, 2015, 8:27:23 AM8/17/15
to Victor DD, openmundi
Hello,
Good point. The new name parser (mini-format) might break some old
entries (just tested for austria.db and deutschland.db). Will try to
get it tested / fixed in a week. Sorry.

If you just need the data in mysql quick, try the "old" open world
database [1]. It's ready-to-use for MySQL and gets "shipped" as SQL
scripts as far as I can remember. Cheers.

[1] https://code.google.com/p/worlddb

Victor DD

unread,
Aug 17, 2015, 8:35:40 AM8/17/15
to openmundi, victord...@gmail.com
Hi (i want tell  "square" brackets and not "curly", sorry),

I had try with old database but when I make the import, the time of import become 5 hours. I think this is not normal. :)

Now I do the list with problem with data and I fix manually, if you want, then ca I send email with this list.

Thanks

Gerald Bauer

unread,
Aug 17, 2015, 9:15:59 AM8/17/15
to Victor DD, openmundi
Hello,
Thanks for your efforts and keep trying. The list is welcome. Cheers.
Reply all
Reply to author
Forward
0 new messages