Commit 43da6c973129d0bd522554b3ff4a03ebb656e150
1 parent
c832e219
Skrypt dla Eli
Showing
1 changed file
with
27 additions
and
0 deletions
semantics/management/commands/nouns_todo.py
0 → 100644
1 | +#! /usr/bin/python | ||
2 | +# -*- coding: utf-8 -*- | ||
3 | + | ||
4 | +import sys, os, codecs | ||
5 | + | ||
6 | +from django.core.management.base import BaseCommand | ||
7 | + | ||
8 | +from dictionary.models import Entry, POS | ||
9 | +from wordnet.models import LexicalUnit | ||
10 | +from settings import PROJECT_PATH | ||
11 | + | ||
12 | +class Command(BaseCommand): | ||
13 | + args = 'none' | ||
14 | + help = '' | ||
15 | + | ||
16 | + def handle(self, **options): | ||
17 | + nouns_todo() | ||
18 | + | ||
19 | +def nouns_todo(): | ||
20 | + noun = POS.objects.get(tag='noun') | ||
21 | + entries = Entry.objects.filter(pos=noun) | ||
22 | + for entry in entries: | ||
23 | + rel_entries = entry.rel_entries.all() | ||
24 | + for rel_entry in rel_entries: | ||
25 | + if rel_entry.actual_lemma().status.priority >= 90: | ||
26 | + print entry.name | ||
27 | + |