Commit 1e63a0678d7ab7c8b13585d0570df568978067c1
1 parent
7f37383f
preparation for adjectival frames
Showing
1 changed file
with
27 additions
and
0 deletions
semantics/management/commands/connect_adjective_lexical_units.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 | + connect_nouns() | |
18 | + | |
19 | +def connect_nouns(): | |
20 | + adj = POS.objects.get(tag='adj') | |
21 | + entries = Entry.objects.filter(pos=adj) | |
22 | + for entry in entries: | |
23 | + lus = LexicalUnit.objects.filter(base=entry.name, pos=u'przymiotnik') | |
24 | + for lu in lus: | |
25 | + lu.entry = entry | |
26 | + lu.save() | |
27 | + | |
... | ... |