Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Attribute error in similarity method

Open
#172 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Reproduce the expression using wordnet.synsets(...)[0].similarity(...) and inspect the ancestor and similarity methods that produce the AttributeError. Determine the expected behavior when two synsets have no common ancestor, then add regression coverage for that case and verify the existing similarity behavior remains unchanged.

Written by the indexing model from the issue text.

Description

review

The following code give me a {AttributeError}'NoneType' object has no attribute 'ic':

wordnet.synsets("next", "JJ")[0].similarity(wordnet.synsets("following", "JJ")[0])

This is because the ancestor method can return a None value.
What's the fix? Should the similarity between 2 synsets without common ancestor be 0.0?

Dominant language
Python
Stars
8.9k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from clips/pattern

All issues in clips/pattern

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.