From 43da6c973129d0bd522554b3ff4a03ebb656e150 Mon Sep 17 00:00:00 2001 From: Tomasz Bartosiak <tomasz.bartosiak@gmail.com> Date: Tue, 10 Oct 2017 14:20:06 +0200 Subject: [PATCH] Skrypt dla Eli --- semantics/management/commands/nouns_todo.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+), 0 deletions(-) create mode 100644 semantics/management/commands/nouns_todo.py diff --git a/semantics/management/commands/nouns_todo.py b/semantics/management/commands/nouns_todo.py new file mode 100644 index 0000000..a9b1ec7 --- /dev/null +++ b/semantics/management/commands/nouns_todo.py @@ -0,0 +1,27 @@ +#! /usr/bin/python +# -*- coding: utf-8 -*- + +import sys, os, codecs + +from django.core.management.base import BaseCommand + +from dictionary.models import Entry, POS +from wordnet.models import LexicalUnit +from settings import PROJECT_PATH + +class Command(BaseCommand): + args = 'none' + help = '' + + def handle(self, **options): + nouns_todo() + +def nouns_todo(): + noun = POS.objects.get(tag='noun') + entries = Entry.objects.filter(pos=noun) + for entry in entries: + rel_entries = entry.rel_entries.all() + for rel_entry in rel_entries: + if rel_entry.actual_lemma().status.priority >= 90: + print entry.name + -- libgit2 0.22.2