LibPostalNet icon indicating copy to clipboard operation
LibPostalNet copied to clipboard

Unhandled exception

Open gdonaire opened this issue 8 years ago • 1 comments

Hi Mapo,

I think there is an error beetween manage and unmanage code, convertion from string to char* and reverse do not work in some strings. This code hangs the dll.

Sub Main()
	Dim dades As String() = {"JUELICHER STRASSE 10/12, Aachen, Germany",
	"Juelicher Strasse 10-12, 52070, AACHEN, DE",
	"Jülicherstraße 10 - 12, 52070 Aachen",
	"Juelicher Strasse 10-12 - 52070",
	"Jülicher Str. 10-12, 52070, Aachen, Germany",
	"Juelicherstrasse, 10 - 12 Aachen 52070",
	"Jülicher Str. 10-12, Aachen, Germany",
	"Juelicher Strasse 10-12, 52070, AACHEN, GERMANY",
	"Juelicher Strasse 10-12",
	"Juelicher Strasse 10-12 Aachen 52070, Aachen, Germany",
	"Juelicher Str. 10-12",
	"Juelicher Str. 10-12, 52070, Germany, DE",
	"Juelicher Strasse 10-12    Aachen",
	"JUELICHER STRASSE 10/12, 52070 AACHEN, GERMANY",
	"JUELICHER STRASSE 10/12, 52070 AACHEN, GERMANY",
	"Juelicher Strasse 10/12",
	"Juelicher Strasse 10-12,  , 52070, AACHEN",
	"Juelicher Strasse 10-12,  , 52070 "}

	Dim Res = libpostal.LibpostalSetup
	Dim Res2 = libpostal.LibpostalSetupParser

	For Each address As String In dades

		Console.WriteLine(address)
		Dim response = libpostal.LibpostalParseAddress(address, New LibpostalAddressParserOptions)
		Dim x = response.Results
		libpostal.LibpostalAddressParserResponseDestroy(response)
		For Each p As KeyValuePair(Of String, String) In x
			Console.WriteLine("{0}: {1}", p.Key, p.Value)
		Next
		Console.WriteLine()
	Next

	' Teardown (only called once at the end of your program)
	libpostal.LibpostalTeardown()
	libpostal.LibpostalTeardownParser()
End Sub

gdonaire avatar Nov 14 '17 18:11 gdonaire

Hi, i saw you have ran the C# solution successfully and it gives the correct result, but my result is null, could you share your solution with me? Thanks!

marco110 avatar Jan 22 '18 07:01 marco110