Giter Site home page Giter Site logo

iemldev / ieml Goto Github PK

View Code? Open in Web Editor NEW
53.0 15.0 6.0 8.03 MB

IEML semantic language - a meaning-representation system based on semantic primitives and a regular grammar. Basic semantic relationships between concepts are automatically computed from syntactic similarities.

Home Page: https://dev.intlekt.io/

License: GNU General Public License v3.0

Python 71.60% Jupyter Notebook 27.87% Shell 0.10% TeX 0.43%
dictionary semantic usl topic ieml language meaning-representation semantic-relationships natural-language

ieml's Introduction

IEML

Build Status

IEML is a regular philological language (built as a natural language), where the syntax is parallel to semantics. This means in IEML, a small change in the structure of an expression results in a semantically close expression. For instance:

  • [! E:S:. ()(u.A:.-) > E:.l.- (E:.-U:.s.-l.-')] : to go up
  • [! E:S:. ()(u.A:.-) > E:.l.- (E:.-U:.d.-l.-')] : to go down

Only E:.-U:.s.-l.-' (up) has been changed to E:.-U:.d.-l.-' (down).

These properties make the semantic relationships between the different expressions of the language automatically computable by an edit distance calculation. Therefore, there are no synonyms in the language, because by construction, the synonyms would be written identically. On the other hand, words that are written differently in IEML have different meanings.

So IEML has the perfect capabilities to uniquely identify concepts in a database, an ontology, a taxonomy, a categorization or any other documents, without having to rely on an external referential other than IEML's grammar and its dictionary of semantic primitives.

In order to guarantee the consistency of interpretations of IEML expressions, a database of translations (en and fr), comments and tags per USL is available here. This database has a normative purpose concerning the interpretation of IEML expressions. It can be browsed with the intlekt editor. It can also be used as an educational resource for learning IEML, in addition to reading the grammar.

IEML is a regular language that is intended to serve as an easily interpretable coordinate system for the world of ideas on the internet, to improve communication and artificial intelligence.

Install

The library works with python 3.5+ From github:

git clone https://github.com/IEMLdev/ieml
python setup.py

Quick start

Dictionary

The IEML dictionary is a set of around ~3500 basic semantics units.

The dictionay has its own syntax and primitives. The dictionary is organised in layers, from 0 (the most abstract) to 7 (the most specific). The words excepts the primitives are built from words of lower layers.

The last version of the IEML dictionary is automatically downloaded and installed when instanced:

from ieml.dictionary import Dictionary

dic = Dictionary()
dic.index

This return a list of all words defined in the dictionary. There is an order defined on the terms of the dictionary, and d.index is the position of the words in this order.

You can access the translations of a word :

t = dic.index[100]
t.translations.en

There are for the moment two languages supported: french (fr) and english (en)

The dictionaryis a graph of semantic relationships (paradigmatic) between the words. All the relations are computed automatically from the terms definitions.

t.relations.neighbours

This return a list of all the neighboors of term t and the type of relation they share.

You can also access the graph of relation as a numpy array of transitions :

m = dic.relations_graph.connexity

Return a dense numpy array of boolean where m[i, j] is true if there is a relation between the term number i and the term number j.

from ieml.dictionary import term

t0 = term('wa.')
t1 = term('we.')
m[t0.index, t1.index]

The term function with a string argument call the dictionary parser and return a Term if the string is a valid IEML expression of a term (defined in the dictionary).

Syntax

A syntactic meaning unit is called an USL, for Uniform Semantic Locator. There is five differents types of USL :

  • Word : the basic meaning constituent, you can find all the defined words in the IEML dictionary.
  • Topic: a topic aggregate Words into a root and a flexing morphem, a topic represents a subject, a process.
  • Fact : a fact is a syntactic tree of topics, a fact symbolizes an event, a description.
  • Theory: a theory is a tree of facts, it represents a set of sentence linked together by causal, temporal, logic links etc.
  • Text: a text is a set of Topic, Fact and Theory.

To instantiate an usl, you can use the USL parser with the usl function with a string argument.

from ieml.grammar import usl

usl('[([wa.])]') # topic with a single word
usl("[([t.u.-s.u.-d.u.-']+[t.u.-b.u.-'])*([b.i.-])]") # topic with two words in his root morphem and one in flexing 

You can also create an usl with constructors :

from ieml.grammar import word, topic, fact, theory, text

w = word('wa.')
t0 = topic([w])
t1 = topic(['wa.', 'e.'])
t2 = topic(root=["t.u.-s.u.-d.u.-'", "t.u.-b.u.-'"], 
           flexing=["b.i.-"])
f = fact([(t2, t0, t1)])

t = text([t0, t1, t2, f])

For any usls, you can access the words, topics, facts, theories and texts defined in the usl by accessing the dedicated property:

t.words
t.topics
t.facts
t.theories
t.texts

Each of these properties returns a set of USLs of the specific type.

For any couple of usl, you can compute a semantic similarity measure based on the relation matrix of the dictionary :

from ieml.grammar.distance import dword
from ieml.grammar.tools import random_usl
u0 = random_usl(Topic)
u1 = random_usl(Text)

dword(u0, u1)

For the moments, only a similarity using the words of the USL is defined.

Collection of USLs

For a list of USLs, you can compute a square matrix of relative order from each USLs :

from ieml.distance.sort import square_order_matrix

usl_list = [random_usl() for _ in range(100)]

m = square_order_matrix(usl_list)

i = 20
ordered_usls = [usl_list[k] for k in m[i, :]]

ordered_usls is the list of usl ordered from USLs number i to the farrest USL from USL i in the collection. This method use the semantic distance between words of the dictionary.

Contributors

This language is being made by the French philosopher Pierre Levy. This library is being developped by Louis van Beurden.

ieml's People

Contributors

aribaucourt avatar ckemmler avatar eric-waldman avatar hadware avatar ogrergo avatar vayel avatar vletard avatar zaksoliman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ieml's Issues

Freeing Terms.__dict__ when their are used by usls when switching dictionary

Only one version of the dictionary can live in memory, when switching versions, the old terms are released to free memory. But they can be used by a Morphem in a usl and raise an exception.

Possible fix: make the terms "Global" objects with a mapping {dictionaryVersion -> {script, translation, relations, index, ...}. This allows multiples versions of the dictionary to live in memory and share the same pool of terms.
The translation of an usl between differents versions is then implicit.

Article publish date is often None

The newspaper module seems to be working well except for the publication date that is often null, we could add the scoop publication date when the module can't find the correct date to at least have an indication. To be decided.

Error on projection

Trying to project posts give the following error:

Internal Server Error: /dictionary/I:/tables/
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 33, in t_parse
    return self.parser.parse(s, lexer=self.lexer)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 1199, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 43, in p_error
    raise InvalidScript(msg)
ieml.exceptions.InvalidScript: Invalid arguments to create a script. Syntax error at ',' (1, 27)

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py", line 86, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 489, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 486, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py", line 267, in wrapper
    ieml.dictionary.term(pk)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/tools.py", line 15, in term
    dictionary = Dictionary()
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 47, in __call__
    cls._instance = load_dictionary_from_cache(version)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/version.py", line 290, in load_dictionary_from_cache
    return pickle.load(fp)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 182, in __setstate__
    self._populate(scripts=state['scripts'], relations=state['relations'])
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 146, in _populate
    root = script(root)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/operator.py", line 18, in script
    s = ScriptParser().parse(arg)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 35, in t_parse
    raise CannotParse(s, str(e))
ieml.exceptions.CannotParse: Unable to parse the following string 'n.-S:.U:.-'B:.-'S:.-',M:.-',M:.-',_'. Invalid arguments to create a script. Syntax error at ',' (1, 27)
Internal Server Error: /dictionary/I:/relations/
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 33, in t_parse
    return self.parser.parse(s, lexer=self.lexer)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 1199, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 43, in p_error
    raise InvalidScript(msg)
ieml.exceptions.InvalidScript: Invalid arguments to create a script. Syntax error at 'n' (1, 12)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py", line 86, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 489, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 486, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py", line 267, in wrapper
    ieml.dictionary.term(pk)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/tools.py", line 15, in term
    dictionary = Dictionary()
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 47, in __call__
    cls._instance = load_dictionary_from_cache(version)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/version.py", line 290, in load_dictionary_from_cache
    return pickle.load(fp)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 182, in __setstate__
    self._populate(scripts=state['scripts'], relations=state['relations'])
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 146, in _populate
    root = script(root)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/operator.py", line 18, in script
    s = ScriptParser().parse(arg)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 35, in t_parse
    raise CannotParse(s, str(e))
ieml.exceptions.CannotParse: Unable to parse the following string 'f.o.-f.o.-',n.i.-f.i.-',x.-O:.-',_M:.-',_;+f.o.-f.o.-',n.i.-f.i.-',x.-O:.-',_E:F:.-',_;'. Invalid arguments to create a script. Syntax error at 'n' (1, 12)
Internal Server Error: /dictionary/
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 33, in t_parse
    return self.parser.parse(s, lexer=self.lexer)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 1199, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 43, in p_error
    raise InvalidScript(msg)
ieml.exceptions.InvalidScript: Invalid arguments to create a script. Syntax error at '.' (1, 13)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py", line 86, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 489, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 486, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py", line 292, in list
    data = serializers.TermSerializer(Dictionary(), many=True).data
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 47, in __call__
    cls._instance = load_dictionary_from_cache(version)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/version.py", line 290, in load_dictionary_from_cache
    return pickle.load(fp)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 182, in __setstate__
    self._populate(scripts=state['scripts'], relations=state['relations'])
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 146, in _populate
    root = script(root)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/operator.py", line 18, in script
    s = ScriptParser().parse(arg)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/script/parser/parser.py", line 35, in t_parse
    raise CannotParse(s, str(e))
ieml.exceptions.CannotParse: Unable to parse the following string 'f.o.-f.o.-',n.i.-f.i.-',x.-O:.-',_M:.-',_;+f.o.-f.o.-',n.i.-f.i.-',x.-O:.-',_E:F:.-',_;'. Invalid arguments to create a script. Syntax error at '.' (1, 13)
[22/Aug/2017 14:38:31] "GET /dictionary/I%3A/tables/ HTTP/1.1" 500 17000
[22/Aug/2017 14:38:31] "GET /dictionary/ HTTP/1.1" 500 16978
[22/Aug/2017 14:38:31] "GET /dictionary/I%3A/relations/ HTTP/1.1" 500 17116
Internal Server Error: /dictionary/projection/
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py", line 86, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 489, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 486, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py", line 386, in projection
    usl = ieml.usl.tools.usl(post.usl.ieml)
  File "/usr/lib/python3.6/site-packages/ieml/usl/tools.py", line 21, in usl
    return USLParser().parse(arg)
  File "/usr/lib/python3.6/site-packages/ieml/usl/parser/parser.py", line 28, in parse
    return self.parser.parse(s, lexer=self.lexer)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 1118, in parseopt_notrack
    p.callable(pslice)
  File "/usr/lib/python3.6/site-packages/ieml/usl/parser/parser.py", line 42, in p_usl
    p[0] = Usl(IEMLParser().parse(p[1]))
  File "/usr/lib/python3.6/site-packages/ieml/syntax/parser/parser.py", line 53, in parse
    return self.parser.parse(s, lexer=self.lexer)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 1118, in parseopt_notrack
    p.callable(pslice)
  File "/usr/lib/python3.6/site-packages/ieml/syntax/parser/parser.py", line 97, in p_script
    p[0] = _build(term(p[1]))
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/tools.py", line 15, in term
    dictionary = Dictionary()
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 47, in __call__
    cls._instance = load_dictionary_from_cache(version)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/version.py", line 290, in load_dictionary_from_cache
    return pickle.load(fp)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 182, in __setstate__
    self._populate(scripts=state['scripts'], relations=state['relations'])
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 154, in _populate
    roots[root_ss[s.singular_sequences[0]]].append(s)

Can't post request to server on ieml_django

{
"authors": [],
 "created_on": null,
 "keywords": [],
 "language": "en",
 "title": "Indian stock investment Android app – MarketSmit India",
 "url": "https://marketsmithindia.com/mstool/investment-advisory-special-offers/seminar.html#/"
}

Add possibility to manage tag texts

From instance, if two automatically collected documents have the tags math and mathematics, we probably want them to refer to the same tag in the database.

Possibility to rename a tag.

@ogrergo I need to talk with you boy! Should we manage tags like we do for USLs?

Get cached dictionary version

get_default_dictionary_version loads the last version of the dictionary if set_default_dictionary_version has not been called. We should be able to retrieve the version in the cache.

relations errors

  • missing relations child d.i.- => d.i.-l.i.-' (the father is present)
  • relation opposed : d.i.-l.i.-' => l.i.-d.i.-t.u.-'

Add a state field to posts to know if the document url still exists (404)

Some scoop posts have old urls that don't exist anymore, server returns 404. For now, no post is created for those urls but we could still create the post and add a state field that will give the information to the user that some of his documents were not retrieved because the url is not good anymore, giving him the information that his collection is not complete and that he should update the url if he still wants the document.

New AST not comparing o.O:M:.- and E:O:.T:M:.- correctly

database entries for both:

/* 1 */
{
    "_id" : ObjectId("55d220dc6653c32453c0a58e"),
    "CANONICAL" : [ 
        "adaghaaaa"
    ],
    "CLASS" : "1",
    "EN" : "low",
    "FR" : "bas",
    "IEML" : "E:O:.T:M:.-",
    "LAYER" : "2",
    "PARADIGM" : "0",
    "TAILLE" : "6"
}

/* 2 */
{
    "_id" : ObjectId("55d220dc6653c32453c0a59b"),
    "CANONICAL" : [ 
        "bfadhaaaa"
    ],
    "CLASS" : "2",
    "EN" : "want to perform",
    "FR" : "vouloir performer",
    "IEML" : "o.O:M:.-",
    "LAYER" : "2",
    "PARADIGM" : "0",
    "TAILLE" : "6"
}

It's probably the E and U comparison that's wrong

Exception for invalid term

>>> ieml.tools.ieml("[u.-d.u.-'])]")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vincent/miniconda3/lib/python3.6/site-packages/ieml/tools.py", line 18, in ieml
    return IEMLParser().parse(arg)
  File "/home/vincent/miniconda3/lib/python3.6/site-packages/ieml/syntax/parser/parser.py", line 49, in parse
    self.parser.parse(s, lexer=self.lexer)
  File "/home/vincent/miniconda3/lib/python3.6/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/home/vincent/miniconda3/lib/python3.6/site-packages/ply/yacc.py", line 1118, in parseopt_notrack
    p.callable(pslice)
  File "/home/vincent/miniconda3/lib/python3.6/site-packages/ieml/syntax/parser/parser.py", line 82, in p_term
    p[0] = _build(Dictionary().terms[p[2]])
KeyError: "u.-d.u.-'"

Should raise a custom exception.

Bug in usls/from_rules/ endpoint

POST /usls/from_rules/
{
    "rules": {
        "r0": "A:O:.wo.t.-",
        "r1": "d.a.-l.a.-f.o.-'",
        "r2": "m.-M:.O:.-'m.-S:.U:.-'E:A:S:.-',",
        "f0": "b.o.-k.o.-s.u.-'",
        "f1": "n.u.-d.u.-d.u.-'"
    }
}

Error:

IEMLObjectResolutionError("Invalid ieml object definitions at:\n\t[] No compatible type found with the path r0 and the ieml object of type Table1D")

raised by ieml.tools.usl(rules)

Remove print calls

Not persistent, should use logs instead.

Moreover, raise an error on AWS as the Python process is not bound to a terminal.

USL translation uniqueness

Make sure two IEML words cannot have the same translation. For instance, this is not possible:

  • A+B -> joie
  • A+C -> joie

Look at slugs.

Everything fails

Traceback:  

File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
  58.         return view_func(*args, **kwargs)

File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py" in view
  86.             return self.dispatch(request, *args, **kwargs)

File "/usr/lib/python3.6/site-packages/rest_framework/views.py" in dispatch
  489.             response = self.handle_exception(exc)

File "/usr/lib/python3.6/site-packages/rest_framework/views.py" in handle_exception
  449.             self.raise_uncaught_exception(exc)

File "/usr/lib/python3.6/site-packages/rest_framework/views.py" in dispatch
  486.             response = handler(request, *args, **kwargs)

File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py" in list
  292.         data = serializers.TermSerializer(Dictionary(), many=True).data

File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py" in __call__
  47.                 cls._instance = load_dictionary_from_cache(version)

File "/usr/lib/python3.6/site-packages/ieml/dictionary/version.py" in load_dictionary_from_cache
  290.         return pickle.load(fp)

File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py" in __setstate__
  182.         self._populate(scripts=state['scripts'], relations=state['relations'])

File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py" in _populate
  154.             roots[root_ss[s.singular_sequences[0]]].append(s)

Exception Type: KeyError at /dictionary/
Exception Value: <ieml.dictionary.script.script.MultiplicativeScript object at 0x7f785d710b00>
Request information:
USER: AnonymousUser

Error when creating a new paradigm

Traceback (most recent call last):
File "/home/ubuntu/envs/dictionary/lib/python3.5/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/home/ubuntu/envs/dictionary/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/ubuntu/envs/dictionary/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/ubuntu/envs/dictionary/lib/python3.5/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/home/ubuntu/envs/dictionary/lib/python3.5/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/home/ubuntu/envs/dictionary/lib/python3.5/site-packages/rest_framework/views.py", line 489, in dispatch
response = self.handle_exception(exc)
File "/home/ubuntu/envs/dictionary/lib/python3.5/site-packages/rest_framework/views.py", line 449, in handle_exception
self.raise_uncaught_exception(exc)
File "/home/ubuntu/envs/dictionary/lib/python3.5/site-packages/rest_framework/views.py", line 486, in dispatch
response = handler(request, *args, **kwargs)
File "./dictionary/views.py", line 451, in post
new_version = create_dictionary_version(DictionaryVersion.from_file_name(version), add=to_add)
AttributeError: type object 'DictionaryVersion' has no attribute 'from_file_name'

Tags are duplicated in mongodb

The list of tags is duplicated on mongodb, they are most probably duplicated when retrieved which could mean that everything is read twice.

Error on f.o.-f.o.-',n.i.-f.i.-',M:O:.-O:.-',_

IndexError at /dictionary/f.o.-f.o.-',n.i.-f.i.-',M:O:.-O:.-',_/tables/↵index 2 is out of bounds for axis 0 with size 2↵↵Request Method: GET↵Request URL: http://localhost:8000/dictionary/f.o.-f.o.-',n.i.-f.i.-',M:O:.-O:.-',_/tables/↵Django Version: 1.11.2↵Python Executable: /usr/bin/python↵Python Version: 3.6.2↵Python Path: ['/home/piggygenius/Studies/Ensimag/2A/Internship/django_project', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/lib/python3.6/site-packages', '/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg']↵Server time: Tue, 29 Aug 2017 20:55:38 +0000↵Installed Applications:↵['django.contrib.admin',↵ 'django.contrib.auth',↵ 'django.contrib.contenttypes',↵ 'django.contrib.sessions',↵ 'django.contrib.messages',↵ 'django.contrib.staticfiles',↵ 'rest_framework',↵ 'rest_framework_mongoengine',↵ 'corsheaders',↵ 'django_intlekt']↵Installed Middleware:↵['django.middleware.security.SecurityMiddleware',↵ 'django.contrib.sessions.middleware.SessionMiddleware',↵ 'django.middleware.common.CommonMiddleware',↵ 'django.middleware.csrf.CsrfViewMiddleware',↵ 'django.contrib.auth.middleware.AuthenticationMiddleware',↵ 'django.contrib.messages.middleware.MessageMiddleware',↵ 'django.middleware.clickjacking.XFrameOptionsMiddleware',↵ 'corsheaders.middleware.CorsMiddleware',↵ 'django.middleware.common.CommonMiddleware']↵↵↵Traceback: ↵↵File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner↵ 41. response = get_response(request)↵↵File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response↵ 187. response = self.process_exception_by_middleware(e, request)↵↵File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response↵ 185. response = wrapped_callback(request, *callback_args, callback_kwargs)↵↵File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py" in wrapped_view↵ 58. return view_func(*args, kwargs)↵↵File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py" in view↵ 86. return self.dispatch(request, args, **kwargs)↵↵File "/usr/lib/python3.6/site-packages/rest_framework/views.py" in dispatch↵ 489. response = self.handle_exception(exc)↵↵File "/usr/lib/python3.6/site-packages/rest_framework/views.py" in handle_exception↵ 449. self.raise_uncaught_exception(exc)↵↵File "/usr/lib/python3.6/site-packages/rest_framework/views.py" in dispatch↵ 486. response = handler(request, args, **kwargs)↵↵File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py" in wrapper↵ 272. return f(self, request, pk=pk, format=format)↵↵File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py" in tables↵ 341. return Response(get_tables_for_term(pk))↵↵File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py" in get_tables_for_term↵ 197. return __build_parallel_table(main, others, _get_rel_table_of(main), selected_cell=selected_cell)↵↵File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py" in __build_parallel_table↵ 96. ] for i in range(table.shape[0])↵↵File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py" in ↵ 96. ] for i in range(table.shape[0])↵↵File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py" in ↵ 95. } for j in range(table.shape[1])↵↵File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py" in ↵ 94. 'others': [_term_entry(tab[i, j]) for tab in parallel_terms] + others_rel(table[i, j])↵↵File "/usr/lib/python3.6/site-packages/ieml/dictionary/table.py" in __getitem__↵ 74. return self.cells[item]↵↵Exception Type: IndexError at /dictionary/f.o.-f.o.-',n.i.-f.i.-',M:O:.-O:.-',/tables/↵Exception Value: index 2 is out of bounds for axis 0 with size 2↵Request information:↵USER: AnonymousUser↵↵GET: No GET data↵↵POST: No POST data↵↵FILES: No FILES data↵↵COOKIES: No cookie data↵↵META:↵COLORTERM = 'gnome-terminal'↵CONTENT_LENGTH = ''↵CONTENT_TYPE = 'text/plain'↵CUDA_HOME = '/usr/local/cuda'↵DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus'↵DESKTOP_SESSION = 'xfce'↵DISPLAY = ':0.0'↵DJANGO_SETTINGS_MODULE = 'django_project.settings'↵GATEWAY_INTERFACE = 'CGI/1.1'↵GLADE_CATALOG_PATH = ':'↵GLADE_MODULE_PATH = ':'↵GLADE_PIXMAP_PATH = ':'↵HISTCONTROL = 'ignoreboth:erasedups'↵HISTFILESIZE = '10000'↵HISTSIZE = '500'↵HOME = '/home/piggygenius'↵HTTP_ACCEPT = '/'↵HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'↵HTTP_ACCEPT_LANGUAGE = 'en-US,en;q=0.8,fr;q=0.6'↵HTTP_CONNECTION = 'keep-alive'↵HTTP_HOST = 'localhost:8000'↵HTTP_ORIG… ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')]↵LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur']↵LANGUAGE_CODE = 'en-us'↵LANGUAGE_COOKIE_AGE = None↵LANGUAGE_COOKIE_DOMAIN = None↵LANGUAGE_COOKIE_NAME = 'django_language'↵LANGUAGE_COOKIE_PATH = '/'↵LOCALE_PATHS = []↵LOGGING = {}↵LOGGING_CONFIG = 'logging.config.dictConfig'↵LOGIN_REDIRECT_URL = '/accounts/profile/'↵LOGIN_URL = '/accounts/login/'↵LOGOUT_REDIRECT_URL = None↵MANAGERS = []↵MEDIA_ROOT = ''↵MEDIA_URL = ''↵MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'↵MIDDLEWARE = ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware']↵MIDDLEWARE_CLASSES = ['django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware']↵MIGRATION_MODULES = {}↵MONTH_DAY_FORMAT = 'F j'↵NUMBER_GROUPING = 0↵PASSWORD_HASHERS = ''↵PASSWORD_RESET_TIMEOUT_DAYS = ''↵PREPEND_WWW = False↵REST_FRAMEWORK = {'DEFAULT_PAGINATION_CLASS': 'django_intlekt.pagination.PageNumberPagination', 'PAGE_SIZE': 100}↵ROOT_URLCONF = 'django_project.urls'↵SECRET_KEY = '****************'↵SECURE_BROWSER_XSS_FILTER = False↵SECURE_CONTENT_TYPE_NOSNIFF = False↵SECURE_HSTS_INCLUDE_SUBDOMAINS = False↵SECURE_HSTS_PRELOAD = False↵SECURE_HSTS_SECONDS = 0↵SECURE_PROXY_SSL_HEADER = None↵SECURE_REDIRECT_EXEMPT = []↵SECURE_SSL_HOST = None↵SECURE_SSL_REDIRECT = False↵SERVER_EMAIL = 'root@localhost'↵SESSION_CACHE_ALIAS = 'default'↵SESSION_COOKIE_AGE = 1209600↵SESSION_COOKIE_DOMAIN = None↵SESSION_COOKIE_HTTPONLY = True↵SESSION_COOKIE_NAME = 'sessionid'↵SESSION_COOKIE_PATH = '/'↵SESSION_COOKIE_SECURE = False↵SESSION_ENGINE = 'django.contrib.sessions.backends.db'↵SESSION_EXPIRE_AT_BROWSER_CLOSE = False↵SESSION_FILE_PATH = None↵SESSION_SAVE_EVERY_REQUEST = False↵SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'↵SETTINGS_MODULE = 'django_project.settings'↵SHORT_DATETIME_FORMAT = 'm/d/Y P'↵SHORT_DATE_FORMAT = 'm/d/Y'↵SIGNING_BACKEND = 'django.core.signing.TimestampSigner'↵SILENCED_SYSTEM_CHECKS = []↵STATICFILES_DIRS = []↵STATICFILES_FINDERS = ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder']↵STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'↵STATIC_ROOT = None↵STATIC_URL = '/static/'↵TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages']}}]↵TEST_NON_SERIALIZED_APPS = []↵TEST_RUNNER = 'django.test.runner.DiscoverRunner'↵THOUSAND_SEPARATOR = ','↵TIME_FORMAT = 'P'↵TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']↵TIME_ZONE = 'UTC'↵USE_ETAGS = False↵USE_I18N = True↵USE_L10N = True↵USE_THOUSAND_SEPARATOR = False↵USE_TZ = True↵USE_X_FORWARDED_HOST = False↵USE_X_FORWARDED_PORT = False↵WSGI_APPLICATION = 'django_project.wsgi.application'↵X_FRAME_OPTIONS = 'SAMEORIGIN'↵YEAR_MONTH_FORMAT = 'F Y'↵↵↵You're seeing this error because you have DEBUG = True in your↵Django settings file. Change that to False, and Django will↵display a standard page generated by the handler for this status code.↵↵

