Skip to content

Commit

Permalink
Merge pull request #84 from LuisMayo/python-310
Browse files Browse the repository at this point in the history
Compatibility with python 3.10
  • Loading branch information
LuisMayo authored Oct 17, 2022
2 parents 0379695 + c3e22ed commit 41765b0
Show file tree
Hide file tree
Showing 4 changed files with 1,142 additions and 628 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is a fork of a wonderful [Reddit bot](https://github.com/micah5/ace-attorne
## Getting Started

### Prerequisites
- Python 3 with poetry. Python 3.8 and 3.9 have been proven to work. 3.10 has been proven to not work
- Python 3. Python 3.8 and 3.9 and 3.10 have been proven to work.
- FFMPEG instalation. In most Linux distros it should be available in the default package manager. In Windows systems it'd include downloading a [pre-compiled zip folder](https://ffmpeg.org/download.html#build-windows), extracting it and adding the /bin folder into the [system path](https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/)

#### Optional
Expand Down
6 changes: 3 additions & 3 deletions objection_engine/anim.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
from . import constants
import re

nlp = spacy.load("xx_ent_wiki_sm")
nlp.add_pipe(nlp.create_pipe('sentencizer'))
nlp = spacy.blank("xx")
nlp.add_pipe('sentencizer')

def fit_words_within_width(words: Union[List[str], str], font: ImageFont.FreeTypeFont, insert_space: bool):
new_text = ""
Expand Down Expand Up @@ -436,7 +436,7 @@ def comments_to_scene(comments: List[CommentBridge], name_music = "PWR", **kwarg
for comment in comments:
polarity = analizer.get_sentiment(comment.body)
tokens = nlp(comment.body)
sentences = [sent.string.strip() for sent in tokens.sents]
sentences = [sent.text.strip() for sent in tokens.sents]
joined_sentences = []
i = 0
while i < len(sentences):
Expand Down
Loading

0 comments on commit 41765b0

Please sign in to comment.