Debian Codegraph @

docs/api/wn.ili.rst

raw
1 wn.ili
2 ======
3
4 .. automodule:: wn.ili
5
6 .. note::
7
8 See :doc:`../guides/interlingual` for background and usage information about
9 ILIs.
10
11
12 Functions for Getting ILI Objects
13 ---------------------------------
14
15 The following functions are for getting individual :class:`ILI` and
16 :class:`ProposedILI` objects from ILI identifiers or synsets, respectively, or
17 to list all such known objects.
18
19 .. autofunction:: get
20 .. autofunction:: get_all
21 .. autofunction:: get_proposed
22 .. autofunction:: get_all_proposed
23
24
25 ILI Status
26 ----------
27
28 The status of an ILI object (:attr:`ILI.status` or :attr:`ProposedILI.status`)
29 indicates what is known about its validity. Explicit information about ILIs can
30 be added to Wn with :func:`wn.add` (e.g., :python:`wn.add("cili")`), but without
31 it Wn can only make a guess.
32
33 If a lexicon has synsets referencing some ILI identifier and no ILI file has
34 been loaded, that ILI would have a status of :attr:`ILIStatus.PRESUPPOSED`. If
35 an ILI file has been loaded that lists the identifier, it would have a status of
36 :attr:`ILIStatus.ACTIVE`, whether or not a lexicon has been added that uses
37 the ILI. Both of these cases use :class:`ILI` objects.
38
39 A synset in the WN-LMF format may also propose a new ILI. It won't have an
40 identifier, but it should have a definition. These have the status of
41 :attr:`ILIStatus.PROPOSED`. The :class:`ProposedILI` is used for these objects,
42 and that is the only status they have.
43
44 The :attr:`ILIStatus.UNKNOWN` status is just a default (e.g., when manually
45 creating an :class:`ILI` object) and won't be encountered in normal scenarios.
46
47 .. autoclass:: ILIStatus
48
49 .. autoattribute:: UNKNOWN
50 .. autoattribute:: ACTIVE
51 .. autoattribute:: PRESUPPOSED
52 .. autoattribute:: PROPOSED
53
54
55 ILI Classes
56 -----------
57
58 .. autoclass:: ILI
59
60 .. autoattribute:: id
61
62 The ILI identifier.
63
64 .. autoattribute:: status
65
66 The status of the ILI.
67
68 .. automethod:: definition
69
70
71 .. autoclass:: ProposedILI
72
73 .. autoproperty:: id
74 .. autoproperty:: status
75 .. automethod:: definition
76 .. automethod:: synset
77 .. automethod:: lexicon
78
79
80 ILI Definitions
81 ---------------
82
83 Most likely someone inspecting the definition of an :class:`ILI` or
84 :class:`ProposedILI` only cares about the definition text, but for
85 completeness' sake the :class:`ILIDefinition` object models the text
86 along with any metadata that may have appeared in the WN-LMF lexicon
87 file. ILI files do not currently model metadata.
88
89 .. autoclass:: ILIDefinition
90
91 .. autoattribute:: text
92 .. automethod:: metadata