spacyr icon indicating copy to clipboard operation
spacyr copied to clipboard

`spacy_install()` fails with multiple lang_models

Open capnrefsmmat opened this issue 9 months ago • 0 comments

According to the spacy_install() documentation, one can provide a vector of multiple lang_models if you'd like multiple installed at once. But the code in spacy_download_langmodel() can't handle this case. This check fails when length(lang_models) > 1:

https://github.com/quanteda/spacyr/blob/1ce545812b7307ecbcc5d19c8695d54dd541c429/R/spacy_langmodel_functions.R#L23-L26

Specifically, installation ends with:

Error in if (!force & py_check_installed(lang_models)) { :                                                   
  the condition has length > 1    

presumably because it should be all(py_check_installed(lang_models)) to account for the case with multiple lang_models.

capnrefsmmat avatar Apr 30 '24 17:04 capnrefsmmat