Internal Server Error: /dictionary/I:/tables/

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py", line 86, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 489, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 486, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py", line 267, in wrapper
    ieml.dictionary.term(pk)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/tools.py", line 15, in term
    dictionary = Dictionary()
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 47, in __call__
    cls._instance = load_dictionary_from_cache(version)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/version.py", line 290, in load_dictionary_from_cache
    return pickle.load(fp)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 182, in __setstate__
    self._populate(scripts=state['scripts'], relations=state['relations'])
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 154, in _populate
    roots[root_ss[s.singular_sequences[0]]].append(s)
KeyError: <ieml.dictionary.script.script.MultiplicativeScript object at 0x7f014b068828>
Internal Server Error: /dictionary/
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py", line 86, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 489, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 486, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py", line 292, in list
    data = serializers.TermSerializer(Dictionary(), many=True).data
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 47, in __call__
    cls._instance = load_dictionary_from_cache(version)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/version.py", line 290, in load_dictionary_from_cache
    return pickle.load(fp)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 182, in __setstate__
    self._populate(scripts=state['scripts'], relations=state['relations'])
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 154, in _populate
    roots[root_ss[s.singular_sequences[0]]].append(s)
KeyError: <ieml.dictionary.script.script.MultiplicativeScript object at 0x7f013bd87be0>
Internal Server Error: /dictionary/I:/relations/
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/viewsets.py", line 86, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 489, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/lib/python3.6/site-packages/rest_framework/views.py", line 486, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django_intlekt-0.3.1-py3.6.egg/django_intlekt/views/dictionary.py", line 267, in wrapper
    ieml.dictionary.term(pk)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/tools.py", line 15, in term
    dictionary = Dictionary()
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 47, in __call__
    cls._instance = load_dictionary_from_cache(version)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/version.py", line 290, in load_dictionary_from_cache
    return pickle.load(fp)
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 182, in __setstate__
    self._populate(scripts=state['scripts'], relations=state['relations'])
  File "/usr/lib/python3.6/site-packages/ieml/dictionary/dictionary.py", line 154, in _populate
    roots[root_ss[s.singular_sequences[0]]].append(s)
KeyError: <ieml.dictionary.script.script.MultiplicativeScript object at 0x7f014ce9e240>

Relations endpoints

  • rename the relations endpoints
  • order the relations entries
  • add a parameter to factorize the relations in their root paradigm.

Add USL hint

  • If all tags have one and only one USL: concatenate
  • Else if at least one tag has no USLs: concatenate and tell there are missing translations
  • Else if at least one tag has multiple USLs: add possibility to choose one usl then concatenate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.