Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception #3

Open
gdonaire opened this issue Nov 14, 2017 · 1 comment
Open

Unhandled exception #3

gdonaire opened this issue Nov 14, 2017 · 1 comment

Comments

@gdonaire
Copy link

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
@marco110
Copy link

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!

mapo80 pushed a commit that referenced this issue May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants