Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentiment Analysis Widget: Error loading custom dictionary #1097

Open
gmolledaj opened this issue Jan 15, 2025 · 1 comment
Open

Sentiment Analysis Widget: Error loading custom dictionary #1097

gmolledaj opened this issue Jan 15, 2025 · 1 comment

Comments

@gmolledaj
Copy link

gmolledaj commented Jan 15, 2025

Error after loading a custom dictionary in the Sentiment Analysis widget.
To Reproduce
Steps to reproduce the behavior:
1-Use widget Sentiment Analysis in the category Text Mining.
2-Choose a text file with words for the positive or negative dictionary.
Contents of an example dictionary:
Joyful
Brilliant
Kind
Hopeful
Successful
3-Press the Open button.
4-See error:
Traceback (most recent call last):
File "/home/user/miniconda3/envs/orange3/lib/python3.10/site-packages/orangecontrib/text/widgets/owsentimentanalysis.py", line 178, in __pos_loader_activated
self.self.commit.deferred()
AttributeError: 'OWSentimentAnalysis' object has no attribute 'self'
In the terminal of GNU/Linux:
AttributeError Exception
Traceback (most recent call last):
File "/home/aaa/miniconda3/envs/orange3/lib/python3.10/site-packages/orangecontrib/text/widgets/owsentimentanalysis.py", line 178, in __pos_loader_activated
self.self.commit.deferred()
AttributeError: 'OWSentimentAnalysis' object has no attribute 'self'

Expected behavior
That the file loads without giving an error.

Orange version:
Orange - About - version number.
3.38.1

Text add-on version:
Options - Add-ons - version number.
Text 1.16.1

Screenshots
If applicable, add screenshots to help explain your problem.

Operating system:
Windows 10 and GNU/Linux LinuxMint 22 Wilma (XFCE).
The error appears on both operating systems.

@gmolledaj
Copy link
Author

gmolledaj commented Jan 15, 2025

Solve: line 178 and line 183: remove one "self."

        self.pos_file = cf.abspath if cf else None
       -self.self.commit.deferred()
        +self.commit.deferred()

    def __neg_loader_activated(self):
        cf = self.__negfile_loader.get_current_file()
        self.neg_file = cf.abspath if cf else None
        -self.self.commit.deferred()
        +self.commit.deferred()

    def __set_pos_path(self, path: RecentPath, paths: List[RecentPath] = []):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant