Skip to content

Unhandled exception #3

@gdonaire

Description

@gdonaire

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions