rationalmatter / Juno-Issue-Tracker

Defect Tracker for Juno
78 stars 1 forks source link

Add regex #178

Closed Sven-git closed 3 years ago

Sven-git commented 4 years ago

What is the name of the package? A name or link to the Python package you think should be pre-installed in Juno. Mind that you can install pure Python packages from PyPI in Juno — those that can be successfully installed won't be embedded in the app.

I would like to install nltk and all packages it depends on. Regex is one of those, but there might be others.

dimapaloskin commented 4 years ago

Seems it's possible to use a monkey patch to run nltk. Not sure if this works in all cases but looks like basic operations works fine.

import sys

# monkey patch
sys.modules["regex"] = __import__("re")
import nltk

nltk.data.path.append(".")
nltk.download("punkt", download_dir=".")
nltk.download("averaged_perceptron_tagger", download_dir=".")
sentence = "seems working"

tokens = nltk.word_tokenize(sentence)
tags = nltk.pos_tag(tokens)

tags

Of course it's not the solution for this particular issue

argenismartinez commented 4 years ago

Seems it's possible to use a monkey patch to run nltk.

Not sure if this works in all cases but looks like basic operations works fine.


import sys

# monkey patch

sys.modules["regex"] = __import__("re")

import nltk

nltk.data.path.append(".")

nltk.download("punkt", download_dir=".")

nltk.download("averaged_perceptron_tagger", download_dir=".")

sentence = "seems working"

tokens = nltk.word_tokenize(sentence)

tags = nltk.pos_tag(tokens)

tags

Of course it's not the solution for this particular issue

It's a workaround, but a pretty nice one. I will def try it out.

alexstaravoitau commented 3 years ago

Regex is now available in Juno 1.3.6 beta on TestFlight — if anyone would like to help test it, please reach out to beta@juno.sh, and I'll add you to our beta list. 😉

alexstaravoitau commented 3 years ago

Juno 1.3 with Regex is now live on App Store 🚀