gesistsa / adaR

:computer: wrapper for ada-url a WHATWG-compliant and fast URL parser written in modern C++
https://gesistsa.github.io/adaR/
Other
26 stars 2 forks source link

public_suffix() doesnt work with paths #54

Open schochastics opened 1 year ago

schochastics commented 1 year ago
adaR::public_suffix("http://google.de/test")
#> [1] NA

related to #51

Note that psl also fails.

psl::public_suffix("http://google.de/test")
#> [1] "de/test"

need to reconsider if this is a bug or a feature

chainsawriot commented 1 year ago

It depends on what's the expected input. The documentation says "domains", although the argument is called url.

https://github.com/schochastics/adaR/blob/8a8ec9f429d106a74243050d79c4801f2403f8ef/R/psl.R#L1

adaR::public_suffix(adaR::ada_get_hostname("http://google.de/test"))
chainsawriot commented 1 year ago

Actually, psl also expects "domains".

schochastics commented 1 year ago

ok, for now I will adjust that in the docs so users are aware of that. good catch!