averbis / averbis-python-api

Conveniently access the REST API of Averbis products using Python
Apache License 2.0
12 stars 4 forks source link

analyse_texts_to_cas returns results only after all data has been processed #115

Closed DavidHuebner closed 2 years ago

DavidHuebner commented 2 years ago

Describe the bug Essentially a duplicate of https://github.com/averbis/averbis-python-api/issues/101, just for the endpoint analyze_texts_to_cas. The endpoint returns results only after all data has been processed - but it should already start returning results as the data is being processed.

DavidHuebner commented 2 years ago

Stumbled across another bug.

analyse_text_to_cas should accept a Path as input according to its signature.

    def analyse_text_to_cas(
        self,
        source: Union[Path, IO, str],
        language: str = None,
        timeout: float = None,
    ) -> Cas:

But it does not work as the underlying client._analyse_text_xmi does not accept a Path object.

    def _analyse_text_xmi(
        self,
        project: str,
        pipeline: str,
        source: Union[IO, str],
        language: str = None,
        timeout: float = None,
    ) -> str:

I will add support for Path source in client._analyse_text_xmi on the same MR.