repo
stringlengths 7
54
| path
stringlengths 4
223
| func_name
stringlengths 1
134
| original_string
stringlengths 75
104k
| language
stringclasses 1
value | code
stringlengths 75
104k
| code_tokens
listlengths 20
28.4k
| docstring
stringlengths 1
46.3k
| docstring_tokens
listlengths 1
1.66k
| sha
stringlengths 40
40
| url
stringlengths 87
315
| partition
stringclasses 1
value | summary
stringlengths 4
350
| obf_code
stringlengths 7.85k
764k
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bcbnz/pylabels
|
labels/sheet.py
|
Sheet.preview_string
|
def preview_string(self, page, format='png', dpi=72, background_colour=0xFFFFFF):
"""Render a preview image of a page as a string.
Parameters
----------
page: positive integer
Which page to render. Must be in the range [1, page_count]
format: string
The image format to use for the preview. ReportLab uses the Python
Imaging Library (PIL) internally, so any PIL format should be
supported.
dpi: positive real
The dots-per-inch to use when rendering.
background_colour: Hex colour specification
What color background to use.
Notes
-----
If you are creating this sheet for a preview only, you can pass the
pages_to_draw parameter to the constructor to avoid the drawing function
being called for all the labels on pages you'll never look at. If you
preview a page you did not tell the sheet to draw, you will get a blank
image.
Raises
------
ValueError:
If the page number is not valid.
"""
# Check the page number.
if page < 1 or page > self.page_count:
raise ValueError("Invalid page number; should be between 1 and {0:d}.".format(self.page_count))
# Shade any remaining missing labels if desired.
self._shade_remaining_missing()
# Rendering to an image (as opposed to a PDF) requires any background
# to have an integer width and height if it is a ReportLab Image
# object. Drawing objects are exempt from this.
oldw, oldh = None, None
if isinstance(self._bgimage, Image):
oldw, oldh = self._bgimage.width, self._bgimage.height
self._bgimage.width = int(oldw) + 1
self._bgimage.height = int(oldh) + 1
# Let ReportLab do the heavy lifting.
s = renderPM.drawToString(self._pages[page-1], format, dpi, background_colour)
# Restore the size of the background image if we changed it.
if oldw:
self._bgimage.width = oldw
self._bgimage.height = oldh
# Done.
return s
|
python
|
def preview_string(self, page, format='png', dpi=72, background_colour=0xFFFFFF):
"""Render a preview image of a page as a string.
Parameters
----------
page: positive integer
Which page to render. Must be in the range [1, page_count]
format: string
The image format to use for the preview. ReportLab uses the Python
Imaging Library (PIL) internally, so any PIL format should be
supported.
dpi: positive real
The dots-per-inch to use when rendering.
background_colour: Hex colour specification
What color background to use.
Notes
-----
If you are creating this sheet for a preview only, you can pass the
pages_to_draw parameter to the constructor to avoid the drawing function
being called for all the labels on pages you'll never look at. If you
preview a page you did not tell the sheet to draw, you will get a blank
image.
Raises
------
ValueError:
If the page number is not valid.
"""
# Check the page number.
if page < 1 or page > self.page_count:
raise ValueError("Invalid page number; should be between 1 and {0:d}.".format(self.page_count))
# Shade any remaining missing labels if desired.
self._shade_remaining_missing()
# Rendering to an image (as opposed to a PDF) requires any background
# to have an integer width and height if it is a ReportLab Image
# object. Drawing objects are exempt from this.
oldw, oldh = None, None
if isinstance(self._bgimage, Image):
oldw, oldh = self._bgimage.width, self._bgimage.height
self._bgimage.width = int(oldw) + 1
self._bgimage.height = int(oldh) + 1
# Let ReportLab do the heavy lifting.
s = renderPM.drawToString(self._pages[page-1], format, dpi, background_colour)
# Restore the size of the background image if we changed it.
if oldw:
self._bgimage.width = oldw
self._bgimage.height = oldh
# Done.
return s
|
[
"def",
"preview_string",
"(",
"self",
",",
"page",
",",
"format",
"=",
"'png'",
",",
"dpi",
"=",
"72",
",",
"background_colour",
"=",
"0xFFFFFF",
")",
":",
"# Check the page number.",
"if",
"page",
"<",
"1",
"or",
"page",
">",
"self",
".",
"page_count",
":",
"raise",
"ValueError",
"(",
"\"Invalid page number; should be between 1 and {0:d}.\"",
".",
"format",
"(",
"self",
".",
"page_count",
")",
")",
"# Shade any remaining missing labels if desired.",
"self",
".",
"_shade_remaining_missing",
"(",
")",
"# Rendering to an image (as opposed to a PDF) requires any background",
"# to have an integer width and height if it is a ReportLab Image",
"# object. Drawing objects are exempt from this.",
"oldw",
",",
"oldh",
"=",
"None",
",",
"None",
"if",
"isinstance",
"(",
"self",
".",
"_bgimage",
",",
"Image",
")",
":",
"oldw",
",",
"oldh",
"=",
"self",
".",
"_bgimage",
".",
"width",
",",
"self",
".",
"_bgimage",
".",
"height",
"self",
".",
"_bgimage",
".",
"width",
"=",
"int",
"(",
"oldw",
")",
"+",
"1",
"self",
".",
"_bgimage",
".",
"height",
"=",
"int",
"(",
"oldh",
")",
"+",
"1",
"# Let ReportLab do the heavy lifting.",
"s",
"=",
"renderPM",
".",
"drawToString",
"(",
"self",
".",
"_pages",
"[",
"page",
"-",
"1",
"]",
",",
"format",
",",
"dpi",
",",
"background_colour",
")",
"# Restore the size of the background image if we changed it.",
"if",
"oldw",
":",
"self",
".",
"_bgimage",
".",
"width",
"=",
"oldw",
"self",
".",
"_bgimage",
".",
"height",
"=",
"oldh",
"# Done.",
"return",
"s"
] |
Render a preview image of a page as a string.
Parameters
----------
page: positive integer
Which page to render. Must be in the range [1, page_count]
format: string
The image format to use for the preview. ReportLab uses the Python
Imaging Library (PIL) internally, so any PIL format should be
supported.
dpi: positive real
The dots-per-inch to use when rendering.
background_colour: Hex colour specification
What color background to use.
Notes
-----
If you are creating this sheet for a preview only, you can pass the
pages_to_draw parameter to the constructor to avoid the drawing function
being called for all the labels on pages you'll never look at. If you
preview a page you did not tell the sheet to draw, you will get a blank
image.
Raises
------
ValueError:
If the page number is not valid.
|
[
"Render",
"a",
"preview",
"image",
"of",
"a",
"page",
"as",
"a",
"string",
"."
] |
ecdb4ca48061d8f1dc0fcfe2d55ce2b89e0e5ec6
|
https://github.com/bcbnz/pylabels/blob/ecdb4ca48061d8f1dc0fcfe2d55ce2b89e0e5ec6/labels/sheet.py#L555-L610
|
train
|
Render a preview image of a page as a string.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,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hU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(2215 - 2167) + '\157' + chr(51) + '\x37' + chr(0b101010 + 0o14), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\062' + chr(0b110010) + chr(0b1101 + 0o43), 0b1000), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(111) + chr(51) + chr(243 - 188) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + '\157' + chr(1647 - 1598) + '\066', 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + '\157' + chr(0b101011 + 0o10) + chr(49) + chr(0b110100), 52035 - 52027), nzTpIcepk0o8(chr(48) + chr(163 - 52) + chr(55) + chr(0b110 + 0o56), 34517 - 34509), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b1101111) + '\x31', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(1888 - 1839) + chr(0b1010 + 0o54) + '\067', 45941 - 45933), nzTpIcepk0o8(chr(48) + '\157' + '\061' + '\061' + chr(51), 0o10), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(3069 - 2958) + chr(0b110010) + chr(0b10100 + 0o35) + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + chr(1787 - 1735) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b100110 + 0o111) + '\064' + chr(1571 - 1522), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(5346 - 5235) + '\062' + chr(2685 - 2630) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100 + 0o61) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + '\157' + chr(2255 - 2204) + chr(0b110001) + chr(1743 - 1690), 35868 - 35860), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + '\x36' + '\064', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(0b1000 + 0o54), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(0b110101) + '\060', 0b1000), nzTpIcepk0o8(chr(128 - 80) + chr(0b1101111) + chr(2071 - 2021) + chr(55), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2265 - 2215) + chr(51) + chr(0b100101 + 0o14), 45728 - 45720), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b100111 + 0o20) + '\063', 0o10), nzTpIcepk0o8(chr(1561 - 1513) + chr(111) + chr(50) + chr(2520 - 2468) + chr(0b11 + 0o61), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\066', 8), nzTpIcepk0o8('\060' + chr(111) + '\063' + '\065' + '\x32', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(50) + chr(2219 - 2167), 0b1000), nzTpIcepk0o8('\060' + chr(3525 - 3414) + chr(0b110011) + chr(0b110101) + '\064', 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b1001 + 0o146) + chr(49) + chr(0b101 + 0o54) + '\062', 0b1000), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(0b110010) + chr(0b101101 + 0o6) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\x6f' + chr(0b11111 + 0o22) + chr(0b101000 + 0o15) + chr(0b110010), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b10001 + 0o136) + chr(0b11100 + 0o27) + chr(0b110000) + chr(55), 0b1000), nzTpIcepk0o8(chr(1072 - 1024) + chr(11999 - 11888) + '\x37' + '\060', 0o10), nzTpIcepk0o8(chr(256 - 208) + '\157' + '\x37' + '\x37', 4346 - 4338), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(2390 - 2339), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(56 - 7) + '\064' + '\x37', 2982 - 2974), nzTpIcepk0o8(chr(1503 - 1455) + chr(0b1100111 + 0o10) + '\x33' + chr(1380 - 1327), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1010010 + 0o35) + '\061' + chr(0b101100 + 0o7) + chr(0b101100 + 0o11), 0b1000), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(1051 - 940) + chr(49) + chr(1312 - 1260) + chr(52), 0o10), nzTpIcepk0o8(chr(1515 - 1467) + chr(0b1101000 + 0o7) + '\x34' + chr(52), 0b1000), nzTpIcepk0o8('\060' + chr(2665 - 2554) + chr(51) + chr(0b1100 + 0o47) + chr(1385 - 1332), 0b1000), nzTpIcepk0o8('\x30' + chr(371 - 260) + '\063' + chr(0b11 + 0o63) + chr(1816 - 1763), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110101) + '\x30', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xd0'), chr(100) + '\x65' + chr(0b1010101 + 0o16) + '\x6f' + chr(2406 - 2306) + chr(101))('\165' + chr(0b1110100) + chr(0b110 + 0o140) + chr(0b101101) + chr(0b1001 + 0o57)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def uq2sPdbQEM9S(hXMPsSrOQzbh, saC2QU0nRquP, q33KG3foQ_CJ=roI3spqORKae(ES5oEprVxulp(b'\x8e\xfe\x9d'), chr(9926 - 9826) + chr(6878 - 6777) + chr(0b10111 + 0o114) + chr(0b1010101 + 0o32) + '\x64' + '\x65')(chr(6940 - 6823) + '\164' + '\146' + '\x2d' + '\070'), tBMIUInSaqoo=nzTpIcepk0o8('\x30' + chr(0b111011 + 0o64) + '\x31' + chr(49) + '\060', 0b1000), WUjeRZq2SlQV=nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b1110 + 0o51) + '\x37' + chr(0b110111) + chr(55) + chr(0b101010 + 0o15) + chr(0b110111) + chr(0b1001 + 0o56) + chr(0b11011 + 0o34), 0b1000)):
if saC2QU0nRquP < nzTpIcepk0o8(chr(454 - 406) + chr(111) + '\x31', 8) or saC2QU0nRquP > roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xbc\xdb\xb1Z\xa5~C?\x18\xf9\xfbt'), chr(100) + chr(0b10 + 0o143) + '\x63' + chr(111) + chr(0b10011 + 0o121) + '\145')(chr(6072 - 5955) + '\164' + chr(0b1100110) + chr(45) + chr(1239 - 1183))):
raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xb7\xfe\x8co\xa0UeW;\xeb\xc4D\x9fE\xb8\x19n\re\xa2[\xd7f\x85\xa1\x80.\xba\x08\xa2\x18]~\x13j8\x01J\xfd\xc4\xde\xf1\x94j\xecG1M/\xf7\x8d'), '\x64' + chr(0b111100 + 0o51) + chr(99) + '\x6f' + chr(941 - 841) + chr(0b1100101))('\x75' + chr(116) + '\x66' + chr(0b101101) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\x8f\xa3\xc9E\x8b\x0fg\x18\x1a\xd5\xe0k'), '\144' + '\145' + chr(99) + chr(111) + chr(0b1100100) + chr(101))('\x75' + chr(5798 - 5682) + '\x66' + '\x2d' + chr(427 - 371)))(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xbc\xdb\xb1Z\xa5~C?\x18\xf9\xfbt'), chr(5207 - 5107) + '\145' + chr(0b1100011) + '\157' + chr(6476 - 6376) + chr(0b1100101))(chr(117) + '\164' + chr(592 - 490) + '\x2d' + '\x38'))))
roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xa1\xe3\x92o\xa8Y^\x05.\xe7\xc2H\xd1B\xa3\x13S\x05~\xea\x08\xcd`\x8d'), '\x64' + chr(4671 - 4570) + chr(8954 - 8855) + chr(0b110011 + 0o74) + chr(0b101000 + 0o74) + chr(0b111001 + 0o54))(chr(0b1110101) + chr(0b1110100) + '\x66' + '\055' + '\x38'))()
(v2ULtiGiRIjs, o6ywJQM4q2ZV) = (None, None)
if suIjIS24Zkqw(roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xa7\xf5\xb2}\xb6_Q$\x18\xee\x92J'), chr(6607 - 6507) + chr(101) + '\143' + '\157' + '\144' + '\145')(chr(0b1011011 + 0o32) + '\x74' + chr(7004 - 6902) + chr(45) + chr(0b1110 + 0o52))), RvV7ueTH51Uy):
(v2ULtiGiRIjs, o6ywJQM4q2ZV) = (hXMPsSrOQzbh._bgimage.dH3vcKdvgBu0, hXMPsSrOQzbh._bgimage.PaEBmun9J0YJ)
hXMPsSrOQzbh._bgimage.dH3vcKdvgBu0 = nzTpIcepk0o8(v2ULtiGiRIjs) + nzTpIcepk0o8(chr(48) + chr(0b1100 + 0o143) + '\x31', 8)
hXMPsSrOQzbh._bgimage.PaEBmun9J0YJ = nzTpIcepk0o8(o6ywJQM4q2ZV) + nzTpIcepk0o8(chr(0b111 + 0o51) + chr(111) + chr(0b11100 + 0o25), 8)
PmE5_h409JAA = Pa4ZbYAHgoPL.drawToString(hXMPsSrOQzbh._pages[saC2QU0nRquP - nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001), 8)], q33KG3foQ_CJ, tBMIUInSaqoo, WUjeRZq2SlQV)
if v2ULtiGiRIjs:
hXMPsSrOQzbh._bgimage.dH3vcKdvgBu0 = v2ULtiGiRIjs
hXMPsSrOQzbh._bgimage.PaEBmun9J0YJ = o6ywJQM4q2ZV
return PmE5_h409JAA
|
bcbnz/pylabels
|
labels/specifications.py
|
Specification._calculate
|
def _calculate(self):
"""Checks the dimensions of the sheet are valid and consistent.
NB: this is called internally when needed; there should be no need for
user code to call it.
"""
# Check the dimensions are larger than zero.
for dimension in ('_sheet_width', '_sheet_height', '_columns', '_rows', '_label_width', '_label_height'):
if getattr(self, dimension) <= 0:
name = dimension.replace('_', ' ').strip().capitalize()
raise InvalidDimension("{0:s} must be greater than zero.".format(name))
# Check margins / gaps are not smaller than zero if given.
# At the same time, force the values to decimals.
for margin in ('_left_margin', '_column_gap', '_right_margin', '_top_margin', '_row_gap', '_bottom_margin',
'_left_padding', '_right_padding', '_top_padding', '_bottom_padding'):
val = getattr(self, margin)
if val is not None:
if margin in self._autoset:
val = None
else:
val = Decimal(val)
if val < 0:
name = margin.replace('_', ' ').strip().capitalize()
raise InvalidDimension("{0:s} cannot be less than zero.".format(name))
setattr(self, margin, val)
else:
self._autoset.add(margin)
# Check the corner radius.
if self._corner_radius < 0:
raise InvalidDimension("Corner radius cannot be less than zero.")
if self._corner_radius > (self._label_width / 2):
raise InvalidDimension("Corner radius cannot be more than half the label width.")
if self._corner_radius > (self._label_height / 2):
raise InvalidDimension("Corner radius cannot be more than half the label height.")
# If there is no padding, we don't need the padding radius.
if (self._left_padding + self._right_padding + self._top_padding + self._bottom_padding) == 0:
if self._padding_radius != 0:
raise InvalidDimension("Padding radius must be zero if there is no padding.")
else:
if (self._left_padding + self._right_padding) >= self._label_width:
raise InvalidDimension("Sum of horizontal padding must be less than the label width.")
if (self._top_padding + self._bottom_padding) >= self._label_height:
raise InvalidDimension("Sum of vertical padding must be less than the label height.")
if self._padding_radius < 0:
raise InvalidDimension("Padding radius cannot be less than zero.")
# Calculate the amount of spare space.
hspace = self._sheet_width - (self._label_width * self._columns)
vspace = self._sheet_height - (self._label_height * self._rows)
# Cannot fit.
if hspace < 0:
raise InvalidDimension("Labels are too wide to fit on the sheet.")
if vspace < 0:
raise InvalidDimension("Labels are too tall to fit on the sheet.")
# Process the horizontal margins / gaps.
hcount = 1 + self._columns
if self._left_margin is not None:
hspace -= self._left_margin
if hspace < 0:
raise InvalidDimension("Left margin is too wide for the labels to fit on the sheet.")
hcount -= 1
if self._column_gap is not None:
hspace -= ((self._columns - 1) * self._column_gap)
if hspace < 0:
raise InvalidDimension("Column gap is too wide for the labels to fit on the sheet.")
hcount -= (self._columns - 1)
if self._right_margin is not None:
hspace -= self._right_margin
if hspace < 0.01 and hspace > -0.01:
self._right_margin += hspace
hspace = 0
if hspace < 0:
raise InvalidDimension("Right margin is too wide for the labels to fit on the sheet.")
hcount -= 1
# Process the vertical margins / gaps.
vcount = 1 + self._rows
if self._top_margin is not None:
vspace -= self._top_margin
if vspace < 0:
raise InvalidDimension("Top margin is too tall for the labels to fit on the sheet.")
vcount -= 1
if self._row_gap is not None:
vspace -= ((self._rows - 1) * self._row_gap)
if vspace < 0:
raise InvalidDimension("Row gap is too tall for the labels to fit on the sheet.")
vcount -= (self._rows - 1)
if self._bottom_margin is not None:
vspace -= self._bottom_margin
if vspace < 0.01 and vspace > -0.01:
self._bottom_margin += vspace
vspace = 0
if vspace < 0:
raise InvalidDimension("Bottom margin is too tall for the labels to fit on the sheet.")
vcount -= 1
# If all the margins are specified, they must use up all available space.
if hcount == 0 and hspace != 0:
raise InvalidDimension("Not all width used by manually specified margins/gaps; {}mm left.".format(hspace))
if vcount == 0 and vspace != 0:
raise InvalidDimension("Not all height used by manually specified margins/gaps; {}mm left.".format(vspace))
# Split any extra horizontal space and allocate it.
if hcount:
auto_margin = hspace / hcount
for margin in ('_left_margin', '_column_gap', '_right_margin'):
if getattr(self, margin) is None:
setattr(self, margin, auto_margin)
# And allocate any extra vertical space.
if vcount:
auto_margin = vspace / vcount
for margin in ('_top_margin', '_row_gap', '_bottom_margin'):
if getattr(self, margin) is None:
setattr(self, margin, auto_margin)
|
python
|
def _calculate(self):
"""Checks the dimensions of the sheet are valid and consistent.
NB: this is called internally when needed; there should be no need for
user code to call it.
"""
# Check the dimensions are larger than zero.
for dimension in ('_sheet_width', '_sheet_height', '_columns', '_rows', '_label_width', '_label_height'):
if getattr(self, dimension) <= 0:
name = dimension.replace('_', ' ').strip().capitalize()
raise InvalidDimension("{0:s} must be greater than zero.".format(name))
# Check margins / gaps are not smaller than zero if given.
# At the same time, force the values to decimals.
for margin in ('_left_margin', '_column_gap', '_right_margin', '_top_margin', '_row_gap', '_bottom_margin',
'_left_padding', '_right_padding', '_top_padding', '_bottom_padding'):
val = getattr(self, margin)
if val is not None:
if margin in self._autoset:
val = None
else:
val = Decimal(val)
if val < 0:
name = margin.replace('_', ' ').strip().capitalize()
raise InvalidDimension("{0:s} cannot be less than zero.".format(name))
setattr(self, margin, val)
else:
self._autoset.add(margin)
# Check the corner radius.
if self._corner_radius < 0:
raise InvalidDimension("Corner radius cannot be less than zero.")
if self._corner_radius > (self._label_width / 2):
raise InvalidDimension("Corner radius cannot be more than half the label width.")
if self._corner_radius > (self._label_height / 2):
raise InvalidDimension("Corner radius cannot be more than half the label height.")
# If there is no padding, we don't need the padding radius.
if (self._left_padding + self._right_padding + self._top_padding + self._bottom_padding) == 0:
if self._padding_radius != 0:
raise InvalidDimension("Padding radius must be zero if there is no padding.")
else:
if (self._left_padding + self._right_padding) >= self._label_width:
raise InvalidDimension("Sum of horizontal padding must be less than the label width.")
if (self._top_padding + self._bottom_padding) >= self._label_height:
raise InvalidDimension("Sum of vertical padding must be less than the label height.")
if self._padding_radius < 0:
raise InvalidDimension("Padding radius cannot be less than zero.")
# Calculate the amount of spare space.
hspace = self._sheet_width - (self._label_width * self._columns)
vspace = self._sheet_height - (self._label_height * self._rows)
# Cannot fit.
if hspace < 0:
raise InvalidDimension("Labels are too wide to fit on the sheet.")
if vspace < 0:
raise InvalidDimension("Labels are too tall to fit on the sheet.")
# Process the horizontal margins / gaps.
hcount = 1 + self._columns
if self._left_margin is not None:
hspace -= self._left_margin
if hspace < 0:
raise InvalidDimension("Left margin is too wide for the labels to fit on the sheet.")
hcount -= 1
if self._column_gap is not None:
hspace -= ((self._columns - 1) * self._column_gap)
if hspace < 0:
raise InvalidDimension("Column gap is too wide for the labels to fit on the sheet.")
hcount -= (self._columns - 1)
if self._right_margin is not None:
hspace -= self._right_margin
if hspace < 0.01 and hspace > -0.01:
self._right_margin += hspace
hspace = 0
if hspace < 0:
raise InvalidDimension("Right margin is too wide for the labels to fit on the sheet.")
hcount -= 1
# Process the vertical margins / gaps.
vcount = 1 + self._rows
if self._top_margin is not None:
vspace -= self._top_margin
if vspace < 0:
raise InvalidDimension("Top margin is too tall for the labels to fit on the sheet.")
vcount -= 1
if self._row_gap is not None:
vspace -= ((self._rows - 1) * self._row_gap)
if vspace < 0:
raise InvalidDimension("Row gap is too tall for the labels to fit on the sheet.")
vcount -= (self._rows - 1)
if self._bottom_margin is not None:
vspace -= self._bottom_margin
if vspace < 0.01 and vspace > -0.01:
self._bottom_margin += vspace
vspace = 0
if vspace < 0:
raise InvalidDimension("Bottom margin is too tall for the labels to fit on the sheet.")
vcount -= 1
# If all the margins are specified, they must use up all available space.
if hcount == 0 and hspace != 0:
raise InvalidDimension("Not all width used by manually specified margins/gaps; {}mm left.".format(hspace))
if vcount == 0 and vspace != 0:
raise InvalidDimension("Not all height used by manually specified margins/gaps; {}mm left.".format(vspace))
# Split any extra horizontal space and allocate it.
if hcount:
auto_margin = hspace / hcount
for margin in ('_left_margin', '_column_gap', '_right_margin'):
if getattr(self, margin) is None:
setattr(self, margin, auto_margin)
# And allocate any extra vertical space.
if vcount:
auto_margin = vspace / vcount
for margin in ('_top_margin', '_row_gap', '_bottom_margin'):
if getattr(self, margin) is None:
setattr(self, margin, auto_margin)
|
[
"def",
"_calculate",
"(",
"self",
")",
":",
"# Check the dimensions are larger than zero.",
"for",
"dimension",
"in",
"(",
"'_sheet_width'",
",",
"'_sheet_height'",
",",
"'_columns'",
",",
"'_rows'",
",",
"'_label_width'",
",",
"'_label_height'",
")",
":",
"if",
"getattr",
"(",
"self",
",",
"dimension",
")",
"<=",
"0",
":",
"name",
"=",
"dimension",
".",
"replace",
"(",
"'_'",
",",
"' '",
")",
".",
"strip",
"(",
")",
".",
"capitalize",
"(",
")",
"raise",
"InvalidDimension",
"(",
"\"{0:s} must be greater than zero.\"",
".",
"format",
"(",
"name",
")",
")",
"# Check margins / gaps are not smaller than zero if given.",
"# At the same time, force the values to decimals.",
"for",
"margin",
"in",
"(",
"'_left_margin'",
",",
"'_column_gap'",
",",
"'_right_margin'",
",",
"'_top_margin'",
",",
"'_row_gap'",
",",
"'_bottom_margin'",
",",
"'_left_padding'",
",",
"'_right_padding'",
",",
"'_top_padding'",
",",
"'_bottom_padding'",
")",
":",
"val",
"=",
"getattr",
"(",
"self",
",",
"margin",
")",
"if",
"val",
"is",
"not",
"None",
":",
"if",
"margin",
"in",
"self",
".",
"_autoset",
":",
"val",
"=",
"None",
"else",
":",
"val",
"=",
"Decimal",
"(",
"val",
")",
"if",
"val",
"<",
"0",
":",
"name",
"=",
"margin",
".",
"replace",
"(",
"'_'",
",",
"' '",
")",
".",
"strip",
"(",
")",
".",
"capitalize",
"(",
")",
"raise",
"InvalidDimension",
"(",
"\"{0:s} cannot be less than zero.\"",
".",
"format",
"(",
"name",
")",
")",
"setattr",
"(",
"self",
",",
"margin",
",",
"val",
")",
"else",
":",
"self",
".",
"_autoset",
".",
"add",
"(",
"margin",
")",
"# Check the corner radius.",
"if",
"self",
".",
"_corner_radius",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Corner radius cannot be less than zero.\"",
")",
"if",
"self",
".",
"_corner_radius",
">",
"(",
"self",
".",
"_label_width",
"/",
"2",
")",
":",
"raise",
"InvalidDimension",
"(",
"\"Corner radius cannot be more than half the label width.\"",
")",
"if",
"self",
".",
"_corner_radius",
">",
"(",
"self",
".",
"_label_height",
"/",
"2",
")",
":",
"raise",
"InvalidDimension",
"(",
"\"Corner radius cannot be more than half the label height.\"",
")",
"# If there is no padding, we don't need the padding radius.",
"if",
"(",
"self",
".",
"_left_padding",
"+",
"self",
".",
"_right_padding",
"+",
"self",
".",
"_top_padding",
"+",
"self",
".",
"_bottom_padding",
")",
"==",
"0",
":",
"if",
"self",
".",
"_padding_radius",
"!=",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Padding radius must be zero if there is no padding.\"",
")",
"else",
":",
"if",
"(",
"self",
".",
"_left_padding",
"+",
"self",
".",
"_right_padding",
")",
">=",
"self",
".",
"_label_width",
":",
"raise",
"InvalidDimension",
"(",
"\"Sum of horizontal padding must be less than the label width.\"",
")",
"if",
"(",
"self",
".",
"_top_padding",
"+",
"self",
".",
"_bottom_padding",
")",
">=",
"self",
".",
"_label_height",
":",
"raise",
"InvalidDimension",
"(",
"\"Sum of vertical padding must be less than the label height.\"",
")",
"if",
"self",
".",
"_padding_radius",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Padding radius cannot be less than zero.\"",
")",
"# Calculate the amount of spare space.",
"hspace",
"=",
"self",
".",
"_sheet_width",
"-",
"(",
"self",
".",
"_label_width",
"*",
"self",
".",
"_columns",
")",
"vspace",
"=",
"self",
".",
"_sheet_height",
"-",
"(",
"self",
".",
"_label_height",
"*",
"self",
".",
"_rows",
")",
"# Cannot fit.",
"if",
"hspace",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Labels are too wide to fit on the sheet.\"",
")",
"if",
"vspace",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Labels are too tall to fit on the sheet.\"",
")",
"# Process the horizontal margins / gaps.",
"hcount",
"=",
"1",
"+",
"self",
".",
"_columns",
"if",
"self",
".",
"_left_margin",
"is",
"not",
"None",
":",
"hspace",
"-=",
"self",
".",
"_left_margin",
"if",
"hspace",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Left margin is too wide for the labels to fit on the sheet.\"",
")",
"hcount",
"-=",
"1",
"if",
"self",
".",
"_column_gap",
"is",
"not",
"None",
":",
"hspace",
"-=",
"(",
"(",
"self",
".",
"_columns",
"-",
"1",
")",
"*",
"self",
".",
"_column_gap",
")",
"if",
"hspace",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Column gap is too wide for the labels to fit on the sheet.\"",
")",
"hcount",
"-=",
"(",
"self",
".",
"_columns",
"-",
"1",
")",
"if",
"self",
".",
"_right_margin",
"is",
"not",
"None",
":",
"hspace",
"-=",
"self",
".",
"_right_margin",
"if",
"hspace",
"<",
"0.01",
"and",
"hspace",
">",
"-",
"0.01",
":",
"self",
".",
"_right_margin",
"+=",
"hspace",
"hspace",
"=",
"0",
"if",
"hspace",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Right margin is too wide for the labels to fit on the sheet.\"",
")",
"hcount",
"-=",
"1",
"# Process the vertical margins / gaps.",
"vcount",
"=",
"1",
"+",
"self",
".",
"_rows",
"if",
"self",
".",
"_top_margin",
"is",
"not",
"None",
":",
"vspace",
"-=",
"self",
".",
"_top_margin",
"if",
"vspace",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Top margin is too tall for the labels to fit on the sheet.\"",
")",
"vcount",
"-=",
"1",
"if",
"self",
".",
"_row_gap",
"is",
"not",
"None",
":",
"vspace",
"-=",
"(",
"(",
"self",
".",
"_rows",
"-",
"1",
")",
"*",
"self",
".",
"_row_gap",
")",
"if",
"vspace",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Row gap is too tall for the labels to fit on the sheet.\"",
")",
"vcount",
"-=",
"(",
"self",
".",
"_rows",
"-",
"1",
")",
"if",
"self",
".",
"_bottom_margin",
"is",
"not",
"None",
":",
"vspace",
"-=",
"self",
".",
"_bottom_margin",
"if",
"vspace",
"<",
"0.01",
"and",
"vspace",
">",
"-",
"0.01",
":",
"self",
".",
"_bottom_margin",
"+=",
"vspace",
"vspace",
"=",
"0",
"if",
"vspace",
"<",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Bottom margin is too tall for the labels to fit on the sheet.\"",
")",
"vcount",
"-=",
"1",
"# If all the margins are specified, they must use up all available space.",
"if",
"hcount",
"==",
"0",
"and",
"hspace",
"!=",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Not all width used by manually specified margins/gaps; {}mm left.\"",
".",
"format",
"(",
"hspace",
")",
")",
"if",
"vcount",
"==",
"0",
"and",
"vspace",
"!=",
"0",
":",
"raise",
"InvalidDimension",
"(",
"\"Not all height used by manually specified margins/gaps; {}mm left.\"",
".",
"format",
"(",
"vspace",
")",
")",
"# Split any extra horizontal space and allocate it.",
"if",
"hcount",
":",
"auto_margin",
"=",
"hspace",
"/",
"hcount",
"for",
"margin",
"in",
"(",
"'_left_margin'",
",",
"'_column_gap'",
",",
"'_right_margin'",
")",
":",
"if",
"getattr",
"(",
"self",
",",
"margin",
")",
"is",
"None",
":",
"setattr",
"(",
"self",
",",
"margin",
",",
"auto_margin",
")",
"# And allocate any extra vertical space.",
"if",
"vcount",
":",
"auto_margin",
"=",
"vspace",
"/",
"vcount",
"for",
"margin",
"in",
"(",
"'_top_margin'",
",",
"'_row_gap'",
",",
"'_bottom_margin'",
")",
":",
"if",
"getattr",
"(",
"self",
",",
"margin",
")",
"is",
"None",
":",
"setattr",
"(",
"self",
",",
"margin",
",",
"auto_margin",
")"
] |
Checks the dimensions of the sheet are valid and consistent.
NB: this is called internally when needed; there should be no need for
user code to call it.
|
[
"Checks",
"the",
"dimensions",
"of",
"the",
"sheet",
"are",
"valid",
"and",
"consistent",
"."
] |
ecdb4ca48061d8f1dc0fcfe2d55ce2b89e0e5ec6
|
https://github.com/bcbnz/pylabels/blob/ecdb4ca48061d8f1dc0fcfe2d55ce2b89e0e5ec6/labels/specifications.py#L135-L255
|
train
|
Calculates the size of the current object and returns the size of the object.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,W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op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110 + 0o52) + '\157' + chr(49) + chr(55) + chr(2512 - 2458), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + chr(0b110100) + '\067', 0o10), nzTpIcepk0o8('\x30' + chr(7621 - 7510) + '\063' + chr(0b110000) + '\065', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + '\061' + chr(0b110010), 30702 - 30694), nzTpIcepk0o8('\060' + chr(111) + '\x31' + '\067' + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1010011 + 0o34) + chr(49) + '\060' + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(12026 - 11915) + chr(0b110011) + chr(52) + '\067', 65224 - 65216), nzTpIcepk0o8(chr(0b101111 + 0o1) + '\x6f' + chr(0b1110 + 0o44) + '\x35' + '\x31', 0o10), nzTpIcepk0o8('\060' + chr(6978 - 6867) + chr(0b1011 + 0o46) + chr(53), 25011 - 25003), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b100011 + 0o20) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(289 - 241) + '\157' + chr(0b1010 + 0o51) + chr(0b11111 + 0o25) + '\x35', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1100000 + 0o17) + '\x32' + chr(0b1111 + 0o45) + '\064', 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(7596 - 7485) + chr(1498 - 1448) + '\x34' + '\x31', 0o10), nzTpIcepk0o8(chr(1180 - 1132) + chr(0b1000 + 0o147) + chr(0b101101 + 0o5) + chr(939 - 891) + '\065', 2552 - 2544), nzTpIcepk0o8(chr(299 - 251) + '\157' + chr(0b1100 + 0o47) + chr(49) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(5942 - 5831) + '\x31' + '\061' + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(51) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(48), 0o10), nzTpIcepk0o8(chr(48) + chr(2010 - 1899) + chr(49) + chr(0b1 + 0o62) + chr(54), 4068 - 4060), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1124 - 1073) + chr(1535 - 1485), 30909 - 30901), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100101 + 0o15) + chr(637 - 584) + chr(0b101111 + 0o2), 8), nzTpIcepk0o8(chr(0b110000) + chr(11660 - 11549) + '\066' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(12176 - 12065) + '\061' + chr(2834 - 2779) + '\063', ord("\x08")), nzTpIcepk0o8(chr(246 - 198) + chr(0b1101111) + chr(2385 - 2335) + chr(0b110111) + '\x31', 19747 - 19739), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110011) + chr(48) + chr(0b110000 + 0o4), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b11011 + 0o27) + '\x30' + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(111) + '\065' + chr(0b110100), 57408 - 57400), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + '\065' + '\065', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b10111 + 0o34) + '\x33' + chr(338 - 289), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1010 + 0o55) + chr(0b100110 + 0o15), 0o10), nzTpIcepk0o8(chr(1802 - 1754) + chr(0b1101111) + chr(0b110011) + chr(0b110010) + '\x33', 0b1000), nzTpIcepk0o8(chr(48) + chr(1406 - 1295) + '\x34' + chr(0b100110 + 0o20), 42308 - 42300), nzTpIcepk0o8('\x30' + chr(7630 - 7519) + chr(0b100000 + 0o23) + chr(49) + chr(52), 3586 - 3578), nzTpIcepk0o8(chr(54 - 6) + chr(6347 - 6236) + chr(50) + chr(990 - 935) + chr(191 - 139), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + '\x33' + '\x33', 46558 - 46550), nzTpIcepk0o8('\060' + '\x6f' + chr(1988 - 1939) + chr(2262 - 2213) + chr(49), 14030 - 14022), nzTpIcepk0o8('\060' + chr(111) + chr(0b10010 + 0o41) + '\066' + '\x32', 0b1000), nzTpIcepk0o8(chr(0b1010 + 0o46) + '\x6f' + chr(2264 - 2214) + chr(0b11110 + 0o24) + chr(1518 - 1463), 0o10), nzTpIcepk0o8('\x30' + chr(0b110110 + 0o71) + chr(958 - 908) + '\060' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b111 + 0o150) + '\062' + '\066' + '\066', ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(53) + chr(0b110 + 0o52), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'P'), chr(0b1100100) + chr(101) + chr(99) + chr(8880 - 8769) + chr(0b111111 + 0o45) + '\x65')('\165' + chr(116) + chr(0b110001 + 0o65) + chr(0b101101) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def m_hELKSTZmv7(hXMPsSrOQzbh):
for BOBCMSAVNAaY in (roI3spqORKae(ES5oEprVxulp(b'!\xd4\xad\xaf\x1a0\xb8\xded|\x91\xcc'), chr(3734 - 3634) + chr(101) + chr(8560 - 8461) + chr(0b1101110 + 0o1) + '\144' + chr(0b1100101))(chr(2244 - 2127) + chr(785 - 669) + chr(0b1000110 + 0o40) + chr(0b101 + 0o50) + chr(1729 - 1673)), roI3spqORKae(ES5oEprVxulp(b'!\xd4\xad\xaf\x1a0\xb8\xc1hq\x82\xcc\xd5'), '\x64' + '\x65' + chr(99) + chr(0b1101111) + chr(0b100111 + 0o75) + chr(101))('\165' + chr(0b1110100) + chr(0b1100110) + '\x2d' + '\x38'), roI3spqORKae(ES5oEprVxulp(b'!\xc4\xaa\xa6\n)\x89\xda'), chr(3025 - 2925) + '\x65' + chr(1025 - 926) + chr(9175 - 9064) + chr(0b1100100) + '\x65')(chr(4364 - 4247) + chr(224 - 108) + '\146' + '\x2d' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'!\xd5\xaa\xbd\x0c'), '\144' + chr(101) + '\x63' + chr(0b1010 + 0o145) + '\144' + '\145')(chr(0b111100 + 0o71) + chr(6112 - 5996) + '\146' + chr(0b101101) + chr(0b100111 + 0o21)), roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa4\xa8\x1a(\xb8\xded|\x91\xcc'), chr(2000 - 1900) + '\145' + chr(0b1100011) + '\x6f' + '\144' + chr(0b10111 + 0o116))(chr(0b1110101) + chr(0b1110100) + chr(0b1000111 + 0o37) + chr(0b101101) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa4\xa8\x1a(\xb8\xc1hq\x82\xcc\xd5'), '\x64' + chr(0b110101 + 0o60) + '\x63' + '\157' + chr(0b1011101 + 0o7) + chr(0b1100101))('\x75' + '\x74' + chr(0b1100110) + '\055' + chr(0b111000))):
if roI3spqORKae(hXMPsSrOQzbh, BOBCMSAVNAaY) <= nzTpIcepk0o8('\060' + chr(111) + chr(48), 8):
SLVB2BPA_mIe = BOBCMSAVNAaY.replace(roI3spqORKae(ES5oEprVxulp(b'!'), chr(0b101111 + 0o65) + '\145' + chr(4252 - 4153) + chr(0b1101001 + 0o6) + '\x64' + '\x65')('\165' + '\x74' + chr(3404 - 3302) + chr(0b11111 + 0o16) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'^'), chr(3780 - 3680) + chr(0b111 + 0o136) + chr(0b1100011) + '\x6f' + chr(100) + '\145')(chr(0b10100 + 0o141) + chr(0b1110100) + chr(0b101001 + 0o75) + chr(0b10011 + 0o32) + '\x38')).strip().capitalize()
raise Hve2rWByk1oX(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\x05\x97\xff\xb9\x02d\x8a\xdc~l\xc5\xc6\xc4\xa5\xae<{a*\x7f\xdb\x10\x0f\xd1\xa5\xed\x0c\x17\xbcI\xbc\x08'), chr(100) + '\145' + chr(0b101010 + 0o71) + '\157' + '\144' + chr(0b1100101))(chr(0b1001000 + 0o55) + chr(116) + '\x66' + '\x2d' + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\x0f\x94\xf6\x818w\x81\xc6\\G\xa6\xee'), chr(0b1100100) + chr(0b101 + 0o140) + '\x63' + chr(5746 - 5635) + chr(0b111110 + 0o46) + chr(0b1100101))(chr(0b11010 + 0o133) + chr(116) + chr(102) + chr(0b101101) + chr(56)))(SLVB2BPA_mIe))
for yIUGx8mrC542 in (roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa0\xac\x0b\x1b\x8a\xc8\x7f\x7f\x8c\xca'), chr(8515 - 8415) + chr(101) + chr(99) + chr(0b100111 + 0o110) + chr(2296 - 2196) + chr(8676 - 8575))('\165' + '\x74' + chr(8959 - 8857) + chr(0b10011 + 0o32) + chr(0b111000 + 0o0)), roI3spqORKae(ES5oEprVxulp(b'!\xc4\xaa\xa6\n)\x89\xf6jy\x95'), chr(6693 - 6593) + '\x65' + chr(4855 - 4756) + chr(10248 - 10137) + chr(0b1100100) + chr(101))(chr(0b1110101) + '\x74' + chr(2703 - 2601) + chr(45) + chr(1471 - 1415)), roI3spqORKae(ES5oEprVxulp(b'!\xd5\xac\xad\x170\xb8\xc4lj\x82\xcd\xcf'), chr(3645 - 3545) + '\145' + chr(0b1001110 + 0o25) + chr(0b1110 + 0o141) + chr(0b1001001 + 0o33) + chr(0b111100 + 0o51))(chr(1700 - 1583) + chr(0b1001001 + 0o53) + chr(0b1100110) + '\055' + chr(521 - 465)), roI3spqORKae(ES5oEprVxulp(b'!\xd3\xaa\xba )\x86\xdbjq\x8b'), '\144' + chr(3923 - 3822) + chr(4295 - 4196) + chr(3757 - 3646) + '\144' + chr(101))(chr(0b10011 + 0o142) + '\164' + chr(0b1100110) + chr(0b1111 + 0o36) + '\070'), roI3spqORKae(ES5oEprVxulp(b'!\xd5\xaa\xbd #\x86\xd9'), chr(0b1011000 + 0o14) + '\145' + chr(8528 - 8429) + '\157' + chr(962 - 862) + '\145')(chr(0b110010 + 0o103) + '\x74' + chr(3473 - 3371) + chr(45) + chr(1074 - 1018)), roI3spqORKae(ES5oEprVxulp(b'!\xc5\xaa\xbe\x0b+\x8a\xf6`y\x97\xc3\xc8\xeb'), chr(9958 - 9858) + chr(0b1100101) + chr(99) + chr(0b1101111) + '\144' + chr(1137 - 1036))(chr(0b0 + 0o165) + chr(0b1100101 + 0o17) + '\146' + chr(0b101011 + 0o2) + chr(0b101111 + 0o11)), roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa0\xac\x0b\x1b\x97\xc8i|\x8c\xca\xc6'), chr(0b1001000 + 0o34) + chr(0b101010 + 0o73) + '\x63' + '\157' + chr(2666 - 2566) + '\x65')(chr(117) + chr(10496 - 10380) + chr(102) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'!\xd5\xac\xad\x170\xb8\xd9l|\x81\xcd\xcf\xe2'), '\144' + chr(0b111111 + 0o46) + '\143' + chr(11428 - 11317) + chr(0b1100100) + chr(101))(chr(117) + chr(0b1110100) + chr(102) + chr(611 - 566) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'!\xd3\xaa\xba 4\x86\xcdiq\x8b\xc3'), chr(0b1100100) + '\145' + '\x63' + chr(0b1101111) + '\144' + chr(6902 - 6801))('\165' + '\164' + chr(5612 - 5510) + chr(45) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'!\xc5\xaa\xbe\x0b+\x8a\xf6}y\x81\xc0\xc8\xeb\xae'), chr(0b101010 + 0o72) + chr(0b1111 + 0o126) + chr(0b1100011) + '\x6f' + chr(0b100 + 0o140) + '\145')(chr(4154 - 4037) + chr(6959 - 6843) + chr(102) + chr(0b1 + 0o54) + chr(56))):
pXwvT17vr09s = roI3spqORKae(hXMPsSrOQzbh, yIUGx8mrC542)
if pXwvT17vr09s is not None:
if yIUGx8mrC542 in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xc6\xb0\xbe\x107\x82\xdd'), '\144' + chr(101) + '\x63' + chr(7969 - 7858) + chr(0b1100011 + 0o1) + chr(0b1100101))('\x75' + chr(116) + '\146' + '\x2d' + '\070')):
pXwvT17vr09s = None
else:
pXwvT17vr09s = ifBsn3s1gxxE(pXwvT17vr09s)
if pXwvT17vr09s < nzTpIcepk0o8(chr(0b110000) + chr(739 - 628) + chr(0b1111 + 0o41), 8):
SLVB2BPA_mIe = yIUGx8mrC542.replace(roI3spqORKae(ES5oEprVxulp(b'!'), chr(3223 - 3123) + '\x65' + chr(3084 - 2985) + chr(7624 - 7513) + chr(0b101100 + 0o70) + '\x65')(chr(0b111010 + 0o73) + '\164' + chr(102) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'^'), chr(100) + chr(2012 - 1911) + chr(99) + chr(0b1101111) + chr(2998 - 2898) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(102) + '\055' + chr(0b111000))).strip().capitalize()
raise Hve2rWByk1oX(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\x05\x97\xff\xb9\x02d\x84\xc8cv\x8a\xd0\x81\xe7\xacnre-i\x89D\x13\xd8\xaa\xa3V\x08\xabT\xfd'), '\x64' + chr(0b1100101) + chr(99) + chr(111) + chr(0b100110 + 0o76) + chr(9098 - 8997))(chr(0b1100011 + 0o22) + '\x74' + '\x66' + '\055' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\x0f\x94\xf6\x818w\x81\xc6\\G\xa6\xee'), '\x64' + chr(0b110000 + 0o65) + chr(99) + '\157' + '\x64' + chr(0b11000 + 0o115))(chr(117) + chr(4836 - 4720) + '\x66' + chr(0b101101) + '\070'))(SLVB2BPA_mIe))
lCf1uzpaIUMv(hXMPsSrOQzbh, yIUGx8mrC542, pXwvT17vr09s)
else:
roI3spqORKae(hXMPsSrOQzbh._autoset, roI3spqORKae(ES5oEprVxulp(b'\x0b\x94\x94\xae\x167\xae\xd8I~\xa6\xc0'), chr(1543 - 1443) + chr(0b1100101) + '\143' + chr(4925 - 4814) + chr(7187 - 7087) + chr(0b1001100 + 0o31))(chr(0b1001101 + 0o50) + chr(6675 - 6559) + '\x66' + chr(1455 - 1410) + '\070'))(yIUGx8mrC542)
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xc4\xaa\xb8\x11!\x95\xf6\x7fy\x81\xcd\xd4\xf6'), chr(0b1100100) + '\x65' + chr(4277 - 4178) + chr(0b1101001 + 0o6) + chr(1823 - 1723) + chr(0b1100101))(chr(117) + chr(1278 - 1162) + chr(2742 - 2640) + '\x2d' + chr(56))) < nzTpIcepk0o8('\x30' + '\x6f' + chr(132 - 84), 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'=\xc8\xb7\xa4\x1a6\xc7\xdbl|\x8c\xd1\xd2\xa5\xaa/pn1n\x89R\x1e\x99\xa8\xe6_\x1e\xf9O\xbbG\xa2\x9c!,\x80\xf8\xaf'), '\x64' + chr(5162 - 5061) + '\x63' + chr(0b11101 + 0o122) + chr(9042 - 8942) + chr(101))(chr(0b100001 + 0o124) + '\164' + chr(9083 - 8981) + '\055' + chr(0b11101 + 0o33)))
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xc4\xaa\xb8\x11!\x95\xf6\x7fy\x81\xcd\xd4\xf6'), chr(0b1100100) + chr(7317 - 7216) + chr(2398 - 2299) + chr(0b110111 + 0o70) + chr(2867 - 2767) + chr(101))(chr(117) + chr(116) + chr(10327 - 10225) + chr(290 - 245) + chr(0b101010 + 0o16))) > roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa4\xa8\x1a(\xb8\xded|\x91\xcc'), chr(100) + chr(1544 - 1443) + '\143' + '\x6f' + chr(8553 - 8453) + '\145')(chr(8545 - 8428) + chr(116) + chr(102) + chr(1525 - 1480) + chr(2882 - 2826))) / nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50), 0b1000):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'=\xc8\xb7\xa4\x1a6\xc7\xdbl|\x8c\xd1\xd2\xa5\xaa/pn1n\x89R\x1e\x99\xa9\xec^\x08\xf9O\xbbG\xa2\x9c3(\x9e\xf1\xa1\xc2\x16\xc2\xe5\xa6\x1e&\x82\xc5-o\x8c\xc0\xd5\xed\xe7'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + chr(7271 - 7171) + chr(2202 - 2101))(chr(0b1110101) + chr(9901 - 9785) + '\146' + '\x2d' + chr(0b110011 + 0o5)))
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xc4\xaa\xb8\x11!\x95\xf6\x7fy\x81\xcd\xd4\xf6'), chr(0b1100100) + chr(0b1100101) + chr(0b1011011 + 0o10) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(4523 - 4406) + chr(7657 - 7541) + '\146' + chr(45) + chr(0b110000 + 0o10))) > roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa4\xa8\x1a(\xb8\xc1hq\x82\xcc\xd5'), chr(0b1100100) + chr(5076 - 4975) + chr(9053 - 8954) + '\157' + chr(0b10001 + 0o123) + chr(101))(chr(117) + chr(8143 - 8027) + chr(0b10101 + 0o121) + chr(0b101101) + chr(56))) / nzTpIcepk0o8('\060' + chr(111) + '\062', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'=\xc8\xb7\xa4\x1a6\xc7\xdbl|\x8c\xd1\xd2\xa5\xaa/pn1n\x89R\x1e\x99\xa9\xec^\x08\xf9O\xbbG\xa2\x9c3(\x9e\xf1\xa1\xc2\x16\xc2\xe5\xa6\x1e&\x82\xc5-p\x80\xcd\xc6\xed\xbd`'), chr(0b1100100) + chr(0b11100 + 0o111) + chr(5904 - 5805) + chr(0b1100101 + 0o12) + chr(0b1100100) + chr(0b1100101))(chr(3627 - 3510) + chr(2400 - 2284) + '\146' + '\x2d' + chr(2287 - 2231)))
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa0\xac\x0b\x1b\x97\xc8i|\x8c\xca\xc6'), chr(7645 - 7545) + chr(0b1100101) + chr(4831 - 4732) + '\157' + '\144' + chr(0b101011 + 0o72))('\x75' + chr(0b1110100) + chr(0b1 + 0o145) + chr(0b101101) + chr(56))) + roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd5\xac\xad\x170\xb8\xd9l|\x81\xcd\xcf\xe2'), '\x64' + '\145' + '\143' + chr(0b1101111) + chr(100) + chr(0b1011000 + 0o15))(chr(117) + chr(0b1110100) + chr(0b100101 + 0o101) + chr(0b11001 + 0o24) + chr(56))) + roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd3\xaa\xba 4\x86\xcdiq\x8b\xc3'), chr(4150 - 4050) + chr(5771 - 5670) + chr(411 - 312) + chr(10112 - 10001) + chr(100) + chr(0b1100101))(chr(117) + '\164' + chr(7823 - 7721) + '\x2d' + chr(56))) + roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xc5\xaa\xbe\x0b+\x8a\xf6}y\x81\xc0\xc8\xeb\xae'), chr(100) + '\x65' + chr(0b1001101 + 0o26) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1000 + 0o155) + '\x74' + chr(0b1100110) + chr(0b10001 + 0o34) + chr(0b111000))) == nzTpIcepk0o8(chr(145 - 97) + chr(111) + chr(0b1000 + 0o50), 8):
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd7\xa4\xae\x1b-\x89\xceRj\x84\xc0\xc8\xf0\xba'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(111) + chr(0b1100010 + 0o2) + '\x65')(chr(0b0 + 0o165) + chr(116) + '\146' + '\x2d' + chr(2891 - 2835))) != nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\060', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'.\xc6\xa1\xae\x16*\x80\x89\x7fy\x81\xcd\xd4\xf6\xe9#ks*:\xcbU[\xc3\xa1\xf1CM\xb0]\xf3R\xa4\xd9),\xd2\xfe\xf2\x96\x10\xc8\xe5\xba\x1e \x83\xc0c\x7f\xcb'), chr(0b1011000 + 0o14) + chr(101) + '\x63' + '\157' + chr(100) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(933 - 888) + '\070'))
else:
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa0\xac\x0b\x1b\x97\xc8i|\x8c\xca\xc6'), '\x64' + '\145' + chr(99) + chr(0b1011010 + 0o25) + chr(7144 - 7044) + chr(101))('\x75' + '\x74' + chr(0b1100110) + chr(0b10101 + 0o30) + '\070')) + roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd5\xac\xad\x170\xb8\xd9l|\x81\xcd\xcf\xe2'), chr(1087 - 987) + chr(101) + '\x63' + '\x6f' + '\x64' + '\x65')('\165' + chr(0b101 + 0o157) + chr(0b1100110) + '\x2d' + '\070')) >= roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa4\xa8\x1a(\xb8\xded|\x91\xcc'), chr(0b111100 + 0o50) + chr(0b1011111 + 0o6) + '\143' + chr(111) + chr(100) + chr(0b10101 + 0o120))('\165' + '\164' + chr(2445 - 2343) + chr(0b11110 + 0o17) + chr(886 - 830))):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'-\xd2\xa8\xea\x10"\xc7\xc1bj\x8c\xde\xce\xeb\xbd/r .{\xcdT\x12\xd7\xa3\xa3A\x18\xaaO\xf3D\xa9\x9c7,\x81\xe4\xa1\xc2\x16\xc6\xab\xea\x0b,\x82\x89ay\x87\xc1\xcd\xa5\xbe\'zt64'), chr(7839 - 7739) + chr(0b1100101) + chr(0b1001111 + 0o24) + chr(10938 - 10827) + '\144' + '\x65')('\x75' + chr(10071 - 9955) + chr(102) + chr(808 - 763) + '\070'))
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd3\xaa\xba 4\x86\xcdiq\x8b\xc3'), '\144' + chr(9117 - 9016) + chr(0b1011110 + 0o5) + chr(0b101101 + 0o102) + chr(1820 - 1720) + chr(3465 - 3364))('\x75' + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b111000))) + roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xc5\xaa\xbe\x0b+\x8a\xf6}y\x81\xc0\xc8\xeb\xae'), chr(0b1000001 + 0o43) + chr(0b1100101) + chr(874 - 775) + '\157' + chr(8441 - 8341) + chr(0b1100101))(chr(0b1110101) + '\x74' + chr(0b11101 + 0o111) + chr(0b1111 + 0o36) + '\x38')) >= roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa4\xa8\x1a(\xb8\xc1hq\x82\xcc\xd5'), chr(0b1100100) + chr(0b1100101) + chr(7311 - 7212) + '\x6f' + '\x64' + chr(0b1100101))('\165' + chr(116) + '\146' + chr(721 - 676) + chr(56))):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'-\xd2\xa8\xea\x10"\xc7\xdfhj\x91\xcd\xc2\xe4\xa5nna:~\xc0^\x1c\x99\xa9\xf6_\x19\xf9Y\xb6\x06\xa0\xd9(:\xd2\xe3\xe9\xd7\x10\x87\xb1\xa2\x1ad\x8b\xc8o}\x89\x84\xc9\xe0\xa0)vtp'), chr(100) + '\145' + chr(0b1010010 + 0o21) + chr(0b1001110 + 0o41) + chr(100) + chr(101))('\165' + '\x74' + '\x66' + chr(0b101101) + '\070'))
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd7\xa4\xae\x1b-\x89\xceRj\x84\xc0\xc8\xf0\xba'), chr(100) + chr(0b100001 + 0o104) + '\x63' + '\157' + '\144' + chr(858 - 757))(chr(0b1110101) + chr(2310 - 2194) + chr(0b1100110) + '\x2d' + chr(984 - 928))) < nzTpIcepk0o8(chr(48) + '\x6f' + '\x30', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'.\xc6\xa1\xae\x16*\x80\x89\x7fy\x81\xcd\xd4\xf6\xe9-\x7fn0u\xdd\x10\x19\xdc\xe4\xefI\x1e\xaa\x1b\xa7N\xad\xd2{3\x97\xe5\xee\x98'), chr(0b10010 + 0o122) + chr(0b100111 + 0o76) + '\x63' + chr(111) + chr(0b1100100) + chr(101))('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\070'))
myFvaryeI32O = hXMPsSrOQzbh._sheet_width - hXMPsSrOQzbh._label_width * hXMPsSrOQzbh.Lvom5pv1ARUC
JsmFNpqzi5tp = hXMPsSrOQzbh._sheet_height - hXMPsSrOQzbh._label_height * hXMPsSrOQzbh._rows
if myFvaryeI32O < nzTpIcepk0o8('\x30' + chr(8124 - 8013) + '\060', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'2\xc6\xa7\xaf\x137\xc7\xc8\x7f}\xc5\xd0\xce\xea\xe99wd;:\xdd_[\xdf\xad\xf7\x0c\x02\xb7\x1b\xa7N\xa9\x9c(!\x97\xf2\xf5\x98'), chr(0b101010 + 0o72) + chr(4282 - 4181) + chr(99) + chr(0b1100111 + 0o10) + chr(0b1100100) + chr(0b1100101))(chr(117) + '\x74' + '\x66' + '\x2d' + chr(214 - 158)))
if JsmFNpqzi5tp < nzTpIcepk0o8(chr(48) + '\157' + '\x30', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'2\xc6\xa7\xaf\x137\xc7\xc8\x7f}\xc5\xd0\xce\xea\xe9:\x7fl2:\xdd_[\xdf\xad\xf7\x0c\x02\xb7\x1b\xa7N\xa9\x9c(!\x97\xf2\xf5\x98'), '\144' + '\x65' + chr(0b1100011) + chr(0b1101111) + '\144' + chr(1941 - 1840))(chr(0b1001110 + 0o47) + chr(0b1110100) + chr(5105 - 5003) + chr(1430 - 1385) + chr(0b110101 + 0o3)))
Z78JMExD7FeC = nzTpIcepk0o8('\x30' + '\x6f' + '\061', 23225 - 23217) + hXMPsSrOQzbh.Lvom5pv1ARUC
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa0\xac\x0b\x1b\x8a\xc8\x7f\x7f\x8c\xca'), '\144' + chr(101) + '\143' + chr(111) + chr(100) + chr(101))(chr(117) + chr(8124 - 8008) + '\146' + chr(45) + chr(0b101001 + 0o17))) is not None:
myFvaryeI32O -= hXMPsSrOQzbh._left_margin
if myFvaryeI32O < nzTpIcepk0o8('\060' + chr(11570 - 11459) + '\x30', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'2\xc2\xa3\xbe_)\x86\xdbjq\x8b\x84\xc8\xf6\xe9:qo~m\xc0T\x1e\x99\xa2\xec^M\xadS\xb6\x06\xa0\xdd9,\x9e\xe4\xa1\xc2\x11\x87\xa3\xa3\x0bd\x88\xc7-l\x8d\xc1\x81\xf6\xa1+{tp'), chr(100) + '\x65' + chr(99) + '\157' + chr(100) + '\145')(chr(0b1011110 + 0o27) + chr(0b1011100 + 0o30) + chr(0b1100110) + chr(0b11001 + 0o24) + '\x38'))
Z78JMExD7FeC -= nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(453 - 342) + chr(0b100101 + 0o14), 8)
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xc4\xaa\xa6\n)\x89\xf6jy\x95'), '\144' + '\145' + chr(99) + '\x6f' + chr(0b1001011 + 0o31) + '\145')('\x75' + chr(2043 - 1927) + chr(0b1001001 + 0o35) + chr(0b100000 + 0o15) + '\x38')) is not None:
myFvaryeI32O -= (hXMPsSrOQzbh.Lvom5pv1ARUC - nzTpIcepk0o8(chr(0b110000) + chr(0b10100 + 0o133) + '\x31', 8)) * hXMPsSrOQzbh._column_gap
if myFvaryeI32O < nzTpIcepk0o8('\x30' + '\157' + '\x30', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'=\xc8\xa9\xbf\x12*\xc7\xcelh\xc5\xcd\xd2\xa5\xbd!q )s\xcdU[\xdf\xab\xf1\x0c\x19\xb1^\xf3J\xad\xde>%\x81\xb7\xf5\xd9^\xc1\xac\xbe_+\x89\x89yp\x80\x84\xd2\xed\xac+j.'), '\144' + '\x65' + '\143' + chr(111) + chr(6376 - 6276) + '\145')('\x75' + '\x74' + chr(0b1000001 + 0o45) + '\055' + chr(0b111000)))
Z78JMExD7FeC -= hXMPsSrOQzbh.Lvom5pv1ARUC - nzTpIcepk0o8('\060' + chr(0b11 + 0o154) + chr(49), 8)
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd5\xac\xad\x170\xb8\xc4lj\x82\xcd\xcf'), '\x64' + '\145' + '\x63' + chr(0b1010001 + 0o36) + chr(100) + chr(0b1100101))('\165' + chr(0b1110100) + '\x66' + chr(45) + chr(0b10111 + 0o41))) is not None:
myFvaryeI32O -= hXMPsSrOQzbh._right_margin
if myFvaryeI32O < 0.01 and myFvaryeI32O > -0.01:
hXMPsSrOQzbh.HzAD9KFzc5Bu += myFvaryeI32O
myFvaryeI32O = nzTpIcepk0o8(chr(48) + '\157' + '\x30', 8)
if myFvaryeI32O < nzTpIcepk0o8('\060' + chr(111) + '\x30', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b',\xce\xa2\xa2\x0bd\x8a\xc8\x7f\x7f\x8c\xca\x81\xec\xbanjo1:\xdeY\x1f\xdc\xe4\xe5C\x1f\xf9O\xbbC\xec\xd0:+\x97\xfb\xf2\x96\n\xc8\xe5\xac\x160\xc7\xc6c8\x91\xcc\xc4\xa5\xba&{e*4'), chr(0b10101 + 0o117) + chr(0b1011010 + 0o13) + chr(0b1100011) + chr(0b100001 + 0o116) + chr(100) + chr(101))('\x75' + chr(6650 - 6534) + '\x66' + chr(45) + chr(931 - 875)))
Z78JMExD7FeC -= nzTpIcepk0o8('\x30' + '\157' + '\061', 8)
tZsgBJF3xPKs = nzTpIcepk0o8(chr(2294 - 2246) + chr(0b1101111) + chr(0b110001), 8) + hXMPsSrOQzbh._rows
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd3\xaa\xba )\x86\xdbjq\x8b'), '\x64' + chr(101) + '\143' + chr(1772 - 1661) + chr(0b1100100) + chr(7707 - 7606))('\165' + '\164' + chr(0b1110 + 0o130) + chr(0b101101) + '\x38')) is not None:
JsmFNpqzi5tp -= hXMPsSrOQzbh._top_margin
if JsmFNpqzi5tp < nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110000), 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'*\xc8\xb5\xea\x12%\x95\xcedv\xc5\xcd\xd2\xa5\xbd!q *{\xc5\\[\xdf\xab\xf1\x0c\x19\xb1^\xf3J\xad\xde>%\x81\xb7\xf5\xd9^\xc1\xac\xbe_+\x89\x89yp\x80\x84\xd2\xed\xac+j.'), chr(0b1100100) + chr(393 - 292) + chr(0b1100011) + chr(0b111 + 0o150) + '\144' + chr(0b1001000 + 0o35))('\x75' + chr(116) + chr(731 - 629) + chr(45) + chr(1635 - 1579)))
tZsgBJF3xPKs -= nzTpIcepk0o8(chr(48) + '\x6f' + chr(1236 - 1187), 8)
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xd5\xaa\xbd #\x86\xd9'), chr(100) + chr(0b1011011 + 0o12) + chr(2728 - 2629) + chr(111) + '\144' + chr(0b101011 + 0o72))('\x75' + chr(0b1110100) + '\146' + '\055' + chr(0b110110 + 0o2))) is not None:
JsmFNpqzi5tp -= (hXMPsSrOQzbh._rows - nzTpIcepk0o8('\x30' + '\157' + '\061', 8)) * hXMPsSrOQzbh._row_gap
if JsmFNpqzi5tp < nzTpIcepk0o8('\x30' + chr(0b111000 + 0o67) + '\x30', 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b',\xc8\xb2\xea\x18%\x97\x89dk\xc5\xd0\xce\xea\xe9:\x7fl2:\xcf_\t\x99\xb0\xebIM\xb5Z\xb1C\xa0\xcf{=\x9d\xb7\xe7\xdf\n\x87\xaa\xa4_0\x8f\xcc-k\x8d\xc1\xc4\xf1\xe7'), '\x64' + chr(0b1011011 + 0o12) + '\x63' + chr(111) + chr(100) + chr(331 - 230))('\165' + '\164' + '\x66' + '\055' + chr(0b100000 + 0o30)))
tZsgBJF3xPKs -= hXMPsSrOQzbh._rows - nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b100111 + 0o12), 8)
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'!\xc5\xaa\xbe\x0b+\x8a\xf6`y\x97\xc3\xc8\xeb'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\144' + chr(0b1010001 + 0o24))(chr(117) + '\x74' + '\x66' + '\x2d' + chr(56))) is not None:
JsmFNpqzi5tp -= hXMPsSrOQzbh._bottom_margin
if JsmFNpqzi5tp < 0.01 and JsmFNpqzi5tp > -0.01:
hXMPsSrOQzbh.DVau3XISkCN0 += JsmFNpqzi5tp
JsmFNpqzi5tp = nzTpIcepk0o8('\x30' + '\x6f' + chr(1470 - 1422), 8)
if JsmFNpqzi5tp < nzTpIcepk0o8(chr(0b110000) + chr(0b101100 + 0o103) + chr(0b110000), 8):
raise Hve2rWByk1oX(roI3spqORKae(ES5oEprVxulp(b'<\xc8\xb1\xbe\x10)\xc7\xc4lj\x82\xcd\xcf\xa5\xa0=>t1u\x89D\x1a\xd5\xa8\xa3J\x02\xab\x1b\xa7N\xa9\x9c7(\x90\xf2\xed\xc5^\xd3\xaa\xea\x19-\x93\x89bv\xc5\xd0\xc9\xe0\xe9=ve;n\x87'), chr(100) + chr(0b1100010 + 0o3) + '\x63' + '\x6f' + chr(8563 - 8463) + chr(8401 - 8300))('\x75' + chr(116) + '\x66' + chr(0b11011 + 0o22) + '\070'))
tZsgBJF3xPKs -= nzTpIcepk0o8(chr(48) + chr(439 - 328) + '\x31', 8)
if Z78JMExD7FeC == nzTpIcepk0o8(chr(48) + chr(1042 - 931) + '\060', 8) and myFvaryeI32O != nzTpIcepk0o8('\x30' + chr(0b111010 + 0o65) + '\x30', 8):
raise Hve2rWByk1oX(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'0\xc8\xb1\xea\x1e(\x8b\x89zq\x81\xd0\xc9\xa5\xbc={d~x\xd0\x10\x16\xd8\xaa\xf6M\x01\xb5B\xf3U\xbc\xd98 \x94\xfe\xe4\xd2^\xca\xa4\xb8\x18-\x89\xda"\x7f\x84\xd4\xd2\xbe\xe95cm3:\xc5U\x1d\xcd\xea'), chr(0b1100100) + '\145' + '\x63' + chr(0b10 + 0o155) + chr(0b1100100) + chr(0b110101 + 0o60))(chr(409 - 292) + '\x74' + chr(102) + '\055' + chr(0b101110 + 0o12)), roI3spqORKae(ES5oEprVxulp(b'\x0f\x94\xf6\x818w\x81\xc6\\G\xa6\xee'), chr(0b11101 + 0o107) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b10000 + 0o124) + chr(101))('\x75' + '\164' + '\x66' + chr(0b100111 + 0o6) + chr(0b11010 + 0o36)))(myFvaryeI32O))
if tZsgBJF3xPKs == nzTpIcepk0o8(chr(48) + chr(111) + chr(48), 8) and JsmFNpqzi5tp != nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(7837 - 7726) + chr(48), 8):
raise Hve2rWByk1oX(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'0\xc8\xb1\xea\x1e(\x8b\x89e}\x8c\xc3\xc9\xf1\xe9;me::\xcbI[\xd4\xa5\xedY\x0c\xb5W\xaa\x06\xbf\xcc>*\x9b\xf1\xe8\xd3\x1a\x87\xa8\xab\r#\x8e\xc7~7\x82\xc5\xd1\xf6\xf2ne}3w\x89\\\x1e\xdf\xb0\xad'), chr(0b1100010 + 0o2) + chr(5030 - 4929) + chr(99) + chr(153 - 42) + chr(0b1100100) + chr(5687 - 5586))(chr(8762 - 8645) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(584 - 528)), roI3spqORKae(ES5oEprVxulp(b'\x0f\x94\xf6\x818w\x81\xc6\\G\xa6\xee'), '\x64' + '\x65' + chr(5866 - 5767) + '\157' + '\144' + chr(101))(chr(1672 - 1555) + chr(3464 - 3348) + chr(102) + chr(1713 - 1668) + '\x38'))(JsmFNpqzi5tp))
if Z78JMExD7FeC:
UxLctaOSWKWk = myFvaryeI32O / Z78JMExD7FeC
for yIUGx8mrC542 in (roI3spqORKae(ES5oEprVxulp(b'!\xcb\xa0\xac\x0b\x1b\x8a\xc8\x7f\x7f\x8c\xca'), chr(3893 - 3793) + chr(0b100101 + 0o100) + chr(0b1000 + 0o133) + '\x6f' + chr(100) + chr(0b1100101))('\165' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(2115 - 2059)), roI3spqORKae(ES5oEprVxulp(b'!\xc4\xaa\xa6\n)\x89\xf6jy\x95'), chr(0b11110 + 0o106) + '\x65' + chr(0b1100011) + chr(111) + '\x64' + chr(101))(chr(0b1001010 + 0o53) + '\x74' + chr(102) + '\055' + chr(292 - 236)), roI3spqORKae(ES5oEprVxulp(b'!\xd5\xac\xad\x170\xb8\xc4lj\x82\xcd\xcf'), chr(100) + '\x65' + chr(0b1100011) + chr(4125 - 4014) + chr(8721 - 8621) + chr(101))(chr(12834 - 12717) + '\164' + chr(0b110110 + 0o60) + '\055' + chr(56))):
if roI3spqORKae(hXMPsSrOQzbh, yIUGx8mrC542) is None:
lCf1uzpaIUMv(hXMPsSrOQzbh, yIUGx8mrC542, UxLctaOSWKWk)
if tZsgBJF3xPKs:
UxLctaOSWKWk = JsmFNpqzi5tp / tZsgBJF3xPKs
for yIUGx8mrC542 in (roI3spqORKae(ES5oEprVxulp(b'!\xd3\xaa\xba )\x86\xdbjq\x8b'), chr(0b1100100) + chr(4000 - 3899) + chr(0b1100011) + '\x6f' + chr(8815 - 8715) + chr(933 - 832))(chr(0b1110101) + chr(116) + '\146' + chr(0b101101) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'!\xd5\xaa\xbd #\x86\xd9'), chr(100) + chr(0b11000 + 0o115) + chr(3957 - 3858) + '\x6f' + chr(100) + chr(0b1100101))('\165' + '\x74' + '\x66' + '\x2d' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'!\xc5\xaa\xbe\x0b+\x8a\xf6`y\x97\xc3\xc8\xeb'), '\x64' + chr(0b1100101) + '\143' + chr(0b110010 + 0o75) + chr(100) + chr(0b101111 + 0o66))(chr(0b1100001 + 0o24) + chr(0b1110100) + chr(102) + '\055' + '\x38')):
if roI3spqORKae(hXMPsSrOQzbh, yIUGx8mrC542) is None:
lCf1uzpaIUMv(hXMPsSrOQzbh, yIUGx8mrC542, UxLctaOSWKWk)
|
bcbnz/pylabels
|
labels/specifications.py
|
Specification.bounding_boxes
|
def bounding_boxes(self, mode='fraction', output='dict'):
"""Get the bounding boxes of the labels on a page.
Parameters
----------
mode: 'fraction', 'actual'
If 'fraction', the bounding boxes are expressed as a fraction of the
height and width of the sheet. If 'actual', they are the actual
position of the labels in millimetres from the top-left of the
sheet.
output: 'dict', 'json'
If 'dict', a dictionary with label identifier tuples (row, column)
as keys and a dictionary with 'left', 'right', 'top', and 'bottom'
entries as the values.
If 'json', a JSON encoded string which represents a dictionary with
keys of the string format 'rowxcolumn' and each value being a
bounding box dictionary with 'left', 'right', 'top', and 'bottom'
entries.
Returns
-------
The bounding boxes in the format set by the output parameter.
"""
boxes = {}
# Check the parameters.
if mode not in ('fraction', 'actual'):
raise ValueError("Unknown mode {0}.".format(mode))
if output not in ('dict', 'json'):
raise ValueError("Unknown output {0}.".format(output))
# Iterate over the rows.
for row in range(1, self.rows + 1):
# Top and bottom of all labels in the row.
top = self.top_margin + ((row - 1) * (self.label_height + self.row_gap))
bottom = top + self.label_height
# Now iterate over all columns in this row.
for column in range(1, self.columns + 1):
# Left and right position of this column.
left = self.left_margin + ((column - 1) * (self.label_width + self.column_gap))
right = left + self.label_width
# Output in the appropriate mode format.
if mode == 'fraction':
box = {
'top': top / self.sheet_height,
'bottom': bottom / self.sheet_height,
'left': left / self.sheet_width,
'right': right / self.sheet_width,
}
elif mode == 'actual':
box = {'top': top, 'bottom': bottom, 'left': left, 'right': right}
# Add to the collection.
if output == 'json':
boxes['{0:d}x{1:d}'.format(row, column)] = box
box['top'] = float(box['top'])
box['bottom'] = float(box['bottom'])
box['left'] = float(box['left'])
box['right'] = float(box['right'])
else:
boxes[(row, column)] = box
# Done.
if output == 'json':
return json.dumps(boxes)
return boxes
|
python
|
def bounding_boxes(self, mode='fraction', output='dict'):
"""Get the bounding boxes of the labels on a page.
Parameters
----------
mode: 'fraction', 'actual'
If 'fraction', the bounding boxes are expressed as a fraction of the
height and width of the sheet. If 'actual', they are the actual
position of the labels in millimetres from the top-left of the
sheet.
output: 'dict', 'json'
If 'dict', a dictionary with label identifier tuples (row, column)
as keys and a dictionary with 'left', 'right', 'top', and 'bottom'
entries as the values.
If 'json', a JSON encoded string which represents a dictionary with
keys of the string format 'rowxcolumn' and each value being a
bounding box dictionary with 'left', 'right', 'top', and 'bottom'
entries.
Returns
-------
The bounding boxes in the format set by the output parameter.
"""
boxes = {}
# Check the parameters.
if mode not in ('fraction', 'actual'):
raise ValueError("Unknown mode {0}.".format(mode))
if output not in ('dict', 'json'):
raise ValueError("Unknown output {0}.".format(output))
# Iterate over the rows.
for row in range(1, self.rows + 1):
# Top and bottom of all labels in the row.
top = self.top_margin + ((row - 1) * (self.label_height + self.row_gap))
bottom = top + self.label_height
# Now iterate over all columns in this row.
for column in range(1, self.columns + 1):
# Left and right position of this column.
left = self.left_margin + ((column - 1) * (self.label_width + self.column_gap))
right = left + self.label_width
# Output in the appropriate mode format.
if mode == 'fraction':
box = {
'top': top / self.sheet_height,
'bottom': bottom / self.sheet_height,
'left': left / self.sheet_width,
'right': right / self.sheet_width,
}
elif mode == 'actual':
box = {'top': top, 'bottom': bottom, 'left': left, 'right': right}
# Add to the collection.
if output == 'json':
boxes['{0:d}x{1:d}'.format(row, column)] = box
box['top'] = float(box['top'])
box['bottom'] = float(box['bottom'])
box['left'] = float(box['left'])
box['right'] = float(box['right'])
else:
boxes[(row, column)] = box
# Done.
if output == 'json':
return json.dumps(boxes)
return boxes
|
[
"def",
"bounding_boxes",
"(",
"self",
",",
"mode",
"=",
"'fraction'",
",",
"output",
"=",
"'dict'",
")",
":",
"boxes",
"=",
"{",
"}",
"# Check the parameters.",
"if",
"mode",
"not",
"in",
"(",
"'fraction'",
",",
"'actual'",
")",
":",
"raise",
"ValueError",
"(",
"\"Unknown mode {0}.\"",
".",
"format",
"(",
"mode",
")",
")",
"if",
"output",
"not",
"in",
"(",
"'dict'",
",",
"'json'",
")",
":",
"raise",
"ValueError",
"(",
"\"Unknown output {0}.\"",
".",
"format",
"(",
"output",
")",
")",
"# Iterate over the rows.",
"for",
"row",
"in",
"range",
"(",
"1",
",",
"self",
".",
"rows",
"+",
"1",
")",
":",
"# Top and bottom of all labels in the row.",
"top",
"=",
"self",
".",
"top_margin",
"+",
"(",
"(",
"row",
"-",
"1",
")",
"*",
"(",
"self",
".",
"label_height",
"+",
"self",
".",
"row_gap",
")",
")",
"bottom",
"=",
"top",
"+",
"self",
".",
"label_height",
"# Now iterate over all columns in this row.",
"for",
"column",
"in",
"range",
"(",
"1",
",",
"self",
".",
"columns",
"+",
"1",
")",
":",
"# Left and right position of this column.",
"left",
"=",
"self",
".",
"left_margin",
"+",
"(",
"(",
"column",
"-",
"1",
")",
"*",
"(",
"self",
".",
"label_width",
"+",
"self",
".",
"column_gap",
")",
")",
"right",
"=",
"left",
"+",
"self",
".",
"label_width",
"# Output in the appropriate mode format.",
"if",
"mode",
"==",
"'fraction'",
":",
"box",
"=",
"{",
"'top'",
":",
"top",
"/",
"self",
".",
"sheet_height",
",",
"'bottom'",
":",
"bottom",
"/",
"self",
".",
"sheet_height",
",",
"'left'",
":",
"left",
"/",
"self",
".",
"sheet_width",
",",
"'right'",
":",
"right",
"/",
"self",
".",
"sheet_width",
",",
"}",
"elif",
"mode",
"==",
"'actual'",
":",
"box",
"=",
"{",
"'top'",
":",
"top",
",",
"'bottom'",
":",
"bottom",
",",
"'left'",
":",
"left",
",",
"'right'",
":",
"right",
"}",
"# Add to the collection.",
"if",
"output",
"==",
"'json'",
":",
"boxes",
"[",
"'{0:d}x{1:d}'",
".",
"format",
"(",
"row",
",",
"column",
")",
"]",
"=",
"box",
"box",
"[",
"'top'",
"]",
"=",
"float",
"(",
"box",
"[",
"'top'",
"]",
")",
"box",
"[",
"'bottom'",
"]",
"=",
"float",
"(",
"box",
"[",
"'bottom'",
"]",
")",
"box",
"[",
"'left'",
"]",
"=",
"float",
"(",
"box",
"[",
"'left'",
"]",
")",
"box",
"[",
"'right'",
"]",
"=",
"float",
"(",
"box",
"[",
"'right'",
"]",
")",
"else",
":",
"boxes",
"[",
"(",
"row",
",",
"column",
")",
"]",
"=",
"box",
"# Done.",
"if",
"output",
"==",
"'json'",
":",
"return",
"json",
".",
"dumps",
"(",
"boxes",
")",
"return",
"boxes"
] |
Get the bounding boxes of the labels on a page.
Parameters
----------
mode: 'fraction', 'actual'
If 'fraction', the bounding boxes are expressed as a fraction of the
height and width of the sheet. If 'actual', they are the actual
position of the labels in millimetres from the top-left of the
sheet.
output: 'dict', 'json'
If 'dict', a dictionary with label identifier tuples (row, column)
as keys and a dictionary with 'left', 'right', 'top', and 'bottom'
entries as the values.
If 'json', a JSON encoded string which represents a dictionary with
keys of the string format 'rowxcolumn' and each value being a
bounding box dictionary with 'left', 'right', 'top', and 'bottom'
entries.
Returns
-------
The bounding boxes in the format set by the output parameter.
|
[
"Get",
"the",
"bounding",
"boxes",
"of",
"the",
"labels",
"on",
"a",
"page",
"."
] |
ecdb4ca48061d8f1dc0fcfe2d55ce2b89e0e5ec6
|
https://github.com/bcbnz/pylabels/blob/ecdb4ca48061d8f1dc0fcfe2d55ce2b89e0e5ec6/labels/specifications.py#L257-L325
|
train
|
Return the bounding boxes of the labels on a page.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knU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7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\x6f' + chr(50) + '\x33' + '\x36', 33481 - 33473), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(7031 - 6920) + '\062' + chr(53) + chr(572 - 522), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b100001 + 0o22) + chr(0b110101) + chr(766 - 718), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\x31' + '\063' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(557 - 503) + chr(1653 - 1605), 47950 - 47942), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1010 - 961) + chr(55) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + '\x31' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(946 - 898) + chr(0b1101111) + chr(0b100001 + 0o20) + chr(2259 - 2209), 6223 - 6215), nzTpIcepk0o8('\x30' + chr(1936 - 1825) + '\x33' + '\x35' + chr(54), 0b1000), nzTpIcepk0o8(chr(0b111 + 0o51) + '\x6f' + chr(0b110010) + '\062' + '\x31', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(0b101010 + 0o13) + '\063', 13541 - 13533), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\x6f' + chr(50) + chr(2277 - 2229) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(48) + chr(8027 - 7916) + '\x33' + chr(53) + chr(1710 - 1661), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b11001 + 0o31) + chr(1673 - 1618) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\x6f' + chr(346 - 294) + chr(50), 0o10), nzTpIcepk0o8(chr(1058 - 1010) + '\x6f' + chr(50) + '\x33', 10477 - 10469), nzTpIcepk0o8('\x30' + '\157' + chr(0b10010 + 0o45) + chr(0b110111), 0o10), nzTpIcepk0o8('\060' + chr(0b10100 + 0o133) + '\065' + chr(2099 - 2045), 15395 - 15387), nzTpIcepk0o8('\060' + chr(3825 - 3714) + chr(0b110110) + '\x30', 8), nzTpIcepk0o8('\x30' + '\x6f' + chr(1793 - 1742) + chr(0b110100) + chr(0b110110), 42047 - 42039), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b1101111) + chr(0b110001) + chr(50) + chr(0b110110), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(1318 - 1270) + chr(0b110101), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(0b110110) + '\066', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(864 - 813) + '\x32' + chr(1553 - 1503), 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(111) + '\x33' + chr(52) + chr(2415 - 2360), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011) + chr(0b1111 + 0o50) + chr(0b100010 + 0o16), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + chr(0b110001) + chr(1720 - 1665), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b100101 + 0o14) + '\x30' + chr(0b110001), 0o10), nzTpIcepk0o8('\060' + '\157' + '\061' + '\x31' + chr(0b110100 + 0o3), 8), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(52) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(1472 - 1424) + chr(0b1101111) + chr(1035 - 985) + '\x31' + '\x35', 57604 - 57596), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(52) + chr(2512 - 2460), 0b1000), nzTpIcepk0o8('\x30' + chr(0b100101 + 0o112) + '\061' + '\x30' + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10001 + 0o42) + chr(54) + chr(53), 5677 - 5669), nzTpIcepk0o8('\060' + '\157' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\x6f' + chr(0b110001) + chr(49) + chr(0b11111 + 0o23), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b10110 + 0o32) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(1625 - 1570), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b101010 + 0o105) + '\x31', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10011 + 0o37) + chr(0b110111) + chr(0b101100 + 0o11), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(173 - 125) + chr(111) + '\065' + '\x30', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb0'), '\144' + chr(0b1100101) + chr(0b1000110 + 0o35) + chr(7260 - 7149) + chr(0b1100100) + chr(0b1000101 + 0o40))(chr(117) + chr(116) + chr(0b1101 + 0o131) + chr(0b1100 + 0o41) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def HnxwQEheulyb(hXMPsSrOQzbh, bmJ7SvuZE3jD=roI3spqORKae(ES5oEprVxulp(b'\xf8\xd8\x899D\x17\xe6d'), '\x64' + chr(101) + '\x63' + chr(4563 - 4452) + '\x64' + '\x65')(chr(117) + chr(0b1110100) + chr(6047 - 5945) + chr(45) + chr(345 - 289)), toKQXlEvBKaK=roI3spqORKae(ES5oEprVxulp(b'\xfa\xc3\x8b.'), '\144' + chr(0b1100101) + chr(99) + chr(111) + chr(0b11000 + 0o114) + chr(101))('\165' + '\164' + chr(102) + chr(1214 - 1169) + '\070')):
kwrQ0zIb6dfM = {}
if bmJ7SvuZE3jD not in (roI3spqORKae(ES5oEprVxulp(b'\xf8\xd8\x899D\x17\xe6d'), chr(0b1100100) + chr(0b1001100 + 0o31) + '\x63' + chr(0b1101111) + chr(6453 - 6353) + chr(0b110101 + 0o60))('\x75' + '\164' + chr(6137 - 6035) + chr(45) + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xff\xc9\x9c/Q\x12'), chr(2799 - 2699) + chr(0b1100101) + '\143' + chr(11983 - 11872) + chr(100) + chr(1715 - 1614))(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b100001 + 0o27))):
raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xcb\xc4\x834_\t\xe7*\x83\xfe\x8f\xe4\xc9\xc3\x12n\x11'), chr(0b1100100) + '\145' + '\143' + chr(12171 - 12060) + '\144' + chr(4051 - 3950))('\x75' + '\x74' + chr(102) + '\055' + chr(0b1 + 0o67)), roI3spqORKae(ES5oEprVxulp(b'\xef\x99\xdb\x11wM\xefe\xbf\xce\xa8\xcb'), chr(100) + chr(101) + '\x63' + chr(2148 - 2037) + '\144' + chr(4082 - 3981))('\x75' + chr(116) + chr(0b1000011 + 0o43) + chr(1386 - 1341) + chr(2918 - 2862)))(bmJ7SvuZE3jD))
if toKQXlEvBKaK not in (roI3spqORKae(ES5oEprVxulp(b'\xfa\xc3\x8b.'), chr(100) + chr(8697 - 8596) + '\x63' + chr(0b1101001 + 0o6) + chr(0b110110 + 0o56) + chr(0b1100000 + 0o5))(chr(0b1110101) + chr(116) + '\146' + chr(0b101101) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\xf4\xd9\x874'), '\x64' + chr(3677 - 3576) + chr(0b1100011) + chr(0b1101111 + 0o0) + '\144' + '\145')(chr(9798 - 9681) + chr(116) + chr(0b1111 + 0o127) + chr(1204 - 1159) + chr(56))):
raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xcb\xc4\x834_\t\xe7*\x81\xe4\x9f\xf1\x9c\xcc\x02h\x0fS\x1e'), chr(0b1111 + 0o125) + '\145' + chr(0b1001100 + 0o27) + chr(10938 - 10827) + chr(0b10011 + 0o121) + chr(0b1000001 + 0o44))('\x75' + chr(0b1001010 + 0o52) + chr(0b1100110) + chr(0b101101) + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xef\x99\xdb\x11wM\xefe\xbf\xce\xa8\xcb'), chr(0b1100100) + chr(0b1100101) + '\x63' + '\x6f' + '\x64' + chr(101))(chr(0b100011 + 0o122) + '\164' + chr(9943 - 9841) + '\x2d' + '\070'))(toKQXlEvBKaK))
for o6UWUO21mH25 in bbT2xIe5pzk7(nzTpIcepk0o8(chr(48) + '\x6f' + chr(100 - 51), 8), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xdf\xff\xbf\x05s4\xc3@\xb6\xda\x80\xe0'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b11100 + 0o123) + '\144' + '\145')(chr(0b1110101) + '\164' + '\x66' + chr(0b1100 + 0o41) + '\070')) + nzTpIcepk0o8(chr(0b10 + 0o56) + '\157' + chr(0b110001), 8)):
A2AC7Zsqx_Vf = hXMPsSrOQzbh.top_margin + (o6UWUO21mH25 - nzTpIcepk0o8('\060' + '\x6f' + '\061', 8)) * (hXMPsSrOQzbh.label_height + hXMPsSrOQzbh.row_gap)
Zmw_d4O1meq7 = A2AC7Zsqx_Vf + hXMPsSrOQzbh.label_height
for KBggEttLg7_8 in bbT2xIe5pzk7(nzTpIcepk0o8('\x30' + '\157' + chr(2065 - 2016), 8), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcb\x99\xd10c\x17\xc0?\xda\xdc\x87\xf1'), '\144' + chr(0b1100101) + chr(1956 - 1857) + '\x6f' + chr(100) + '\145')('\165' + chr(0b1110100) + '\x66' + chr(389 - 344) + '\070')) + nzTpIcepk0o8(chr(0b100111 + 0o11) + '\x6f' + chr(0b110001), 8)):
ZJRgJr1hTjIz = hXMPsSrOQzbh.left_margin + (KBggEttLg7_8 - nzTpIcepk0o8('\060' + chr(0b1000100 + 0o53) + chr(49), 8)) * (hXMPsSrOQzbh.label_width + hXMPsSrOQzbh.column_gap)
HDutv6NlG_yf = ZJRgJr1hTjIz + hXMPsSrOQzbh.label_width
if bmJ7SvuZE3jD == roI3spqORKae(ES5oEprVxulp(b'\xf8\xd8\x899D\x17\xe6d'), chr(1643 - 1543) + chr(0b1100101) + chr(0b1100011) + chr(0b101010 + 0o105) + chr(0b1100100) + '\145')(chr(11385 - 11268) + '\x74' + '\146' + chr(45) + chr(0b111000)):
zCpo5MKsMnlF = {roI3spqORKae(ES5oEprVxulp(b'\xea\xc5\x98'), chr(100) + chr(0b1100101) + chr(3610 - 3511) + chr(0b110 + 0o151) + chr(0b1100100) + '\145')(chr(0b1000010 + 0o63) + chr(116) + chr(0b111000 + 0o56) + '\055' + '\x38'): A2AC7Zsqx_Vf / hXMPsSrOQzbh.sheet_height, roI3spqORKae(ES5oEprVxulp(b'\xfc\xc5\x9c._\x13'), chr(100) + '\145' + chr(9492 - 9393) + chr(111) + chr(0b1100100) + chr(0b1100010 + 0o3))(chr(117) + '\x74' + chr(0b10010 + 0o124) + chr(45) + '\070'): Zmw_d4O1meq7 / hXMPsSrOQzbh.sheet_height, roI3spqORKae(ES5oEprVxulp(b'\xf2\xcf\x8e.'), chr(6467 - 6367) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(101))(chr(1709 - 1592) + chr(0b101100 + 0o110) + chr(8602 - 8500) + chr(45) + chr(0b111000)): ZJRgJr1hTjIz / hXMPsSrOQzbh.sheet_width, roI3spqORKae(ES5oEprVxulp(b'\xec\xc3\x8f2D'), chr(0b10100 + 0o120) + chr(0b1100101) + chr(0b1000110 + 0o35) + '\x6f' + chr(736 - 636) + chr(5820 - 5719))('\165' + chr(116) + '\146' + '\x2d' + chr(0b111000)): HDutv6NlG_yf / hXMPsSrOQzbh.sheet_width}
elif bmJ7SvuZE3jD == roI3spqORKae(ES5oEprVxulp(b'\xff\xc9\x9c/Q\x12'), '\144' + chr(0b1010010 + 0o23) + chr(2924 - 2825) + '\157' + '\144' + chr(0b1100101))('\165' + '\164' + chr(0b1100110) + chr(1951 - 1906) + '\x38'):
zCpo5MKsMnlF = {roI3spqORKae(ES5oEprVxulp(b'\xea\xc5\x98'), chr(0b1100100) + '\145' + chr(99) + chr(111) + chr(100) + chr(101))('\x75' + '\164' + chr(4215 - 4113) + chr(45) + '\070'): A2AC7Zsqx_Vf, roI3spqORKae(ES5oEprVxulp(b'\xfc\xc5\x9c._\x13'), '\144' + chr(101) + '\x63' + chr(5278 - 5167) + chr(0b1001110 + 0o26) + '\145')(chr(0b1110000 + 0o5) + chr(116) + chr(102) + chr(0b101101) + '\x38'): Zmw_d4O1meq7, roI3spqORKae(ES5oEprVxulp(b'\xf2\xcf\x8e.'), chr(0b1000010 + 0o42) + chr(0b110 + 0o137) + chr(99) + '\x6f' + chr(100) + chr(3164 - 3063))(chr(1241 - 1124) + chr(0b1110100) + chr(0b11110 + 0o110) + chr(45) + '\070'): ZJRgJr1hTjIz, roI3spqORKae(ES5oEprVxulp(b'\xec\xc3\x8f2D'), chr(8897 - 8797) + '\145' + chr(99) + '\x6f' + '\144' + '\145')('\x75' + '\x74' + chr(0b1100110) + chr(0b11100 + 0o21) + '\x38'): HDutv6NlG_yf}
if toKQXlEvBKaK == roI3spqORKae(ES5oEprVxulp(b'\xf4\xd9\x874'), chr(0b1100100) + chr(0b1001 + 0o134) + '\x63' + chr(0b1100110 + 0o11) + '\x64' + chr(0b1100101))(chr(11136 - 11019) + '\x74' + chr(0b0 + 0o146) + chr(0b101101) + chr(56)):
kwrQ0zIb6dfM[roI3spqORKae(ES5oEprVxulp(b'\xe5\x9a\xd2>M\x06\xf2;\xd4\xf5\x96'), chr(9845 - 9745) + chr(0b1001111 + 0o26) + chr(99) + chr(0b1101111) + chr(0b100001 + 0o103) + chr(4302 - 4201))('\x75' + chr(116) + '\x66' + '\x2d' + '\070').q33KG3foQ_CJ(o6UWUO21mH25, KBggEttLg7_8)] = zCpo5MKsMnlF
zCpo5MKsMnlF[roI3spqORKae(ES5oEprVxulp(b'\xea\xc5\x98'), chr(0b1100100) + '\x65' + chr(99) + chr(0b111111 + 0o60) + chr(100) + chr(0b11101 + 0o110))(chr(0b1110101) + '\164' + chr(0b11010 + 0o114) + '\055' + chr(174 - 118))] = jLW6pRf2DSRk(zCpo5MKsMnlF[roI3spqORKae(ES5oEprVxulp(b'\xea\xc5\x98'), '\x64' + chr(5768 - 5667) + chr(0b1100011) + '\x6f' + chr(0b1100100) + '\x65')(chr(0b10111 + 0o136) + '\x74' + chr(102) + '\x2d' + '\070')])
zCpo5MKsMnlF[roI3spqORKae(ES5oEprVxulp(b'\xfc\xc5\x9c._\x13'), '\144' + chr(0b1100101) + chr(0b10101 + 0o116) + chr(0b101000 + 0o107) + chr(100) + chr(3753 - 3652))(chr(117) + chr(116) + chr(7230 - 7128) + chr(45) + chr(2771 - 2715))] = jLW6pRf2DSRk(zCpo5MKsMnlF[roI3spqORKae(ES5oEprVxulp(b'\xfc\xc5\x9c._\x13'), '\144' + chr(821 - 720) + chr(99) + chr(111) + '\x64' + '\x65')(chr(0b1101101 + 0o10) + chr(2335 - 2219) + chr(4179 - 4077) + chr(0b101101) + chr(0b110 + 0o62))])
zCpo5MKsMnlF[roI3spqORKae(ES5oEprVxulp(b'\xf2\xcf\x8e.'), '\144' + chr(101) + chr(0b1100011) + chr(0b110011 + 0o74) + '\x64' + '\x65')('\165' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(63 - 7))] = jLW6pRf2DSRk(zCpo5MKsMnlF[roI3spqORKae(ES5oEprVxulp(b'\xf2\xcf\x8e.'), '\x64' + '\x65' + chr(0b1000011 + 0o40) + chr(0b1101111) + chr(0b1100100) + chr(0b110 + 0o137))(chr(10956 - 10839) + '\x74' + chr(4715 - 4613) + chr(0b100101 + 0o10) + '\x38')])
zCpo5MKsMnlF[roI3spqORKae(ES5oEprVxulp(b'\xec\xc3\x8f2D'), '\144' + chr(617 - 516) + '\x63' + chr(111) + chr(0b1100100) + chr(0b11001 + 0o114))(chr(0b1110101) + '\164' + '\x66' + '\055' + chr(0b111000))] = jLW6pRf2DSRk(zCpo5MKsMnlF[roI3spqORKae(ES5oEprVxulp(b'\xec\xc3\x8f2D'), '\144' + '\x65' + '\x63' + '\x6f' + '\144' + chr(0b1100101))(chr(5108 - 4991) + chr(116) + '\146' + '\x2d' + chr(0b111000))])
else:
kwrQ0zIb6dfM[o6UWUO21mH25, KBggEttLg7_8] = zCpo5MKsMnlF
if toKQXlEvBKaK == roI3spqORKae(ES5oEprVxulp(b'\xf4\xd9\x874'), chr(0b11000 + 0o114) + chr(0b10110 + 0o117) + chr(99) + '\157' + chr(5611 - 5511) + '\145')(chr(0b1000110 + 0o57) + chr(4746 - 4630) + '\x66' + chr(0b100110 + 0o7) + '\x38'):
return roI3spqORKae(LNUKEwZDIbyb, roI3spqORKae(ES5oEprVxulp(b'\xc4\xc0\x8f6]\x13\xb1\x7f\x8b\xff\x80\xc2'), chr(0b1100100) + '\145' + chr(0b1100011) + '\x6f' + chr(0b1010011 + 0o21) + '\145')('\x75' + '\164' + chr(0b1100110) + chr(45) + '\x38'))(kwrQ0zIb6dfM)
return kwrQ0zIb6dfM
|
estnltk/estnltk
|
estnltk/wiki/parser.py
|
templatesCollector
|
def templatesCollector(text, open, close):
"""leaves related articles and wikitables in place"""
others = []
spans = [i for i in findBalanced(text, open, close)]
spanscopy = copy(spans)
for i in range(len(spans)):
start, end = spans[i]
o = text[start:end]
ol = o.lower()
if 'vaata|' in ol or 'wikitable' in ol:
spanscopy.remove(spans[i])
continue
others.append(o)
text = dropSpans(spanscopy, text)
return text, others
|
python
|
def templatesCollector(text, open, close):
"""leaves related articles and wikitables in place"""
others = []
spans = [i for i in findBalanced(text, open, close)]
spanscopy = copy(spans)
for i in range(len(spans)):
start, end = spans[i]
o = text[start:end]
ol = o.lower()
if 'vaata|' in ol or 'wikitable' in ol:
spanscopy.remove(spans[i])
continue
others.append(o)
text = dropSpans(spanscopy, text)
return text, others
|
[
"def",
"templatesCollector",
"(",
"text",
",",
"open",
",",
"close",
")",
":",
"others",
"=",
"[",
"]",
"spans",
"=",
"[",
"i",
"for",
"i",
"in",
"findBalanced",
"(",
"text",
",",
"open",
",",
"close",
")",
"]",
"spanscopy",
"=",
"copy",
"(",
"spans",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"spans",
")",
")",
":",
"start",
",",
"end",
"=",
"spans",
"[",
"i",
"]",
"o",
"=",
"text",
"[",
"start",
":",
"end",
"]",
"ol",
"=",
"o",
".",
"lower",
"(",
")",
"if",
"'vaata|'",
"in",
"ol",
"or",
"'wikitable'",
"in",
"ol",
":",
"spanscopy",
".",
"remove",
"(",
"spans",
"[",
"i",
"]",
")",
"continue",
"others",
".",
"append",
"(",
"o",
")",
"text",
"=",
"dropSpans",
"(",
"spanscopy",
",",
"text",
")",
"return",
"text",
",",
"others"
] |
leaves related articles and wikitables in place
|
[
"leaves",
"related",
"articles",
"and",
"wikitables",
"in",
"place"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wiki/parser.py#L66-L82
|
train
|
returns the text and the other templates that are in place
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG,G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gW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(494 - 443) + chr(0b100111 + 0o14) + chr(0b101110 + 0o11), 7849 - 7841), nzTpIcepk0o8(chr(48) + chr(10918 - 10807) + chr(0b110010) + chr(0b10111 + 0o36) + '\067', 0b1000), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1101111) + '\x32' + chr(963 - 915) + chr(0b1 + 0o61), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + '\x33' + chr(54), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(879 - 829) + chr(0b110100) + chr(48), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(49) + chr(50) + chr(0b10 + 0o64), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(0b100111 + 0o14) + chr(0b11010 + 0o35), 8), nzTpIcepk0o8(chr(1890 - 1842) + chr(111) + chr(0b110001) + '\x30' + chr(0b1110 + 0o46), 0b1000), nzTpIcepk0o8(chr(48) + chr(8728 - 8617) + '\x33' + chr(1790 - 1741) + '\062', ord("\x08")), nzTpIcepk0o8('\060' + chr(9518 - 9407) + chr(0b1 + 0o64) + chr(1473 - 1421), 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(5643 - 5532) + '\063' + '\062' + chr(2386 - 2331), 42042 - 42034), nzTpIcepk0o8('\x30' + chr(7322 - 7211) + chr(50) + chr(0b11011 + 0o31) + '\067', 19891 - 19883), nzTpIcepk0o8(chr(48) + chr(0b1001101 + 0o42) + chr(0b110011) + chr(0b110000) + chr(0b101 + 0o61), 18803 - 18795), nzTpIcepk0o8('\060' + chr(8040 - 7929) + '\063' + chr(54) + chr(0b1110 + 0o50), 41298 - 41290), nzTpIcepk0o8(chr(1851 - 1803) + chr(9716 - 9605) + '\061' + chr(54) + '\x30', 0o10), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\x6f' + chr(49) + chr(0b110110) + chr(49), 19680 - 19672), nzTpIcepk0o8(chr(831 - 783) + '\x6f' + '\062' + '\063', 0b1000), nzTpIcepk0o8('\060' + chr(7089 - 6978) + '\x31' + '\x31' + chr(720 - 668), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001) + chr(0b110001 + 0o2) + chr(53), ord("\x08")), nzTpIcepk0o8('\060' + chr(12071 - 11960) + chr(0b11011 + 0o30) + '\x30' + chr(51), 0o10), nzTpIcepk0o8(chr(2142 - 2094) + '\157' + chr(0b101110 + 0o10) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(1443 - 1393) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1000011 + 0o54) + chr(1526 - 1475) + chr(49) + '\063', 0o10), nzTpIcepk0o8(chr(977 - 929) + chr(0b1101111) + '\061' + chr(0b110010) + chr(650 - 598), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + chr(0b110001) + '\065', 0o10), nzTpIcepk0o8('\060' + chr(0b1010101 + 0o32) + chr(0b110010) + '\x34' + chr(0b101100 + 0o13), 8), nzTpIcepk0o8('\x30' + chr(9615 - 9504) + chr(0b101011 + 0o6) + '\x35' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(2210 - 2162) + chr(0b111010 + 0o65) + '\x32' + chr(2741 - 2688) + '\x36', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\064' + '\063', 53895 - 53887), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\x6f' + '\063' + chr(275 - 224) + '\061', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\067' + '\060', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(1191 - 1136) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(831 - 783) + '\157' + '\x37' + chr(2561 - 2507), ord("\x08")), nzTpIcepk0o8(chr(207 - 159) + chr(0b1101111) + '\x31' + chr(0b11110 + 0o27) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b11111 + 0o120) + '\x31' + chr(1428 - 1373) + chr(0b110101), 62734 - 62726), nzTpIcepk0o8(chr(1354 - 1306) + chr(0b0 + 0o157) + '\x31' + '\063' + chr(2278 - 2223), 0b1000), nzTpIcepk0o8(chr(310 - 262) + '\x6f' + chr(0b110011) + chr(0b10 + 0o56) + chr(49), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b11111 + 0o120) + chr(50) + chr(0b110101) + '\x31', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + chr(0b110111) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(0b100001 + 0o116) + chr(0b0 + 0o61) + chr(55) + '\x34', 60896 - 60888)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1227 - 1179) + chr(9483 - 9372) + '\x35' + chr(48), 42830 - 42822)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf1'), chr(0b1100000 + 0o4) + chr(0b11101 + 0o110) + chr(0b10100 + 0o117) + chr(0b1101111) + chr(0b1100100) + '\145')('\x75' + '\x74' + chr(0b1100011 + 0o3) + chr(1587 - 1542) + chr(336 - 280)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def WjzWEv5QvzIt(cpStk7cY1TJd, DnU3Rq9N5ala, Zeq7Ccf9Ud8j):
XlJQggBAVmIr = []
c4cCiQSW2VVF = [ZlbFMSG8gCoF for ZlbFMSG8gCoF in Pq1BFzLbJ9x6(cpStk7cY1TJd, DnU3Rq9N5ala, Zeq7Ccf9Ud8j)]
zsua9IYGwGl1 = aZTCj4v5QdfO(c4cCiQSW2VVF)
for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(c4cCiQSW2VVF)):
(KQbHFTcl_LKy, NiWVjAWn0l6T) = c4cCiQSW2VVF[ZlbFMSG8gCoF]
WgZUEOuIyTUO = cpStk7cY1TJd[KQbHFTcl_LKy:NiWVjAWn0l6T]
yaKvMgEGV9WN = WgZUEOuIyTUO.Xn8ENWMZdIRt()
if roI3spqORKae(ES5oEprVxulp(b'\xa9\xce\xe3\xea\xc1*'), '\144' + '\145' + chr(0b1100011) + chr(0b110111 + 0o70) + chr(100) + chr(101))(chr(0b110100 + 0o101) + '\x74' + chr(102) + chr(0b100100 + 0o11) + '\070') in yaKvMgEGV9WN or roI3spqORKae(ES5oEprVxulp(b'\xa8\xc6\xe9\xf7\xd47\xbd(\xaf'), chr(0b1100100) + chr(101) + '\x63' + '\157' + chr(0b1100100) + '\145')('\165' + chr(116) + chr(10360 - 10258) + chr(0b101101) + '\070') in yaKvMgEGV9WN:
roI3spqORKae(zsua9IYGwGl1, roI3spqORKae(ES5oEprVxulp(b'\xaf\xe2\xee\xcb\xc82\xed\x0e\xa7g\x96\xe2'), '\x64' + '\x65' + '\143' + '\x6f' + '\144' + chr(101))('\x75' + chr(0b1110100) + chr(102) + chr(0b101101) + '\x38'))(c4cCiQSW2VVF[ZlbFMSG8gCoF])
continue
roI3spqORKae(XlJQggBAVmIr, roI3spqORKae(ES5oEprVxulp(b'\x97\xfb\xd1\xaa\xd81\x98+\xa0C\x82\x92'), chr(0b11001 + 0o113) + '\145' + '\143' + '\157' + '\x64' + '\x65')('\x75' + chr(116) + chr(8383 - 8281) + chr(0b101101) + chr(0b111000)))(WgZUEOuIyTUO)
cpStk7cY1TJd = vKQMi_YwFgaa(zsua9IYGwGl1, cpStk7cY1TJd)
return (cpStk7cY1TJd, XlJQggBAVmIr)
|
estnltk/estnltk
|
estnltk/prettyprinter/prettyprinter.py
|
assert_legal_arguments
|
def assert_legal_arguments(kwargs):
"""Assert that PrettyPrinter arguments are correct.
Raises
------
ValueError
In case there are unknown arguments or a single layer is mapped to more than one aesthetic.
"""
seen_layers = set()
for k, v in kwargs.items():
if k not in LEGAL_ARGUMENTS:
raise ValueError('Illegal argument <{0}>!'.format(k))
if k in AESTHETICS:
if v in seen_layers:
raise ValueError('Layer <{0}> mapped for more than a single aesthetic!'.format(v))
seen_layers.add(v)
if k in VALUES:
if not isinstance(v, six.string_types) and not isinstance(v, list):
raise ValueError('Value <{0}> must be either string or list'.format(k))
if isinstance(v, list):
if len(v) == 0:
raise ValueError('Rules cannot be empty list')
for rule_matcher, rule_value in v:
if not isinstance(rule_matcher, six.string_types) or not isinstance(rule_value, six.string_types):
raise ValueError('Rule tuple elements must be strings')
|
python
|
def assert_legal_arguments(kwargs):
"""Assert that PrettyPrinter arguments are correct.
Raises
------
ValueError
In case there are unknown arguments or a single layer is mapped to more than one aesthetic.
"""
seen_layers = set()
for k, v in kwargs.items():
if k not in LEGAL_ARGUMENTS:
raise ValueError('Illegal argument <{0}>!'.format(k))
if k in AESTHETICS:
if v in seen_layers:
raise ValueError('Layer <{0}> mapped for more than a single aesthetic!'.format(v))
seen_layers.add(v)
if k in VALUES:
if not isinstance(v, six.string_types) and not isinstance(v, list):
raise ValueError('Value <{0}> must be either string or list'.format(k))
if isinstance(v, list):
if len(v) == 0:
raise ValueError('Rules cannot be empty list')
for rule_matcher, rule_value in v:
if not isinstance(rule_matcher, six.string_types) or not isinstance(rule_value, six.string_types):
raise ValueError('Rule tuple elements must be strings')
|
[
"def",
"assert_legal_arguments",
"(",
"kwargs",
")",
":",
"seen_layers",
"=",
"set",
"(",
")",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"if",
"k",
"not",
"in",
"LEGAL_ARGUMENTS",
":",
"raise",
"ValueError",
"(",
"'Illegal argument <{0}>!'",
".",
"format",
"(",
"k",
")",
")",
"if",
"k",
"in",
"AESTHETICS",
":",
"if",
"v",
"in",
"seen_layers",
":",
"raise",
"ValueError",
"(",
"'Layer <{0}> mapped for more than a single aesthetic!'",
".",
"format",
"(",
"v",
")",
")",
"seen_layers",
".",
"add",
"(",
"v",
")",
"if",
"k",
"in",
"VALUES",
":",
"if",
"not",
"isinstance",
"(",
"v",
",",
"six",
".",
"string_types",
")",
"and",
"not",
"isinstance",
"(",
"v",
",",
"list",
")",
":",
"raise",
"ValueError",
"(",
"'Value <{0}> must be either string or list'",
".",
"format",
"(",
"k",
")",
")",
"if",
"isinstance",
"(",
"v",
",",
"list",
")",
":",
"if",
"len",
"(",
"v",
")",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"'Rules cannot be empty list'",
")",
"for",
"rule_matcher",
",",
"rule_value",
"in",
"v",
":",
"if",
"not",
"isinstance",
"(",
"rule_matcher",
",",
"six",
".",
"string_types",
")",
"or",
"not",
"isinstance",
"(",
"rule_value",
",",
"six",
".",
"string_types",
")",
":",
"raise",
"ValueError",
"(",
"'Rule tuple elements must be strings'",
")"
] |
Assert that PrettyPrinter arguments are correct.
Raises
------
ValueError
In case there are unknown arguments or a single layer is mapped to more than one aesthetic.
|
[
"Assert",
"that",
"PrettyPrinter",
"arguments",
"are",
"correct",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/prettyprinter.py#L17-L41
|
train
|
Assert that PrettyPrinter arguments are correct.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,u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_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\157' + '\x34' + chr(0b110101), 31996 - 31988), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + '\066' + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + chr(2542 - 2488) + chr(481 - 433), ord("\x08")), nzTpIcepk0o8(chr(1592 - 1544) + '\157' + chr(52) + '\060', 48499 - 48491), nzTpIcepk0o8(chr(48) + '\157' + chr(2065 - 2014) + chr(1648 - 1594) + '\x37', 11448 - 11440), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(2603 - 2492) + '\067' + chr(0b10 + 0o62), 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + '\157' + '\x31' + chr(2327 - 2278) + '\061', 47812 - 47804), nzTpIcepk0o8('\060' + chr(2050 - 1939) + chr(1269 - 1219) + chr(0b110110) + chr(48), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1857 - 1807) + chr(1878 - 1824) + chr(0b11010 + 0o31), 60767 - 60759), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(0b110111) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(111) + chr(1848 - 1796) + chr(50), 56710 - 56702), nzTpIcepk0o8('\060' + chr(111) + '\x31' + '\x35' + '\060', 0o10), nzTpIcepk0o8(chr(1455 - 1407) + chr(0b1000110 + 0o51) + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + '\x37' + chr(711 - 657), 39255 - 39247), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + chr(0b110011) + chr(0b110111), 50362 - 50354), nzTpIcepk0o8(chr(691 - 643) + chr(111) + '\x33' + chr(0b10110 + 0o35) + chr(2571 - 2519), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + chr(53) + chr(0b100101 + 0o14), 0o10), nzTpIcepk0o8(chr(1732 - 1684) + chr(7964 - 7853) + '\x32' + '\061' + '\x36', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1001100 + 0o43) + '\x31' + chr(1352 - 1301) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(2115 - 2004) + chr(0b101 + 0o55) + chr(0b101110 + 0o11) + chr(2120 - 2068), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + chr(49) + chr(0b101010 + 0o12), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(2106 - 2056) + '\x33' + chr(0b11001 + 0o33), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b110100 + 0o73) + chr(92 - 39) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b1011 + 0o45) + '\157' + chr(0b11001 + 0o32) + chr(1772 - 1718) + chr(0b10000 + 0o44), 0o10), nzTpIcepk0o8(chr(919 - 871) + '\157' + '\x31' + chr(0b1001 + 0o55) + '\x33', 0b1000), nzTpIcepk0o8(chr(1627 - 1579) + '\157' + chr(1317 - 1268) + '\067' + chr(0b101011 + 0o12), 42474 - 42466), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(0b111110 + 0o61) + '\063' + chr(0b110101) + chr(55 - 6), 0b1000), nzTpIcepk0o8(chr(48) + chr(11353 - 11242) + chr(2690 - 2636) + chr(1658 - 1607), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(54) + '\x36', 20687 - 20679), nzTpIcepk0o8(chr(0b100100 + 0o14) + '\x6f' + '\x36' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(552 - 502) + chr(0b110111) + chr(0b100101 + 0o22), 46441 - 46433), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b110010 + 0o75) + chr(1867 - 1812), 0b1000), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\x6f' + chr(50) + chr(872 - 819) + chr(48), 0b1000), nzTpIcepk0o8('\060' + chr(8642 - 8531) + chr(0b10100 + 0o36) + chr(53) + chr(0b101110 + 0o10), ord("\x08")), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\x6f' + chr(0b101110 + 0o4) + '\061' + '\066', 8), nzTpIcepk0o8('\x30' + '\157' + chr(0b1001 + 0o50) + '\x30' + chr(0b10100 + 0o37), ord("\x08")), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\x6f' + chr(0b0 + 0o63) + '\060' + chr(54), 0b1000), nzTpIcepk0o8('\060' + chr(1248 - 1137) + chr(0b110000 + 0o2) + '\067' + chr(50), 3696 - 3688), nzTpIcepk0o8('\x30' + '\x6f' + '\x31' + '\062' + chr(0b110001), 0o10), nzTpIcepk0o8('\x30' + chr(4970 - 4859) + chr(2155 - 2106) + chr(0b100001 + 0o25) + chr(0b11111 + 0o21), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(111) + chr(0b110101) + chr(1886 - 1838), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x0b'), '\144' + '\x65' + chr(99) + '\157' + chr(0b1001000 + 0o34) + chr(101))(chr(8297 - 8180) + chr(0b10101 + 0o137) + '\x66' + '\x2d' + chr(0b100001 + 0o27)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def vpLuRNZKYB1K(q5n0sHDDTy90):
YvvibE4UI9E7 = Bvi71nNyvlqO()
for (B6UAF1zReOyJ, r7AA1pbLjb44) in roI3spqORKae(q5n0sHDDTy90, roI3spqORKae(ES5oEprVxulp(b'|\xaa\xden\xb2F\x01\x84\x80\xcez\x01'), '\144' + '\145' + chr(723 - 624) + chr(0b1101000 + 0o7) + chr(100) + chr(5434 - 5333))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(172 - 127) + '\070'))():
if B6UAF1zReOyJ not in XkJLF5Lc3DAK:
raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'l\x99\xdcE\x90]%\x90\xd2\xcaE\x1dh\x1b1\xa8I\xb2%\x8c\xb1\xa2\x0f'), chr(0b1100100) + chr(9757 - 9656) + chr(99) + chr(111) + chr(100) + '\x65')('\x75' + '\x74' + '\146' + chr(45) + chr(161 - 105)), roI3spqORKae(ES5oEprVxulp(b'T\xc6\x83k\xb0\x0f/\xdf\xe2\xe7a"'), chr(0b1100100) + '\145' + '\x63' + chr(0b10111 + 0o130) + chr(7852 - 7752) + chr(0b1111 + 0o126))(chr(117) + '\164' + '\146' + chr(45) + '\x38'))(B6UAF1zReOyJ))
if B6UAF1zReOyJ in xsDZl3VNhcWA:
if r7AA1pbLjb44 in YvvibE4UI9E7:
raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'i\x94\xc9E\x85\x1cu\xcb\x83\xc5\x1cHh\x1f/\xac\x0c\xea~\xda\xa3\xee\x0e\x99\x1c\x0f\x8c\x13B_\xdei\x88\xcf\xae0\xaf\xd46\x1c@\xd5\xd1E\x84H!\xd5\xc7\xd1AI'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(1472 - 1361) + chr(0b1100100) + chr(0b1011101 + 0o10))(chr(0b1110101) + chr(0b111100 + 0o70) + chr(10188 - 10086) + '\x2d' + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'T\xc6\x83k\xb0\x0f/\xdf\xe2\xe7a"'), chr(0b10 + 0o142) + chr(0b11000 + 0o115) + chr(0b1100011) + chr(0b110110 + 0o71) + '\144' + chr(2018 - 1917))(chr(0b1101001 + 0o14) + chr(4925 - 4809) + chr(1839 - 1737) + chr(45) + chr(2653 - 2597)))(r7AA1pbLjb44))
roI3spqORKae(YvvibE4UI9E7, roI3spqORKae(ES5oEprVxulp(b'P\xc6\xe1D\x9eO\x00\xc1\xf7\xdea\x0c'), '\144' + chr(0b1100101) + chr(2954 - 2855) + '\157' + '\x64' + '\145')('\x75' + '\x74' + chr(5754 - 5652) + '\x2d' + chr(0b111000)))(r7AA1pbLjb44)
if B6UAF1zReOyJ in azOY5g9vcOYd:
if not suIjIS24Zkqw(r7AA1pbLjb44, roI3spqORKae(YVS_F7_wWn_o, roI3spqORKae(ES5oEprVxulp(b'V\x81\xc2I\x99[\x16\xc4\xca\xc8G\x1b'), chr(0b1100100) + chr(101) + chr(99) + chr(5077 - 4966) + chr(0b10000 + 0o124) + chr(101))(chr(0b110101 + 0o100) + '\164' + chr(0b111011 + 0o53) + chr(45) + chr(0b111000)))) and (not suIjIS24Zkqw(r7AA1pbLjb44, H4NoA26ON7iG)):
raise WbNHlDKpyPtQ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b's\x94\xdcU\x92\x1cu\xcb\x83\xc5\x1cHh\x0b,\xa8I\xec;\x9c\xa9\xf5Z\x9c\x16\x0f\xc9@BE\xd6i\xcf\x8e\xe11\xe6\xd68\x03Q'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\x65')('\x75' + chr(116) + chr(6825 - 6723) + chr(0b100101 + 0o10) + chr(1402 - 1346)), roI3spqORKae(ES5oEprVxulp(b'T\xc6\x83k\xb0\x0f/\xdf\xe2\xe7a"'), chr(0b1001000 + 0o34) + chr(101) + chr(0b110111 + 0o54) + '\157' + chr(0b1100100) + '\145')(chr(117) + chr(116) + chr(102) + chr(0b10101 + 0o30) + '\070'))(B6UAF1zReOyJ))
if suIjIS24Zkqw(r7AA1pbLjb44, H4NoA26ON7iG):
if ftfygxgFas5X(r7AA1pbLjb44) == nzTpIcepk0o8(chr(1293 - 1245) + '\157' + '\060', ord("\x08")):
raise WbNHlDKpyPtQ(roI3spqORKae(ES5oEprVxulp(b'w\x80\xdcE\x84\x1c*\xd1\xdd\xd6M\x1c%\x1c:\xfc\x0c\xe3.\xc8\xb5\xbcB\x9d\x00\t'), chr(100) + chr(8246 - 8145) + '\143' + chr(111) + '\144' + '\x65')('\x75' + chr(12694 - 12578) + '\146' + '\x2d' + chr(56)))
for (Fjhd_rSP3Vpm, neLQp2vHLgAt) in r7AA1pbLjb44:
if not suIjIS24Zkqw(Fjhd_rSP3Vpm, roI3spqORKae(YVS_F7_wWn_o, roI3spqORKae(ES5oEprVxulp(b'V\x81\xc2I\x99[\x16\xc4\xca\xc8G\x1b'), chr(0b1100100) + chr(4911 - 4810) + chr(0b101011 + 0o70) + chr(0b1010000 + 0o37) + '\144' + '\145')(chr(0b1110101) + chr(116) + chr(0b1100110) + '\x2d' + '\x38'))) or not suIjIS24Zkqw(neLQp2vHLgAt, roI3spqORKae(YVS_F7_wWn_o, roI3spqORKae(ES5oEprVxulp(b'V\x81\xc2I\x99[\x16\xc4\xca\xc8G\x1b'), '\144' + '\145' + '\143' + chr(111) + chr(0b10101 + 0o117) + chr(9592 - 9491))(chr(11156 - 11039) + chr(0b1010110 + 0o36) + '\x66' + chr(45) + chr(0b10110 + 0o42)))):
raise WbNHlDKpyPtQ(roI3spqORKae(ES5oEprVxulp(b'w\x80\xdcE\xd7H<\xc0\xdf\xdd\x02\ri\x1b2\xb9\x07\xfa-\x9c\xa1\xe9]\x80S\x1f\x8c\x13EC\xcdn\xc6\xc9\xfd'), chr(0b1100100) + chr(101) + chr(5179 - 5080) + '\x6f' + '\144' + chr(0b101101 + 0o70))(chr(117) + chr(0b11100 + 0o130) + chr(0b101110 + 0o70) + chr(0b101101) + '\070'))
|
estnltk/estnltk
|
estnltk/prettyprinter/prettyprinter.py
|
parse_arguments
|
def parse_arguments(kwargs):
"""Function that parses PrettyPrinter arguments.
Detects which aesthetics are mapped to which layers
and collects user-provided values.
Parameters
----------
kwargs: dict
The keyword arguments to PrettyPrinter.
Returns
-------
dict, dict
First dictionary is aesthetic to layer mapping.
Second dictionary is aesthetic to user value mapping.
"""
aesthetics = {}
values = {}
for aes in AESTHETICS:
if aes in kwargs:
aesthetics[aes] = kwargs[aes]
val_name = AES_VALUE_MAP[aes]
# map the user-provided CSS value or use the default
values[aes] = kwargs.get(val_name, DEFAULT_VALUE_MAP[aes])
return aesthetics, values
|
python
|
def parse_arguments(kwargs):
"""Function that parses PrettyPrinter arguments.
Detects which aesthetics are mapped to which layers
and collects user-provided values.
Parameters
----------
kwargs: dict
The keyword arguments to PrettyPrinter.
Returns
-------
dict, dict
First dictionary is aesthetic to layer mapping.
Second dictionary is aesthetic to user value mapping.
"""
aesthetics = {}
values = {}
for aes in AESTHETICS:
if aes in kwargs:
aesthetics[aes] = kwargs[aes]
val_name = AES_VALUE_MAP[aes]
# map the user-provided CSS value or use the default
values[aes] = kwargs.get(val_name, DEFAULT_VALUE_MAP[aes])
return aesthetics, values
|
[
"def",
"parse_arguments",
"(",
"kwargs",
")",
":",
"aesthetics",
"=",
"{",
"}",
"values",
"=",
"{",
"}",
"for",
"aes",
"in",
"AESTHETICS",
":",
"if",
"aes",
"in",
"kwargs",
":",
"aesthetics",
"[",
"aes",
"]",
"=",
"kwargs",
"[",
"aes",
"]",
"val_name",
"=",
"AES_VALUE_MAP",
"[",
"aes",
"]",
"# map the user-provided CSS value or use the default",
"values",
"[",
"aes",
"]",
"=",
"kwargs",
".",
"get",
"(",
"val_name",
",",
"DEFAULT_VALUE_MAP",
"[",
"aes",
"]",
")",
"return",
"aesthetics",
",",
"values"
] |
Function that parses PrettyPrinter arguments.
Detects which aesthetics are mapped to which layers
and collects user-provided values.
Parameters
----------
kwargs: dict
The keyword arguments to PrettyPrinter.
Returns
-------
dict, dict
First dictionary is aesthetic to layer mapping.
Second dictionary is aesthetic to user value mapping.
|
[
"Function",
"that",
"parses",
"PrettyPrinter",
"arguments",
".",
"Detects",
"which",
"aesthetics",
"are",
"mapped",
"to",
"which",
"layers",
"and",
"collects",
"user",
"-",
"provided",
"values",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/prettyprinter.py#L44-L68
|
train
|
Function that parses the keyword arguments to get aesthetics and values from the PrettyPrinter output.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7L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9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1181 - 1133) + chr(11286 - 11175) + '\062' + chr(2679 - 2626) + '\x31', 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(111) + '\x37', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\x33' + chr(1609 - 1557) + '\066', 0o10), nzTpIcepk0o8(chr(1040 - 992) + chr(111) + '\x33' + chr(330 - 282) + chr(50), 35690 - 35682), nzTpIcepk0o8(chr(478 - 430) + '\x6f' + chr(0b11010 + 0o30) + '\x32' + chr(54), 34225 - 34217), nzTpIcepk0o8(chr(2065 - 2017) + chr(111) + chr(1693 - 1643) + chr(262 - 209), 0o10), nzTpIcepk0o8('\x30' + chr(5007 - 4896) + chr(1821 - 1770) + chr(0b10111 + 0o37) + chr(0b110110), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\x35' + '\065', 0o10), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(111) + chr(1314 - 1262) + '\x36', 0o10), nzTpIcepk0o8('\060' + chr(2524 - 2413) + '\x33' + '\x32' + chr(2649 - 2596), 47289 - 47281), nzTpIcepk0o8('\060' + chr(0b110011 + 0o74) + chr(0b100110 + 0o13) + chr(0b101100 + 0o10) + chr(0b110000 + 0o5), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b10110 + 0o33) + chr(0b110101) + chr(52), 19723 - 19715), nzTpIcepk0o8(chr(0b110000) + chr(147 - 36) + chr(0b1000 + 0o52) + chr(0b101001 + 0o13) + '\064', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b100001 + 0o116) + chr(0b1 + 0o62) + '\061', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(52), 0o10), nzTpIcepk0o8('\060' + '\157' + '\062' + chr(51) + '\064', 48298 - 48290), nzTpIcepk0o8(chr(0b110000) + chr(0b11011 + 0o124) + '\x33' + chr(426 - 378) + chr(0b100110 + 0o20), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b10110 + 0o33) + '\x34', 31884 - 31876), nzTpIcepk0o8(chr(183 - 135) + '\x6f' + '\x32' + chr(50) + chr(0b10010 + 0o37), ord("\x08")), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(111) + '\x33' + chr(0b11001 + 0o36) + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(1269 - 1214) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b11 + 0o154) + '\063' + '\061' + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10101 + 0o36) + '\x35' + chr(1490 - 1438), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110001) + chr(0b11101 + 0o26), 0b1000), nzTpIcepk0o8(chr(1030 - 982) + chr(0b1101111) + chr(1665 - 1615) + chr(0b101110 + 0o10) + '\x37', 6936 - 6928), nzTpIcepk0o8('\060' + chr(0b100000 + 0o117) + '\x31' + chr(1517 - 1463) + '\x34', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001) + chr(0b110100) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b100011 + 0o114) + '\x33' + '\061' + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(1406 - 1358) + '\157' + chr(914 - 863) + '\x31' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b1111 + 0o50) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(51) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(111) + chr(0b110011) + chr(0b110011 + 0o0) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(6393 - 6282) + chr(1892 - 1842) + chr(0b110110) + '\066', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(600 - 549), 2092 - 2084), nzTpIcepk0o8(chr(2166 - 2118) + chr(0b1101111) + '\062' + '\062' + chr(0b11101 + 0o27), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(713 - 662) + chr(2076 - 2028), 30559 - 30551), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(0b1101111) + chr(0b110011) + chr(54) + chr(0b110011), 60044 - 60036), nzTpIcepk0o8(chr(48) + chr(111) + chr(2061 - 2012) + chr(0b110001) + chr(489 - 440), 0b1000), nzTpIcepk0o8(chr(2055 - 2007) + chr(0b111010 + 0o65) + chr(55) + chr(1756 - 1705), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(891 - 843) + chr(0b1101111) + chr(53) + chr(1461 - 1413), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x87'), chr(100) + '\145' + '\x63' + chr(0b1101111) + '\144' + chr(2912 - 2811))(chr(0b1001100 + 0o51) + '\164' + '\x66' + '\055' + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def ddsVXimELFmo(q5n0sHDDTy90):
AjjJUuQQ7yCW = {}
CsodZJH6x9Tx = {}
for pVJ_XKUUWkR8 in xsDZl3VNhcWA:
if pVJ_XKUUWkR8 in q5n0sHDDTy90:
AjjJUuQQ7yCW[pVJ_XKUUWkR8] = q5n0sHDDTy90[pVJ_XKUUWkR8]
WjBNPgUFpoNT = Y3rXmJ__BmMQ[pVJ_XKUUWkR8]
CsodZJH6x9Tx[pVJ_XKUUWkR8] = q5n0sHDDTy90.GUKetu4xaGsJ(WjBNPgUFpoNT, JXEwcWGUraM8[pVJ_XKUUWkR8])
return (AjjJUuQQ7yCW, CsodZJH6x9Tx)
|
estnltk/estnltk
|
estnltk/prettyprinter/prettyprinter.py
|
PrettyPrinter.css
|
def css(self):
"""Returns
-------
str
The CSS.
"""
css_list = [DEFAULT_MARK_CSS]
for aes in self.aesthetics:
css_list.extend(get_mark_css(aes, self.values[aes]))
#print('\n'.join(css_list))
return '\n'.join(css_list)
|
python
|
def css(self):
"""Returns
-------
str
The CSS.
"""
css_list = [DEFAULT_MARK_CSS]
for aes in self.aesthetics:
css_list.extend(get_mark_css(aes, self.values[aes]))
#print('\n'.join(css_list))
return '\n'.join(css_list)
|
[
"def",
"css",
"(",
"self",
")",
":",
"css_list",
"=",
"[",
"DEFAULT_MARK_CSS",
"]",
"for",
"aes",
"in",
"self",
".",
"aesthetics",
":",
"css_list",
".",
"extend",
"(",
"get_mark_css",
"(",
"aes",
",",
"self",
".",
"values",
"[",
"aes",
"]",
")",
")",
"#print('\\n'.join(css_list))",
"return",
"'\\n'",
".",
"join",
"(",
"css_list",
")"
] |
Returns
-------
str
The CSS.
|
[
"Returns",
"-------",
"str",
"The",
"CSS",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estn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Sxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1798 - 1750) + chr(0b110 + 0o151) + chr(51) + chr(49) + chr(0b110101), 16714 - 16706), nzTpIcepk0o8('\060' + chr(111) + chr(883 - 833) + chr(0b110001) + chr(832 - 777), 27705 - 27697), nzTpIcepk0o8('\060' + '\157' + chr(0b101010 + 0o7) + chr(721 - 671) + chr(54), 41233 - 41225), nzTpIcepk0o8('\x30' + chr(6528 - 6417) + chr(2273 - 2223) + chr(1085 - 1031) + chr(53), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b1110 + 0o50) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + '\x30', 49667 - 49659), nzTpIcepk0o8(chr(0b100100 + 0o14) + '\x6f' + chr(49) + '\063' + chr(910 - 860), 26878 - 26870), nzTpIcepk0o8(chr(0b110000) + chr(11874 - 11763) + '\061' + chr(48) + chr(50), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(1103 - 1054) + chr(2511 - 2457) + chr(0b101001 + 0o12), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1047 - 996) + '\x30' + chr(98 - 48), 34870 - 34862), nzTpIcepk0o8(chr(48) + chr(2322 - 2211) + chr(0b110 + 0o55) + chr(54) + '\x37', 55727 - 55719), nzTpIcepk0o8(chr(416 - 368) + chr(111) + chr(0b110001) + '\x34' + '\x36', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + chr(50) + chr(54), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\064' + chr(50), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + chr(0b110110) + '\061', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + chr(51) + chr(2356 - 2304), 0o10), nzTpIcepk0o8(chr(925 - 877) + chr(111) + '\061' + chr(0b110000) + chr(50), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\063' + chr(1142 - 1087) + '\x31', 0b1000), nzTpIcepk0o8('\060' + chr(0b1001 + 0o146) + chr(929 - 878) + chr(2679 - 2625) + '\x37', 8), nzTpIcepk0o8('\060' + chr(10698 - 10587) + '\x33' + chr(51) + chr(50), 8366 - 8358), nzTpIcepk0o8(chr(48) + '\157' + chr(52), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + chr(0b110100) + chr(54), 8), nzTpIcepk0o8(chr(1602 - 1554) + chr(4957 - 4846) + chr(0b10011 + 0o36) + chr(48) + '\064', 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1100 + 0o46) + chr(54) + chr(568 - 519), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(51) + '\x35' + chr(0b10000 + 0o43), 52418 - 52410), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(0b110110) + chr(54), 0b1000), nzTpIcepk0o8(chr(1611 - 1563) + '\x6f' + '\061' + '\067' + chr(1188 - 1136), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x32' + chr(139 - 87) + '\x37', 44055 - 44047), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(0b1101111) + chr(0b110010) + chr(54) + '\x37', 0b1000), nzTpIcepk0o8('\x30' + chr(11236 - 11125) + chr(0b110001) + chr(0b110000) + chr(2492 - 2437), 18508 - 18500), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + chr(0b110100 + 0o3) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b1101111) + '\x31' + chr(54) + chr(52), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110100) + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(69 - 21) + chr(111) + chr(0b110001) + chr(0b10000 + 0o40) + '\067', 8), nzTpIcepk0o8('\x30' + '\157' + chr(0b0 + 0o61) + chr(55) + '\x31', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1915 - 1860) + '\x34', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(0b11101 + 0o31) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(12044 - 11933) + chr(1722 - 1671) + chr(55), 0o10), nzTpIcepk0o8(chr(886 - 838) + chr(0b1101111) + chr(2117 - 2066) + chr(0b110011) + chr(0b101010 + 0o12), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b100000 + 0o117) + chr(53) + '\060', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe3'), chr(0b11 + 0o141) + '\x65' + chr(0b1100011) + chr(0b1000101 + 0o52) + '\144' + chr(0b1011 + 0o132))(chr(9857 - 9740) + chr(6547 - 6431) + chr(102) + chr(0b101101) + chr(3020 - 2964)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def OojqKs8RTC8L(hXMPsSrOQzbh):
dyjPTzbJQltY = [bSO3JZF3vKU6]
for pVJ_XKUUWkR8 in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xac\xea%\xc1[}.+\x10\xb1'), '\x64' + '\x65' + chr(1881 - 1782) + chr(0b1011111 + 0o20) + chr(0b1100100) + chr(101))(chr(117) + chr(0b11010 + 0o132) + chr(0b1100110) + '\x2d' + chr(822 - 766))):
roI3spqORKae(dyjPTzbJQltY, roI3spqORKae(ES5oEprVxulp(b'\x99\xd0e\xf8\\|\x16\x15,\x80\x95\x17'), chr(0b1100100) + '\145' + chr(0b111 + 0o134) + '\157' + chr(100) + chr(7785 - 7684))(chr(3690 - 3573) + chr(0b101000 + 0o114) + chr(0b101100 + 0o72) + '\055' + '\070'))(eZp6up_MBlQb(pVJ_XKUUWkR8, roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x8e\xfc9\xd1iR\x12t\x0b\xfb\xa3\x1e'), chr(0b1011101 + 0o7) + '\x65' + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(117) + '\164' + '\146' + chr(0b100100 + 0o11) + '\070'))[pVJ_XKUUWkR8]))
return roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xc7'), '\144' + chr(0b1010011 + 0o22) + chr(0b0 + 0o143) + chr(0b110110 + 0o71) + chr(2695 - 2595) + '\x65')('\x75' + chr(0b1110100) + chr(0b101010 + 0o74) + chr(0b100 + 0o51) + chr(56)), roI3spqORKae(ES5oEprVxulp(b"\x94\xbb/\xf8\nZ9$'\x81\xb9\x17"), chr(0b110110 + 0o56) + chr(101) + '\x63' + chr(111) + '\144' + chr(1711 - 1610))(chr(0b1110101) + chr(0b1110100) + chr(5855 - 5753) + chr(45) + chr(1050 - 994)))(dyjPTzbJQltY)
|
estnltk/estnltk
|
estnltk/prettyprinter/prettyprinter.py
|
PrettyPrinter.render
|
def render(self, text, add_header=False):
"""Render the HTML.
Parameters
----------
add_header: boolean (default: False)
If True, add HTML5 header and footer.
Returns
-------
str
The rendered HTML.
"""
html = mark_text(text, self.aesthetics, self.rules)
html = html.replace('\n', '<br/>')
if add_header:
html = '\n'.join([HEADER, self.css, MIDDLE, html, FOOTER])
#print('\n'.join((HEADER, self.css, MIDDLE, html, FOOTER)))
return html
|
python
|
def render(self, text, add_header=False):
"""Render the HTML.
Parameters
----------
add_header: boolean (default: False)
If True, add HTML5 header and footer.
Returns
-------
str
The rendered HTML.
"""
html = mark_text(text, self.aesthetics, self.rules)
html = html.replace('\n', '<br/>')
if add_header:
html = '\n'.join([HEADER, self.css, MIDDLE, html, FOOTER])
#print('\n'.join((HEADER, self.css, MIDDLE, html, FOOTER)))
return html
|
[
"def",
"render",
"(",
"self",
",",
"text",
",",
"add_header",
"=",
"False",
")",
":",
"html",
"=",
"mark_text",
"(",
"text",
",",
"self",
".",
"aesthetics",
",",
"self",
".",
"rules",
")",
"html",
"=",
"html",
".",
"replace",
"(",
"'\\n'",
",",
"'<br/>'",
")",
"if",
"add_header",
":",
"html",
"=",
"'\\n'",
".",
"join",
"(",
"[",
"HEADER",
",",
"self",
".",
"css",
",",
"MIDDLE",
",",
"html",
",",
"FOOTER",
"]",
")",
"#print('\\n'.join((HEADER, self.css, MIDDLE, html, FOOTER)))",
"return",
"html"
] |
Render the HTML.
Parameters
----------
add_header: boolean (default: False)
If True, add HTML5 header and footer.
Returns
-------
str
The rendered HTML.
|
[
"Render",
"the",
"HTML",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/prettyprinter.py#L121-L140
|
train
|
Render the HTML.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1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ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b101001 + 0o10) + '\x37' + '\x30', 0b1000), nzTpIcepk0o8(chr(0b100 + 0o54) + '\157' + chr(51) + '\062' + chr(1020 - 970), 0b1000), nzTpIcepk0o8(chr(0b1010 + 0o46) + '\x6f' + '\063' + chr(773 - 720) + '\061', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(48) + chr(0b110000 + 0o5), 0o10), nzTpIcepk0o8(chr(1661 - 1613) + chr(11155 - 11044) + chr(51) + '\061' + '\x30', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b11101 + 0o25) + chr(0b110100) + chr(2251 - 2200), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b101 + 0o53) + '\x31', 0o10), nzTpIcepk0o8(chr(0b1001 + 0o47) + '\x6f' + chr(0b101001 + 0o10) + '\x33' + '\066', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b101011 + 0o104) + chr(49) + chr(0b10000 + 0o45) + chr(52), 0o10), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\x6f' + '\062' + '\x31' + chr(310 - 262), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b11 + 0o56) + '\x31' + chr(0b1011 + 0o45), 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1100010 + 0o15) + '\x36' + chr(0b100011 + 0o16), ord("\x08")), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(1449 - 1338) + '\066' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(6042 - 5931) + chr(0b10101 + 0o35) + '\066' + chr(0b110000 + 0o7), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011) + '\x35' + chr(0b11011 + 0o32), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x36' + chr(227 - 172), 44014 - 44006), nzTpIcepk0o8('\060' + '\x6f' + '\061' + '\064' + chr(2828 - 2773), 0o10), nzTpIcepk0o8(chr(0b100 + 0o54) + '\x6f' + chr(1369 - 1319) + '\062' + chr(53), 0o10), nzTpIcepk0o8(chr(2084 - 2036) + '\157' + '\x32' + chr(0b110101) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(1207 - 1159) + chr(9417 - 9306) + '\062' + chr(0b110011) + chr(48), 0o10), nzTpIcepk0o8('\x30' + chr(0b1100100 + 0o13) + chr(0b101 + 0o56) + '\061' + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(111) + chr(51) + '\064' + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(0b1010 + 0o52) + chr(0b11100 + 0o33), 8), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b10010 + 0o135) + '\x31' + '\x37' + '\066', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1497 - 1446) + chr(0b110111) + chr(0b110111), 1507 - 1499), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33', 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + '\x6f' + chr(1838 - 1789), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(50) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(306 - 258) + chr(111) + chr(0b101101 + 0o4) + '\066' + chr(55), 59897 - 59889), nzTpIcepk0o8(chr(48) + chr(0b111000 + 0o67) + '\061' + '\065' + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1000011 + 0o54) + chr(157 - 108) + chr(0b110001) + chr(0b110 + 0o53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1010100 + 0o33) + chr(0b100100 + 0o16) + chr(0b110010) + chr(0b11001 + 0o30), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010000 + 0o37) + '\062' + '\x32', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + '\061' + chr(0b11101 + 0o27), 29161 - 29153), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + '\x34' + '\060', 0o10), nzTpIcepk0o8('\x30' + chr(0b111100 + 0o63) + '\x31' + chr(1449 - 1399) + '\061', 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111) + chr(49) + chr(52), 14723 - 14715), nzTpIcepk0o8('\x30' + chr(10939 - 10828) + chr(66 - 16) + '\067' + chr(50), 30052 - 30044), nzTpIcepk0o8(chr(2212 - 2164) + '\x6f' + '\x31' + chr(1532 - 1480) + chr(0b101000 + 0o13), 58082 - 58074), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(111) + chr(0b110010) + chr(49) + '\062', 62333 - 62325)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b11000 + 0o127) + chr(53) + chr(0b11111 + 0o21), 20375 - 20367)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'V'), chr(0b1100100) + chr(0b100011 + 0o102) + chr(0b1100011) + '\x6f' + chr(9768 - 9668) + '\x65')(chr(0b100111 + 0o116) + chr(3334 - 3218) + '\x66' + chr(45) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def yWJZvHcCoSKp(hXMPsSrOQzbh, cpStk7cY1TJd, ALwWSYZdRRyV=nzTpIcepk0o8(chr(0b100 + 0o54) + '\157' + '\x30', 29982 - 29974)):
ISqAO12SND9I = MuwxD2FEFyI6(cpStk7cY1TJd, hXMPsSrOQzbh.aesthetics, hXMPsSrOQzbh.YjCtpAh18y9x)
ISqAO12SND9I = ISqAO12SND9I.E91dbqOZXBpJ(roI3spqORKae(ES5oEprVxulp(b'r'), '\144' + chr(0b11000 + 0o115) + chr(0b1100011) + chr(111) + chr(0b1100100) + '\145')('\165' + '\x74' + '\146' + chr(45) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'D\xb0\x9bj\xf6'), chr(100) + chr(101) + chr(122 - 23) + chr(111) + chr(0b1000101 + 0o37) + '\x65')('\x75' + '\x74' + '\x66' + '\055' + chr(56)))
if ALwWSYZdRRyV:
ISqAO12SND9I = roI3spqORKae(ES5oEprVxulp(b'r'), chr(513 - 413) + '\x65' + '\143' + chr(0b1101001 + 0o6) + chr(8549 - 8449) + chr(8283 - 8182))('\165' + chr(9288 - 9172) + '\146' + '\x2d' + '\070').Y4yM9BcfTCNq([nOT0CPysD0et, hXMPsSrOQzbh.css, osyMCmlh3jUo, ISqAO12SND9I, uplhueCyGClK])
return ISqAO12SND9I
|
estnltk/estnltk
|
estnltk/estner/crfsuiteutil.py
|
Trainer.train
|
def train(self, nerdocs, mode_filename):
"""Train a CRF model using given documents.
Parameters
----------
nerdocs: list of estnltk.estner.ner.Document.
The documents for model training.
mode_filename: str
The fielname where to save the model.
"""
trainer = pycrfsuite.Trainer(algorithm=self.algorithm,
params={'c2': self.c2},
verbose=self.verbose)
for doc in nerdocs:
for snt in doc.sentences:
xseq = [t.feature_list() for t in snt]
yseq = [t.label for t in snt]
trainer.append(xseq, yseq)
trainer.train(mode_filename)
|
python
|
def train(self, nerdocs, mode_filename):
"""Train a CRF model using given documents.
Parameters
----------
nerdocs: list of estnltk.estner.ner.Document.
The documents for model training.
mode_filename: str
The fielname where to save the model.
"""
trainer = pycrfsuite.Trainer(algorithm=self.algorithm,
params={'c2': self.c2},
verbose=self.verbose)
for doc in nerdocs:
for snt in doc.sentences:
xseq = [t.feature_list() for t in snt]
yseq = [t.label for t in snt]
trainer.append(xseq, yseq)
trainer.train(mode_filename)
|
[
"def",
"train",
"(",
"self",
",",
"nerdocs",
",",
"mode_filename",
")",
":",
"trainer",
"=",
"pycrfsuite",
".",
"Trainer",
"(",
"algorithm",
"=",
"self",
".",
"algorithm",
",",
"params",
"=",
"{",
"'c2'",
":",
"self",
".",
"c2",
"}",
",",
"verbose",
"=",
"self",
".",
"verbose",
")",
"for",
"doc",
"in",
"nerdocs",
":",
"for",
"snt",
"in",
"doc",
".",
"sentences",
":",
"xseq",
"=",
"[",
"t",
".",
"feature_list",
"(",
")",
"for",
"t",
"in",
"snt",
"]",
"yseq",
"=",
"[",
"t",
".",
"label",
"for",
"t",
"in",
"snt",
"]",
"trainer",
".",
"append",
"(",
"xseq",
",",
"yseq",
")",
"trainer",
".",
"train",
"(",
"mode_filename",
")"
] |
Train a CRF model using given documents.
Parameters
----------
nerdocs: list of estnltk.estner.ner.Document.
The documents for model training.
mode_filename: str
The fielname where to save the model.
|
[
"Train",
"a",
"CRF",
"model",
"using",
"given",
"documents",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/estner/crfsuiteutil.py#L28-L49
|
train
|
Train a CRF model using a list of nerdocs.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m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dKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(3686 - 3575) + '\063' + chr(48) + chr(145 - 94), 9304 - 9296), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10001 + 0o40) + chr(1549 - 1498) + '\x31', 0o10), nzTpIcepk0o8(chr(757 - 709) + chr(0b1101111) + chr(0b11000 + 0o32) + chr(274 - 225) + chr(50), 56434 - 56426), nzTpIcepk0o8(chr(0b110000) + chr(0b101 + 0o152) + chr(49) + chr(212 - 163) + chr(0b11010 + 0o26), 0b1000), nzTpIcepk0o8(chr(0b1 + 0o57) + '\x6f' + chr(49) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(111) + '\x32' + chr(0b110001 + 0o3), ord("\x08")), nzTpIcepk0o8(chr(665 - 617) + chr(111) + chr(0b110011) + chr(0b110101) + chr(0b10011 + 0o40), 56032 - 56024), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + '\x31' + chr(0b110101), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b100010 + 0o17) + chr(54) + '\x30', 19052 - 19044), nzTpIcepk0o8('\x30' + chr(0b111101 + 0o62) + chr(0b100010 + 0o20) + '\x32' + '\063', ord("\x08")), nzTpIcepk0o8(chr(619 - 571) + chr(0b10100 + 0o133) + chr(0b0 + 0o62) + chr(651 - 600), 20273 - 20265), nzTpIcepk0o8(chr(48) + '\157' + chr(1339 - 1289) + '\063' + chr(53), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + '\x30' + '\x37', 39918 - 39910), nzTpIcepk0o8('\060' + '\x6f' + chr(106 - 55) + '\062', ord("\x08")), nzTpIcepk0o8('\x30' + chr(4629 - 4518) + chr(0b101000 + 0o16), 2278 - 2270), nzTpIcepk0o8('\x30' + chr(111) + '\x33' + chr(0b110001), 0b1000), nzTpIcepk0o8('\x30' + chr(12059 - 11948) + chr(0b1110 + 0o51) + chr(0b110001), 61653 - 61645), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(0b1001 + 0o55) + chr(0b110100 + 0o0), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x33' + chr(1794 - 1740) + '\066', 18524 - 18516), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b1101110 + 0o1) + chr(0b11000 + 0o32) + chr(54) + chr(55), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + chr(0b110101) + '\x35', 42514 - 42506), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + chr(426 - 377) + '\x36', 48369 - 48361), nzTpIcepk0o8('\060' + chr(0b1010101 + 0o32) + '\062' + chr(0b110111) + '\067', 0b1000), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b10101 + 0o132) + chr(0b110011) + chr(51) + chr(0b10111 + 0o32), 0b1000), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\157' + chr(0b110011) + '\065' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(1494 - 1446) + chr(11450 - 11339) + chr(288 - 239) + chr(49) + chr(0b11000 + 0o34), 0b1000), nzTpIcepk0o8('\060' + chr(8683 - 8572) + chr(0b110000 + 0o4) + '\066', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(380 - 331) + '\063', 17724 - 17716), nzTpIcepk0o8(chr(1613 - 1565) + chr(111) + chr(143 - 89) + chr(0b110011), 0o10), nzTpIcepk0o8('\x30' + chr(11982 - 11871) + '\x31' + '\067' + '\065', 0b1000), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\x6f' + '\x31' + chr(54) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\065' + chr(0b0 + 0o63), 8), nzTpIcepk0o8('\060' + chr(5018 - 4907) + chr(0b110010) + chr(1213 - 1162) + chr(0b11100 + 0o25), 54401 - 54393), nzTpIcepk0o8(chr(1614 - 1566) + chr(0b1001 + 0o146) + chr(0b110011) + chr(0b110000) + chr(1757 - 1708), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + chr(0b10011 + 0o35) + '\067', 8), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(6519 - 6408) + chr(1771 - 1722) + chr(0b110110) + '\x36', 0b1000), nzTpIcepk0o8('\060' + chr(2712 - 2601) + chr(49) + chr(0b11 + 0o62) + chr(2227 - 2176), 0b1000), nzTpIcepk0o8(chr(48) + chr(10043 - 9932) + '\x33' + chr(0b110101) + chr(1087 - 1039), 8), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b1101111) + chr(0b110011) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(52) + chr(48), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b101 + 0o53) + chr(111) + chr(0b10011 + 0o42) + chr(0b110000), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xed'), '\x64' + '\x65' + '\143' + chr(0b1000100 + 0o53) + '\x64' + chr(9439 - 9338))(chr(0b1110101) + chr(116) + '\146' + chr(0b101101) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def dPmtNHTIAOfd(hXMPsSrOQzbh, dy2OIERlTJfX, tPEkGjm9G5a_):
ClXnp8F8DXWB = EvNWkATNsXbY.Trainer(algorithm=hXMPsSrOQzbh.RberJrUJMLsx, params={roI3spqORKae(ES5oEprVxulp(b'\xa0k'), chr(6853 - 6753) + '\145' + chr(99) + '\157' + chr(100) + chr(0b1100101))(chr(10448 - 10331) + '\x74' + '\x66' + '\055' + chr(0b1011 + 0o55)): hXMPsSrOQzbh.c2}, verbose=hXMPsSrOQzbh.TseISVdPlfdM)
for mPg7tgN9u21K in dy2OIERlTJfX:
for r6Hvgey5P0gE in roI3spqORKae(mPg7tgN9u21K, roI3spqORKae(ES5oEprVxulp(b'\xb0<\xe4<iz\x88(\x03'), chr(100) + '\x65' + '\143' + chr(111) + '\144' + chr(1703 - 1602))('\x75' + chr(0b1110100) + chr(102) + '\055' + '\070')):
zYyPFvgaRM12 = [h3Vc_4wxEbgd.feature_list() for h3Vc_4wxEbgd in r6Hvgey5P0gE]
icvpUPoDEWo8 = [h3Vc_4wxEbgd.OkDIn6t2Cke6 for h3Vc_4wxEbgd in r6Hvgey5P0gE]
roI3spqORKae(ClXnp8F8DXWB, roI3spqORKae(ES5oEprVxulp(b'\x8b\r\xd9|ts\xac"\x1a\xfcF\xa8'), '\x64' + chr(0b1100101) + chr(99) + chr(0b1101111) + '\144' + chr(101))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b110101 + 0o3)))(zYyPFvgaRM12, icvpUPoDEWo8)
roI3spqORKae(ClXnp8F8DXWB, roI3spqORKae(ES5oEprVxulp(b'\xb7+\xeb!b'), chr(100) + chr(0b1011101 + 0o10) + '\x63' + '\x6f' + chr(596 - 496) + '\x65')('\x75' + chr(13399 - 13283) + chr(0b1100110) + '\x2d' + '\x38'))(tPEkGjm9G5a_)
|
estnltk/estnltk
|
estnltk/estner/crfsuiteutil.py
|
Tagger.tag
|
def tag(self, nerdoc):
"""Tag the given document.
Parameters
----------
nerdoc: estnltk.estner.Document
The document to be tagged.
Returns
-------
labels: list of lists of str
Predicted token Labels for each sentence in the document
"""
labels = []
for snt in nerdoc.sentences:
xseq = [t.feature_list() for t in snt]
yseq = self.tagger.tag(xseq)
labels.append(yseq)
return labels
|
python
|
def tag(self, nerdoc):
"""Tag the given document.
Parameters
----------
nerdoc: estnltk.estner.Document
The document to be tagged.
Returns
-------
labels: list of lists of str
Predicted token Labels for each sentence in the document
"""
labels = []
for snt in nerdoc.sentences:
xseq = [t.feature_list() for t in snt]
yseq = self.tagger.tag(xseq)
labels.append(yseq)
return labels
|
[
"def",
"tag",
"(",
"self",
",",
"nerdoc",
")",
":",
"labels",
"=",
"[",
"]",
"for",
"snt",
"in",
"nerdoc",
".",
"sentences",
":",
"xseq",
"=",
"[",
"t",
".",
"feature_list",
"(",
")",
"for",
"t",
"in",
"snt",
"]",
"yseq",
"=",
"self",
".",
"tagger",
".",
"tag",
"(",
"xseq",
")",
"labels",
".",
"append",
"(",
"yseq",
")",
"return",
"labels"
] |
Tag the given document.
Parameters
----------
nerdoc: estnltk.estner.Document
The document to be tagged.
Returns
-------
labels: list of lists of str
Predicted token Labels for each sentence in the document
|
[
"Tag",
"the",
"given",
"document",
".",
"Parameters",
"----------",
"nerdoc",
":",
"estnltk",
".",
"estner",
".",
"Document",
"The",
"document",
"to",
"be",
"tagged",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/estner/crfsuiteutil.py#L69-L87
|
train
|
Tag the given document with the tagger.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA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S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(649 - 601) + chr(0b1101111) + chr(50) + chr(1183 - 1133) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\061' + chr(0b11011 + 0o32), 34983 - 34975), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\x6f' + chr(377 - 326) + chr(600 - 548) + chr(0b11111 + 0o30), 16399 - 16391), nzTpIcepk0o8(chr(0b110000) + chr(0b1100001 + 0o16) + '\x31' + chr(449 - 400) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(0b1011011 + 0o24) + chr(51) + chr(535 - 486), ord("\x08")), nzTpIcepk0o8(chr(0b111 + 0o51) + '\157' + chr(0b11001 + 0o30) + chr(0b10 + 0o61) + chr(0b1101 + 0o50), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31' + chr(54) + '\067', 11039 - 11031), nzTpIcepk0o8('\x30' + '\157' + chr(49) + chr(0b110001) + '\064', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111 + 0o0) + '\063' + '\x36' + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100001 + 0o21) + chr(1072 - 1024) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001 + 0o1) + '\x33' + '\067', ord("\x08")), nzTpIcepk0o8(chr(1447 - 1399) + '\x6f' + '\062' + '\x34' + '\x36', 35364 - 35356), nzTpIcepk0o8('\060' + chr(111) + chr(0b110101) + chr(0b110100), 3109 - 3101), nzTpIcepk0o8('\060' + '\157' + chr(0b110110) + chr(2489 - 2438), 0o10), nzTpIcepk0o8(chr(48) + chr(7685 - 7574) + chr(0b1110 + 0o44) + chr(54) + '\066', 23411 - 23403), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + chr(52) + chr(0b110101), 24433 - 24425), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001 + 0o2) + '\x31' + chr(0b101110 + 0o4), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + '\x33' + chr(520 - 471), 6793 - 6785), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1101111) + '\063' + chr(1959 - 1906) + chr(0b11011 + 0o25), 38688 - 38680), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + '\x30' + '\061', 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x31' + chr(55) + chr(0b11111 + 0o24), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(0b110111) + chr(132 - 80), 37586 - 37578), nzTpIcepk0o8('\x30' + chr(0b1100001 + 0o16) + chr(1971 - 1920) + chr(1048 - 995) + chr(1973 - 1922), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b111110 + 0o61) + '\x33' + chr(0b1110 + 0o51) + '\063', 23871 - 23863), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(48) + chr(0b100111 + 0o20), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(55) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(9629 - 9518) + chr(0b1110 + 0o44), 0o10), nzTpIcepk0o8(chr(1165 - 1117) + chr(10739 - 10628) + chr(0b110011) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\062' + '\x34' + chr(1559 - 1508), 40899 - 40891), nzTpIcepk0o8('\060' + chr(9459 - 9348) + chr(49) + '\x36' + chr(53), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(2142 - 2088) + chr(0b11010 + 0o33), 32390 - 32382), nzTpIcepk0o8('\x30' + chr(0b101100 + 0o103) + chr(0b1110 + 0o43) + chr(0b110101 + 0o0) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + chr(52) + chr(0b110110), 8), nzTpIcepk0o8(chr(2294 - 2246) + chr(0b1101111) + chr(582 - 533) + chr(0b100111 + 0o20) + '\x37', 0b1000), nzTpIcepk0o8(chr(1414 - 1366) + chr(0b1101111) + '\062' + chr(52) + '\x36', 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1000 + 0o53) + chr(1995 - 1942) + chr(0b1001 + 0o55), 0b1000), nzTpIcepk0o8('\x30' + chr(6728 - 6617) + '\x37' + chr(51), 0b1000), nzTpIcepk0o8(chr(513 - 465) + '\x6f' + chr(0b110011) + chr(0b1101 + 0o50) + '\x32', 19851 - 19843), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(111) + '\x32' + chr(0b1001 + 0o51), 0b1000), nzTpIcepk0o8('\060' + chr(8378 - 8267) + '\065' + chr(50), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + '\x35' + chr(0b111 + 0o51), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xbe'), chr(9504 - 9404) + chr(101) + chr(99) + chr(1472 - 1361) + '\144' + chr(8823 - 8722))(chr(0b1011110 + 0o27) + chr(0b1110100) + '\x66' + '\055' + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def A0gVABhHjc3L(hXMPsSrOQzbh, IPqqLes0fujA):
Ar0km3TBAurm = []
for r6Hvgey5P0gE in roI3spqORKae(IPqqLes0fujA, roI3spqORKae(ES5oEprVxulp(b'\xe3\xe8\x89:|3\x14)\x82'), chr(0b1100000 + 0o4) + '\x65' + '\143' + chr(9125 - 9014) + chr(0b11111 + 0o105) + chr(8168 - 8067))('\165' + chr(0b1110100) + chr(9585 - 9483) + chr(0b1000 + 0o45) + '\x38')):
zYyPFvgaRM12 = [h3Vc_4wxEbgd.feature_list() for h3Vc_4wxEbgd in r6Hvgey5P0gE]
icvpUPoDEWo8 = hXMPsSrOQzbh.tagger.A0gVABhHjc3L(zYyPFvgaRM12)
roI3spqORKae(Ar0km3TBAurm, roI3spqORKae(ES5oEprVxulp(b'\xd8\xd9\xb4za:0#\x9b\xee\xca\x93'), chr(2564 - 2464) + chr(3466 - 3365) + chr(0b1100011) + '\x6f' + '\144' + chr(1896 - 1795))(chr(3027 - 2910) + '\164' + '\x66' + chr(0b11010 + 0o23) + chr(0b101 + 0o63)))(icvpUPoDEWo8)
return Ar0km3TBAurm
|
estnltk/estnltk
|
estnltk/wiki/wikiextra.py
|
balancedSlicer
|
def balancedSlicer(text, openDelim='[', closeDelim=']'):
"""
Assuming that text contains a properly balanced expression using
:param openDelim: as opening delimiters and
:param closeDelim: as closing delimiters.
:return: text between the delimiters
"""
openbr = 0
cur = 0
for char in text:
cur +=1
if char == openDelim:
openbr += 1
if char == closeDelim:
openbr -= 1
if openbr == 0:
break
return text[:cur], cur
|
python
|
def balancedSlicer(text, openDelim='[', closeDelim=']'):
"""
Assuming that text contains a properly balanced expression using
:param openDelim: as opening delimiters and
:param closeDelim: as closing delimiters.
:return: text between the delimiters
"""
openbr = 0
cur = 0
for char in text:
cur +=1
if char == openDelim:
openbr += 1
if char == closeDelim:
openbr -= 1
if openbr == 0:
break
return text[:cur], cur
|
[
"def",
"balancedSlicer",
"(",
"text",
",",
"openDelim",
"=",
"'['",
",",
"closeDelim",
"=",
"']'",
")",
":",
"openbr",
"=",
"0",
"cur",
"=",
"0",
"for",
"char",
"in",
"text",
":",
"cur",
"+=",
"1",
"if",
"char",
"==",
"openDelim",
":",
"openbr",
"+=",
"1",
"if",
"char",
"==",
"closeDelim",
":",
"openbr",
"-=",
"1",
"if",
"openbr",
"==",
"0",
":",
"break",
"return",
"text",
"[",
":",
"cur",
"]",
",",
"cur"
] |
Assuming that text contains a properly balanced expression using
:param openDelim: as opening delimiters and
:param closeDelim: as closing delimiters.
:return: text between the delimiters
|
[
"Assuming",
"that",
"text",
"contains",
"a",
"properly",
"balanced",
"expression",
"using",
":",
"param",
"openDelim",
":",
"as",
"opening",
"delimiters",
"and",
":",
"param",
"closeDelim",
":",
"as",
"closing",
"delimiters",
".",
":",
"return",
":",
"text",
"between",
"the",
"delimiters"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wiki/wikiextra.py#L7-L24
|
train
|
Assuming that the text contains a properly balanced expression using
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuy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AOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(4569 - 4458) + '\063' + chr(396 - 345) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(1304 - 1256) + chr(0b101111 + 0o100) + '\062' + chr(0b101010 + 0o10), 0b1000), nzTpIcepk0o8(chr(1026 - 978) + chr(0b100101 + 0o112) + '\x32' + '\x37' + chr(0b1110 + 0o45), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1883 - 1831) + chr(49), 0b1000), nzTpIcepk0o8(chr(48) + chr(4639 - 4528) + '\x33' + chr(49) + chr(48), 0o10), nzTpIcepk0o8(chr(1937 - 1889) + '\x6f' + '\x31' + chr(1828 - 1779) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + '\066', 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\157' + chr(0b110001) + chr(0b110111) + chr(48), 0b1000), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(111) + '\067' + chr(54), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(1425 - 1374) + chr(51) + chr(2036 - 1987), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(1275 - 1226) + '\x34' + chr(0b1010 + 0o50), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b101 + 0o152) + chr(0b110111) + chr(48), 0o10), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(1432 - 1321) + '\x31' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(9166 - 9055) + chr(0b1011 + 0o50) + '\064' + '\x37', 12759 - 12751), nzTpIcepk0o8('\x30' + chr(0b10101 + 0o132) + chr(50) + chr(52) + chr(0b1 + 0o63), 50548 - 50540), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b1101111) + '\063' + '\x33' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(53) + chr(0b100000 + 0o26), 8226 - 8218), nzTpIcepk0o8(chr(48) + '\x6f' + '\x31' + chr(53) + chr(0b110100), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x33' + chr(49) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(9391 - 9280) + chr(49) + chr(294 - 243) + '\064', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + chr(0b10011 + 0o42) + chr(0b110110), 8), nzTpIcepk0o8('\060' + chr(0b1110 + 0o141) + chr(0b110011) + chr(1625 - 1575) + chr(1163 - 1109), 9478 - 9470), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(2061 - 1950) + '\062' + chr(0b110001) + '\x32', 60509 - 60501), nzTpIcepk0o8(chr(1858 - 1810) + chr(2431 - 2320) + '\061' + chr(55) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(7910 - 7799) + chr(2092 - 2042) + '\063' + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + '\x34' + chr(0b101011 + 0o14), 28738 - 28730), nzTpIcepk0o8(chr(48) + chr(0b1001010 + 0o45) + chr(794 - 744) + chr(51) + '\067', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(2199 - 2088) + chr(51) + chr(0b1110 + 0o51) + '\062', 17895 - 17887), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001) + '\x31' + '\062', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(50) + '\066' + chr(0b1111 + 0o47), ord("\x08")), nzTpIcepk0o8(chr(1261 - 1213) + chr(111) + chr(51) + '\x33' + chr(2400 - 2347), 8), nzTpIcepk0o8(chr(48) + '\x6f' + '\x31' + chr(0b101 + 0o56) + chr(0b11000 + 0o32), 262 - 254), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(0b1101111) + chr(0b110010) + chr(0b110110) + chr(51), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101001 + 0o6) + '\x34' + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1293 - 1243) + '\066' + chr(806 - 751), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9292 - 9181) + chr(50) + chr(50) + chr(0b1000 + 0o52), ord("\x08")), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(0b1000 + 0o147) + chr(49) + '\x34' + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(1207 - 1096) + chr(1219 - 1168) + '\064' + chr(1020 - 966), 18719 - 18711)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(308 - 260) + '\x6f' + chr(1169 - 1116) + chr(48), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf5'), chr(0b10 + 0o142) + '\145' + chr(1570 - 1471) + chr(111) + chr(0b110000 + 0o64) + chr(101))(chr(0b1110101) + '\164' + chr(0b1011100 + 0o12) + chr(45) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def ggI0V2VIvPr1(cpStk7cY1TJd, CJrzRql3vG4K=roI3spqORKae(ES5oEprVxulp(b'\x80'), chr(8261 - 8161) + '\145' + '\x63' + '\157' + chr(8385 - 8285) + chr(101))(chr(117) + chr(11146 - 11030) + chr(2471 - 2369) + '\x2d' + '\070'), iPDsBYIfvtpR=roI3spqORKae(ES5oEprVxulp(b'\x86'), chr(0b1000010 + 0o42) + '\x65' + '\x63' + '\x6f' + chr(7425 - 7325) + '\x65')(chr(0b1110101) + chr(116) + '\x66' + chr(45) + chr(0b111000))):
qsto4Uxy_j5y = nzTpIcepk0o8(chr(48) + chr(6648 - 6537) + '\x30', 0o10)
_1pmtMrnaouX = nzTpIcepk0o8(chr(983 - 935) + chr(0b1101111) + '\x30', 8)
for JZZiMnH571E1 in cpStk7cY1TJd:
_1pmtMrnaouX += nzTpIcepk0o8('\x30' + '\x6f' + chr(1831 - 1782), 0o10)
if JZZiMnH571E1 == CJrzRql3vG4K:
qsto4Uxy_j5y += nzTpIcepk0o8(chr(0b101010 + 0o6) + '\157' + chr(0b0 + 0o61), 8)
if JZZiMnH571E1 == iPDsBYIfvtpR:
qsto4Uxy_j5y -= nzTpIcepk0o8(chr(48) + chr(12104 - 11993) + chr(49), 8)
if qsto4Uxy_j5y == nzTpIcepk0o8(chr(48) + '\x6f' + '\x30', 8):
break
return (cpStk7cY1TJd[:_1pmtMrnaouX], _1pmtMrnaouX)
|
estnltk/estnltk
|
estnltk/wiki/convert.py
|
json_2_text
|
def json_2_text(inp, out, verbose = False):
"""Convert a Wikipedia article to Text object.
Concatenates the sections in wikipedia file and rearranges other information so it
can be interpreted as a Text object.
Links and other elements with start and end positions are annotated
as layers.
Parameters
----------
inp: directory of parsed et.wikipedia articles in json format
out: output directory of .txt files
verbose: if True, prints every article title and total count of converted files
if False prints every 50th count
Returns
-------
estnltk.text.Text
The Text object.
"""
for root, dirs, filenames in os.walk(inp):
for f in filenames:
log = codecs.open(os.path.join(root, f), 'r')
j_obj = json.load(log)
j_obj = json_format(j_obj)
#not needed, cause the json_format takes care of the right structuring
#text = Text(j_obj)
textWriter(j_obj, out, verbose)
|
python
|
def json_2_text(inp, out, verbose = False):
"""Convert a Wikipedia article to Text object.
Concatenates the sections in wikipedia file and rearranges other information so it
can be interpreted as a Text object.
Links and other elements with start and end positions are annotated
as layers.
Parameters
----------
inp: directory of parsed et.wikipedia articles in json format
out: output directory of .txt files
verbose: if True, prints every article title and total count of converted files
if False prints every 50th count
Returns
-------
estnltk.text.Text
The Text object.
"""
for root, dirs, filenames in os.walk(inp):
for f in filenames:
log = codecs.open(os.path.join(root, f), 'r')
j_obj = json.load(log)
j_obj = json_format(j_obj)
#not needed, cause the json_format takes care of the right structuring
#text = Text(j_obj)
textWriter(j_obj, out, verbose)
|
[
"def",
"json_2_text",
"(",
"inp",
",",
"out",
",",
"verbose",
"=",
"False",
")",
":",
"for",
"root",
",",
"dirs",
",",
"filenames",
"in",
"os",
".",
"walk",
"(",
"inp",
")",
":",
"for",
"f",
"in",
"filenames",
":",
"log",
"=",
"codecs",
".",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"f",
")",
",",
"'r'",
")",
"j_obj",
"=",
"json",
".",
"load",
"(",
"log",
")",
"j_obj",
"=",
"json_format",
"(",
"j_obj",
")",
"#not needed, cause the json_format takes care of the right structuring",
"#text = Text(j_obj)",
"textWriter",
"(",
"j_obj",
",",
"out",
",",
"verbose",
")"
] |
Convert a Wikipedia article to Text object.
Concatenates the sections in wikipedia file and rearranges other information so it
can be interpreted as a Text object.
Links and other elements with start and end positions are annotated
as layers.
Parameters
----------
inp: directory of parsed et.wikipedia articles in json format
out: output directory of .txt files
verbose: if True, prints every article title and total count of converted files
if False prints every 50th count
Returns
-------
estnltk.text.Text
The Text object.
|
[
"Convert",
"a",
"Wikipedia",
"article",
"to",
"Text",
"object",
".",
"Concatenates",
"the",
"sections",
"in",
"wikipedia",
"file",
"and",
"rearranges",
"other",
"information",
"so",
"it",
"can",
"be",
"interpreted",
"as",
"a",
"Text",
"object",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wiki/convert.py#L95-L126
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WkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\060' + '\x35', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x33' + '\x30' + '\062', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + '\x32' + chr(0b11 + 0o61), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(2433 - 2382) + chr(50) + chr(1635 - 1580), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1765 - 1716) + chr(1427 - 1372) + '\x37', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1010111 + 0o30) + '\061' + '\063' + '\066', 0o10), nzTpIcepk0o8(chr(1662 - 1614) + chr(0b1101111) + chr(0b110001) + chr(0b110001) + chr(51), 0b1000), nzTpIcepk0o8(chr(2149 - 2101) + chr(111) + chr(0b1010 + 0o51) + '\x36' + '\x32', 20192 - 20184), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b10 + 0o155) + '\x33' + chr(0b101011 + 0o10) + chr(641 - 589), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(51) + chr(371 - 317) + chr(1993 - 1940), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101 + 0o55) + '\066' + chr(54), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(49) + chr(1395 - 1344) + chr(828 - 776), 0o10), nzTpIcepk0o8(chr(1300 - 1252) + chr(111) + chr(0b11001 + 0o32) + chr(52) + '\064', 16837 - 16829), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + '\x36' + chr(54), 0b1000), nzTpIcepk0o8(chr(940 - 892) + '\157' + chr(0b110001) + chr(54) + chr(0b110000), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(52) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + '\061' + chr(1350 - 1299) + chr(0b110001), 42704 - 42696), nzTpIcepk0o8('\060' + chr(5522 - 5411) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(111) + '\061' + '\063' + chr(0b110100), 8), nzTpIcepk0o8('\x30' + chr(6383 - 6272) + chr(0b110001) + '\x36' + '\x32', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001 + 0o0) + '\x32' + chr(0b101010 + 0o13), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + chr(0b10011 + 0o41) + chr(1261 - 1211), 1618 - 1610), nzTpIcepk0o8(chr(0b110000) + chr(3323 - 3212) + chr(50) + chr(0b11011 + 0o32) + '\x32', 41046 - 41038), nzTpIcepk0o8('\x30' + chr(10951 - 10840) + chr(0b110001) + '\061' + chr(0b1110 + 0o50), 0b1000), nzTpIcepk0o8(chr(373 - 325) + chr(0b1101111) + chr(49) + chr(477 - 429) + chr(0b110100), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(0b110010) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(714 - 666) + chr(111) + '\x32' + chr(0b11111 + 0o23) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(1794 - 1683) + '\063' + chr(0b110010) + chr(0b1110 + 0o46), 8), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(9600 - 9489) + chr(51) + '\063' + '\066', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b101111 + 0o3) + chr(0b1 + 0o61) + chr(54), 0b1000), nzTpIcepk0o8(chr(609 - 561) + '\157' + chr(0b1111 + 0o42) + '\067', 5932 - 5924), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b1010101 + 0o32) + chr(0b110101) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(1040 - 992) + chr(8612 - 8501) + '\x32' + chr(275 - 222) + chr(0b11000 + 0o31), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011) + chr(51) + chr(1143 - 1090), 27731 - 27723), nzTpIcepk0o8('\060' + chr(0b110011 + 0o74) + chr(51) + chr(0b10 + 0o61) + '\062', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(514 - 462), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2530 - 2478) + chr(0b1110 + 0o42), 0b1000), nzTpIcepk0o8('\x30' + chr(4764 - 4653) + '\x33' + chr(0b100100 + 0o23) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b11011 + 0o32) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(1754 - 1643) + chr(220 - 170) + '\x34' + chr(48), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b100111 + 0o16) + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xeb'), chr(1182 - 1082) + '\x65' + chr(2988 - 2889) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(0b1000100 + 0o61) + chr(0b110011 + 0o101) + chr(0b1010 + 0o134) + chr(0b101101) + chr(2986 - 2930)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def dDquc5gjdIgz(kTVXhBR0AFNQ, VwOu8WkJ9cpc, TseISVdPlfdM=nzTpIcepk0o8(chr(48) + chr(0b101111 + 0o100) + '\x30', 0o10)):
for (kF9CWBi2ucGu, VNlxNzbaDsmx, EXVYY4cgQiXQ) in roI3spqORKae(aHUqKstZLeS6, roI3spqORKae(ES5oEprVxulp(b'\x8f\x8f\x82\xa4\x15o\x0e\xa3\x88\x80\xd9\x06'), chr(3131 - 3031) + chr(1960 - 1859) + chr(9333 - 9234) + chr(5271 - 5160) + '\144' + chr(0b1100100 + 0o1))('\165' + chr(116) + chr(1882 - 1780) + '\x2d' + '\070'))(kTVXhBR0AFNQ):
for _R8IKF5IwAfX in EXVYY4cgQiXQ:
lmiGj7TonZgV = Hj8X5RtMNBIn.DnU3Rq9N5ala(aHUqKstZLeS6.path.Y4yM9BcfTCNq(kF9CWBi2ucGu, _R8IKF5IwAfX), roI3spqORKae(ES5oEprVxulp(b'\xb7'), '\x64' + chr(6374 - 6273) + '\x63' + chr(0b1101111) + chr(2240 - 2140) + chr(540 - 439))('\165' + chr(0b1110100) + chr(0b11 + 0o143) + '\055' + '\070'))
sDHW_c8hfIes = LNUKEwZDIbyb.ZERsdc7c1d8E(lmiGj7TonZgV)
sDHW_c8hfIes = OkNFynlp5yyW(sDHW_c8hfIes)
fxKNqIKRib6H(sDHW_c8hfIes, VwOu8WkJ9cpc, TseISVdPlfdM)
|
estnltk/estnltk
|
estnltk/grammar/match.py
|
concatenate_matches
|
def concatenate_matches(a, b, text, name):
"""Concatenate matches a and b.
All submatches will be copied to result."""
match = Match(a.start, b.end, text[a.start:b.end], name)
for k, v in a.matches.items():
match.matches[k] = v
for k, v in b.matches.items():
match.matches[k] = v
if a.name is not None:
aa = copy(a)
del aa[MATCHES]
match.matches[a.name] = aa
if b.name is not None:
bb = copy(b)
del bb[MATCHES]
match.matches[b.name] = bb
return match
|
python
|
def concatenate_matches(a, b, text, name):
"""Concatenate matches a and b.
All submatches will be copied to result."""
match = Match(a.start, b.end, text[a.start:b.end], name)
for k, v in a.matches.items():
match.matches[k] = v
for k, v in b.matches.items():
match.matches[k] = v
if a.name is not None:
aa = copy(a)
del aa[MATCHES]
match.matches[a.name] = aa
if b.name is not None:
bb = copy(b)
del bb[MATCHES]
match.matches[b.name] = bb
return match
|
[
"def",
"concatenate_matches",
"(",
"a",
",",
"b",
",",
"text",
",",
"name",
")",
":",
"match",
"=",
"Match",
"(",
"a",
".",
"start",
",",
"b",
".",
"end",
",",
"text",
"[",
"a",
".",
"start",
":",
"b",
".",
"end",
"]",
",",
"name",
")",
"for",
"k",
",",
"v",
"in",
"a",
".",
"matches",
".",
"items",
"(",
")",
":",
"match",
".",
"matches",
"[",
"k",
"]",
"=",
"v",
"for",
"k",
",",
"v",
"in",
"b",
".",
"matches",
".",
"items",
"(",
")",
":",
"match",
".",
"matches",
"[",
"k",
"]",
"=",
"v",
"if",
"a",
".",
"name",
"is",
"not",
"None",
":",
"aa",
"=",
"copy",
"(",
"a",
")",
"del",
"aa",
"[",
"MATCHES",
"]",
"match",
".",
"matches",
"[",
"a",
".",
"name",
"]",
"=",
"aa",
"if",
"b",
".",
"name",
"is",
"not",
"None",
":",
"bb",
"=",
"copy",
"(",
"b",
")",
"del",
"bb",
"[",
"MATCHES",
"]",
"match",
".",
"matches",
"[",
"b",
".",
"name",
"]",
"=",
"bb",
"return",
"match"
] |
Concatenate matches a and b.
All submatches will be copied to result.
|
[
"Concatenate",
"matches",
"a",
"and",
"b",
".",
"All",
"submatches",
"will",
"be",
"copied",
"to",
"result",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/grammar/match.py#L81-L97
|
train
|
Concatenate matches a and b.
All submatches will be copied to result.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1V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H_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(53) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(50) + chr(1166 - 1112), 17353 - 17345), nzTpIcepk0o8(chr(1003 - 955) + '\x6f' + chr(2465 - 2415) + '\064' + '\061', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + '\063' + chr(598 - 546), 0b1000), nzTpIcepk0o8(chr(0b11100 + 0o24) + '\x6f' + '\063' + chr(55) + '\062', 0b1000), nzTpIcepk0o8(chr(2286 - 2238) + chr(111) + '\062', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(51) + '\062' + '\062', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1011111 + 0o20) + chr(0b110010) + '\062' + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + '\066' + chr(0b110010), 3618 - 3610), nzTpIcepk0o8('\060' + chr(0b1101111) + '\062' + chr(0b100011 + 0o17) + '\x30', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\062' + chr(594 - 546) + '\060', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b11100 + 0o31) + chr(50), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(49) + '\063', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + chr(0b110100) + chr(1858 - 1805), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(154 - 99), 0o10), nzTpIcepk0o8('\x30' + chr(382 - 271) + chr(0b110010) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(1417 - 1369) + '\157' + chr(0b11110 + 0o24) + '\063' + chr(0b110010 + 0o4), 55062 - 55054), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(1950 - 1897) + chr(50), 8), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(2522 - 2411) + '\x33' + '\066' + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(54 - 6) + chr(111) + chr(50) + '\060' + chr(1413 - 1364), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110011) + '\x33' + chr(0b11011 + 0o33), 40230 - 40222), nzTpIcepk0o8('\060' + chr(111) + chr(717 - 667) + chr(54) + '\066', 51103 - 51095), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1192 - 1141) + chr(55) + chr(50), 8), nzTpIcepk0o8(chr(48) + chr(10508 - 10397) + chr(50) + chr(0b110110) + '\066', 8), nzTpIcepk0o8('\x30' + '\157' + '\x31' + chr(0b11001 + 0o27) + chr(2126 - 2071), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110110) + chr(0b101110 + 0o7), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(375 - 325) + chr(53) + '\x33', ord("\x08")), nzTpIcepk0o8('\060' + chr(3311 - 3200) + chr(1949 - 1900) + chr(1332 - 1279) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + chr(1812 - 1762), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + '\061' + '\064', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(9741 - 9630) + chr(0b1101 + 0o52) + chr(0b1110 + 0o51), 388 - 380), nzTpIcepk0o8('\060' + '\157' + chr(1288 - 1239) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\x6f' + chr(433 - 379) + chr(721 - 670), 39707 - 39699), nzTpIcepk0o8(chr(0b110000) + chr(5480 - 5369) + chr(0b10111 + 0o34) + chr(0b110110) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(4899 - 4788) + chr(0b110001) + chr(270 - 216) + chr(0b11001 + 0o30), 0o10), nzTpIcepk0o8(chr(1665 - 1617) + '\x6f' + chr(0b1001 + 0o56) + '\063', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + '\063' + chr(0b11101 + 0o24), 0o10), nzTpIcepk0o8(chr(0b101 + 0o53) + '\x6f' + chr(0b110001) + chr(51) + '\x34', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1653 - 1603) + chr(55) + chr(0b100000 + 0o20), 0o10), nzTpIcepk0o8(chr(0b100 + 0o54) + '\157' + chr(0b110011) + chr(2657 - 2602) + chr(1738 - 1689), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1566 - 1518) + chr(0b1100100 + 0o13) + chr(0b101010 + 0o13) + chr(442 - 394), 13773 - 13765)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x84'), '\x64' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(6421 - 6320))(chr(0b1110101) + chr(116) + chr(0b100111 + 0o77) + chr(240 - 195) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def WyccldUsdvwd(AQ9ceR9AaoT1, xFDEVQn5qSdh, cpStk7cY1TJd, SLVB2BPA_mIe):
hk9OijmiC_zA = jwDUkurdAiaa(AQ9ceR9AaoT1.KQbHFTcl_LKy, xFDEVQn5qSdh.NiWVjAWn0l6T, cpStk7cY1TJd[AQ9ceR9AaoT1.KQbHFTcl_LKy:xFDEVQn5qSdh.NiWVjAWn0l6T], SLVB2BPA_mIe)
for (B6UAF1zReOyJ, r7AA1pbLjb44) in roI3spqORKae(AQ9ceR9AaoT1.matches, roI3spqORKae(ES5oEprVxulp(b'\xf3\xc9\xcf\x92\xbfx\x9a\xa3\xc1\xe6\xd8C'), chr(6603 - 6503) + '\145' + chr(0b1100011) + chr(111) + chr(9644 - 9544) + chr(101))(chr(0b101110 + 0o107) + chr(0b101 + 0o157) + chr(102) + chr(0b101101) + '\070'))():
hk9OijmiC_zA.ONopK8INb53O[B6UAF1zReOyJ] = r7AA1pbLjb44
for (B6UAF1zReOyJ, r7AA1pbLjb44) in roI3spqORKae(xFDEVQn5qSdh.matches, roI3spqORKae(ES5oEprVxulp(b'\xf3\xc9\xcf\x92\xbfx\x9a\xa3\xc1\xe6\xd8C'), chr(0b1100100) + '\145' + chr(2505 - 2406) + chr(11870 - 11759) + chr(1476 - 1376) + chr(101))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(45) + '\070'))():
hk9OijmiC_zA.ONopK8INb53O[B6UAF1zReOyJ] = r7AA1pbLjb44
if roI3spqORKae(AQ9ceR9AaoT1, roI3spqORKae(ES5oEprVxulp(b'\xf9\xda\xf7\x9e\xc8@\x82\xd6\xad\xfd\xc9O'), chr(100) + '\x65' + chr(0b1010101 + 0o16) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\165' + chr(116) + chr(0b110111 + 0o57) + chr(45) + chr(2464 - 2408))) is not None:
fy6epjHXMeZ_ = aZTCj4v5QdfO(AQ9ceR9AaoT1)
del fy6epjHXMeZ_[pyTjj0L690y2]
hk9OijmiC_zA.ONopK8INb53O[AQ9ceR9AaoT1.SLVB2BPA_mIe] = fy6epjHXMeZ_
if roI3spqORKae(xFDEVQn5qSdh, roI3spqORKae(ES5oEprVxulp(b'\xf9\xda\xf7\x9e\xc8@\x82\xd6\xad\xfd\xc9O'), '\144' + chr(0b1100001 + 0o4) + '\143' + chr(495 - 384) + '\144' + '\x65')(chr(0b11011 + 0o132) + '\164' + chr(102) + chr(0b100 + 0o51) + chr(56))) is not None:
kM5lBX4RwRmQ = aZTCj4v5QdfO(xFDEVQn5qSdh)
del kM5lBX4RwRmQ[pyTjj0L690y2]
hk9OijmiC_zA.ONopK8INb53O[xFDEVQn5qSdh.SLVB2BPA_mIe] = kM5lBX4RwRmQ
return hk9OijmiC_zA
|
estnltk/estnltk
|
estnltk/grammar/match.py
|
Match.dict
|
def dict(self):
"""Dictionary representing this match and all child symbol matches."""
res = copy(self)
if MATCHES in res:
del res[MATCHES]
if NAME in res:
del res[NAME]
res = {self.name: res}
for k, v in self.matches.items():
res[k] = v
if NAME in res[k]:
del res[k][NAME]
return res
|
python
|
def dict(self):
"""Dictionary representing this match and all child symbol matches."""
res = copy(self)
if MATCHES in res:
del res[MATCHES]
if NAME in res:
del res[NAME]
res = {self.name: res}
for k, v in self.matches.items():
res[k] = v
if NAME in res[k]:
del res[k][NAME]
return res
|
[
"def",
"dict",
"(",
"self",
")",
":",
"res",
"=",
"copy",
"(",
"self",
")",
"if",
"MATCHES",
"in",
"res",
":",
"del",
"res",
"[",
"MATCHES",
"]",
"if",
"NAME",
"in",
"res",
":",
"del",
"res",
"[",
"NAME",
"]",
"res",
"=",
"{",
"self",
".",
"name",
":",
"res",
"}",
"for",
"k",
",",
"v",
"in",
"self",
".",
"matches",
".",
"items",
"(",
")",
":",
"res",
"[",
"k",
"]",
"=",
"v",
"if",
"NAME",
"in",
"res",
"[",
"k",
"]",
":",
"del",
"res",
"[",
"k",
"]",
"[",
"NAME",
"]",
"return",
"res"
] |
Dictionary representing this match and all child symbol matches.
|
[
"Dictionary",
"representing",
"this",
"match",
"and",
"all",
"child",
"symbol",
"matches",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/grammar/match.py#L54-L66
|
train
|
Dictionary representing this match and all child symbol matches.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHl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2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\157' + '\066' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b10 + 0o56) + '\157' + '\063' + chr(858 - 808) + chr(0b101010 + 0o11), 6737 - 6729), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(0b1100001 + 0o16) + chr(0b11101 + 0o32) + chr(130 - 79), 0b1000), nzTpIcepk0o8(chr(1544 - 1496) + chr(111) + chr(50) + chr(0b11 + 0o60) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(5865 - 5754) + '\x31' + chr(0b110111) + '\x32', 31650 - 31642), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1614 - 1565) + chr(0b110001), 30359 - 30351), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2455 - 2400) + '\063', 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(59 - 9) + chr(2108 - 2059) + chr(1526 - 1478), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + chr(2232 - 2179) + chr(1474 - 1424), 1168 - 1160), nzTpIcepk0o8('\060' + chr(9765 - 9654) + '\063' + chr(50) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(2046 - 1995) + chr(0b1100 + 0o53) + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(0b1101100 + 0o3) + chr(0b101101 + 0o5) + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + '\x30' + chr(2369 - 2314), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(1468 - 1419) + chr(0b110000) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(0b10111 + 0o31) + chr(49), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110001) + chr(1794 - 1741) + chr(55), 0o10), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b1011010 + 0o25) + chr(0b110111) + '\061', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(51) + '\064' + chr(0b100100 + 0o14), 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(0b1101111) + chr(0b100011 + 0o16) + '\x36' + chr(0b101000 + 0o10), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(960 - 909) + chr(1995 - 1947) + '\063', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + chr(0b10101 + 0o34) + chr(1460 - 1408), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(50) + chr(0b10110 + 0o40) + '\x31', 0b1000), nzTpIcepk0o8(chr(921 - 873) + '\x6f' + '\x31' + '\x33' + '\061', ord("\x08")), nzTpIcepk0o8(chr(1810 - 1762) + chr(8712 - 8601) + chr(0b110011) + chr(0b110100) + chr(0b110010), 55497 - 55489), nzTpIcepk0o8(chr(0b110000) + chr(0b1101100 + 0o3) + chr(0b11110 + 0o24) + chr(0b110110) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(1312 - 1264) + chr(0b1101111) + '\x35', 680 - 672), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(672 - 623) + chr(0b110110) + chr(0b100 + 0o61), 0o10), nzTpIcepk0o8('\x30' + chr(0b111010 + 0o65) + chr(0b101010 + 0o10) + '\063' + chr(52), 8), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(1288 - 1177) + '\x32' + chr(151 - 96) + chr(51), 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1011001 + 0o26) + '\061' + chr(0b10100 + 0o34) + chr(0b101010 + 0o7), 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + '\060' + chr(391 - 337), 0o10), nzTpIcepk0o8('\060' + chr(3414 - 3303) + chr(0b110110) + chr(0b10100 + 0o36), 60470 - 60462), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + chr(0b101111 + 0o3) + '\x33' + chr(2032 - 1980), 8), nzTpIcepk0o8('\060' + '\157' + chr(877 - 828) + '\x31', 8), nzTpIcepk0o8('\x30' + chr(3784 - 3673) + chr(0b110001) + chr(0b110111) + '\x33', 0o10), nzTpIcepk0o8(chr(84 - 36) + '\x6f' + '\062' + chr(0b10011 + 0o41), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\063' + '\x33' + chr(2303 - 2254), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\061' + chr(0b10111 + 0o40) + chr(0b11101 + 0o30), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + chr(0b1111 + 0o43) + chr(0b11001 + 0o27), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110001) + chr(534 - 482), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\157' + '\065' + chr(0b110000), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x1d'), chr(0b1011101 + 0o7) + chr(3187 - 3086) + chr(99) + chr(12117 - 12006) + '\144' + chr(0b1100001 + 0o4))('\x75' + '\x74' + chr(102) + chr(0b101101) + chr(0b100100 + 0o24)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def znjnJWK64FDT(hXMPsSrOQzbh):
_XdQFJpnzJor = aZTCj4v5QdfO(hXMPsSrOQzbh)
if pyTjj0L690y2 in _XdQFJpnzJor:
del _XdQFJpnzJor[pyTjj0L690y2]
if dxNj2NmuD7Sz in _XdQFJpnzJor:
del _XdQFJpnzJor[dxNj2NmuD7Sz]
_XdQFJpnzJor = {hXMPsSrOQzbh.SLVB2BPA_mIe: _XdQFJpnzJor}
for (B6UAF1zReOyJ, r7AA1pbLjb44) in roI3spqORKae(hXMPsSrOQzbh.matches, roI3spqORKae(ES5oEprVxulp(b'j\x8cU\xd2?ss\xbc\xd9\xa7\xa0x'), chr(0b1000000 + 0o44) + chr(101) + '\x63' + chr(0b111011 + 0o64) + chr(100) + chr(0b1100101))(chr(0b110101 + 0o100) + chr(4308 - 4192) + chr(547 - 445) + '\x2d' + '\070'))():
_XdQFJpnzJor[B6UAF1zReOyJ] = r7AA1pbLjb44
if dxNj2NmuD7Sz in _XdQFJpnzJor[B6UAF1zReOyJ]:
del _XdQFJpnzJor[B6UAF1zReOyJ][dxNj2NmuD7Sz]
return _XdQFJpnzJor
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
regex_from_markers
|
def regex_from_markers(markers):
"""Given a string of characters, construct a regex that matches them.
Parameters
----------
markers: str
The list of string containing the markers
Returns
-------
regex
The regular expression matching the given markers.
"""
return re.compile('|'.join([re.escape(c) for c in markers]))
|
python
|
def regex_from_markers(markers):
"""Given a string of characters, construct a regex that matches them.
Parameters
----------
markers: str
The list of string containing the markers
Returns
-------
regex
The regular expression matching the given markers.
"""
return re.compile('|'.join([re.escape(c) for c in markers]))
|
[
"def",
"regex_from_markers",
"(",
"markers",
")",
":",
"return",
"re",
".",
"compile",
"(",
"'|'",
".",
"join",
"(",
"[",
"re",
".",
"escape",
"(",
"c",
")",
"for",
"c",
"in",
"markers",
"]",
")",
")"
] |
Given a string of characters, construct a regex that matches them.
Parameters
----------
markers: str
The list of string containing the markers
Returns
-------
regex
The regular expression matching the given markers.
|
[
"Given",
"a",
"string",
"of",
"characters",
"construct",
"a",
"regex",
"that",
"matches",
"them",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L45-L58
|
train
|
Given a string of characters construct a regular expression that matches them.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJ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fYi7uj_uC,TVUhqOt5_BbS,WtdkIpFeYozM,MdkNqd1bagO6,QNQS9e6tJqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(719 - 671) + '\x6f' + chr(0b10001 + 0o41) + chr(51) + chr(2926 - 2871), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1100000 + 0o17) + chr(676 - 627) + chr(55) + chr(0b110011 + 0o1), 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b1100010 + 0o15) + '\x36' + chr(52), 0o10), nzTpIcepk0o8(chr(48) + chr(2483 - 2372) + chr(0b100000 + 0o23) + chr(0b110100 + 0o1) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + '\x32' + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(50) + '\x37' + chr(0b1100 + 0o47), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + chr(0b100011 + 0o16), 0o10), nzTpIcepk0o8(chr(645 - 597) + chr(0b1101111) + chr(0b100001 + 0o20) + chr(48) + chr(1716 - 1667), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\061' + '\063', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b111111 + 0o60) + '\061' + chr(0b110100) + '\062', 0o10), nzTpIcepk0o8(chr(1798 - 1750) + chr(111) + chr(49) + '\066' + '\061', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + chr(48) + chr(50), 47310 - 47302), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(0b110011) + chr(0b11010 + 0o30), 47551 - 47543), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + chr(0b110011) + chr(1534 - 1485), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x35' + chr(0b0 + 0o63), 30414 - 30406), nzTpIcepk0o8(chr(633 - 585) + chr(0b1001011 + 0o44) + chr(2053 - 1998) + '\x36', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1100 + 0o47) + '\067' + chr(0b110110), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(50) + chr(51) + chr(2049 - 1999), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(12035 - 11924) + '\x32' + chr(0b11001 + 0o32), 8), nzTpIcepk0o8(chr(650 - 602) + chr(10395 - 10284) + '\x31' + chr(55) + '\x36', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b111011 + 0o64) + chr(0b10100 + 0o43) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111) + '\061' + chr(0b10110 + 0o36) + '\x36', 19290 - 19282), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(50) + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b100100 + 0o17) + chr(0b110011) + '\067', 29894 - 29886), nzTpIcepk0o8('\060' + chr(5044 - 4933) + '\061' + chr(0b11101 + 0o32) + chr(51), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110111) + chr(0b1110 + 0o50), 8), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + '\x32' + '\x34', 8), nzTpIcepk0o8('\060' + chr(0b1001000 + 0o47) + chr(52) + chr(1567 - 1512), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + '\x35', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b101100 + 0o103) + '\x31' + '\x37' + chr(0b1111 + 0o42), ord("\x08")), nzTpIcepk0o8('\060' + chr(2473 - 2362) + '\x31' + '\x34' + chr(54), 8), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + chr(0b1 + 0o61) + chr(0b11100 + 0o32), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(680 - 631) + '\x34' + chr(49), 58439 - 58431), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b11101 + 0o26) + chr(0b101100 + 0o11) + '\065', 0o10), nzTpIcepk0o8(chr(2249 - 2201) + chr(3252 - 3141) + '\061' + chr(897 - 848) + chr(0b101000 + 0o16), 60758 - 60750), nzTpIcepk0o8('\x30' + '\157' + '\x31' + '\066' + '\062', 0o10), nzTpIcepk0o8(chr(716 - 668) + '\x6f' + '\x32' + chr(725 - 676), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(0b110101) + chr(0b101010 + 0o13), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\062' + chr(1487 - 1435) + '\x30', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(7350 - 7239) + chr(0b1001 + 0o54) + chr(0b110000), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb1'), chr(100) + chr(101) + chr(5715 - 5616) + chr(111) + chr(5213 - 5113) + chr(0b1100101))(chr(0b10001 + 0o144) + '\x74' + '\146' + '\055' + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def LQ97EtQM364H(KUAb0oPq1zJV):
return roI3spqORKae(aoTc4YA2bs2R, roI3spqORKae(ES5oEprVxulp(b'\xfc\x13Y\x9a\xfb\xd7t'), '\144' + chr(0b101010 + 0o73) + '\x63' + '\x6f' + chr(6072 - 5972) + '\145')(chr(7964 - 7847) + chr(0b1100101 + 0o17) + chr(0b1100110) + chr(720 - 675) + chr(56)))(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xe3'), chr(0b1100100) + chr(0b10001 + 0o124) + chr(0b11001 + 0o112) + chr(0b1000010 + 0o55) + chr(0b1100100) + chr(0b110011 + 0o62))('\165' + chr(116) + '\146' + '\055' + chr(2886 - 2830)), roI3spqORKae(ES5oEprVxulp(b"\xc6HM\xa7\xab\xf9r'\x9f!?\xf3"), chr(0b101001 + 0o73) + chr(2069 - 1968) + '\x63' + chr(111) + chr(4789 - 4689) + chr(101))(chr(0b101111 + 0o106) + chr(12079 - 11963) + '\x66' + chr(0b100000 + 0o15) + chr(1459 - 1403)))([roI3spqORKae(aoTc4YA2bs2R, roI3spqORKae(ES5oEprVxulp(b'\xf3\x1ar\x8c\xa3\xf2&r\x9b&+\xf4'), chr(0b101111 + 0o65) + '\145' + chr(4099 - 4000) + '\x6f' + chr(0b1000000 + 0o44) + '\x65')(chr(117) + '\164' + chr(0b1011001 + 0o15) + chr(614 - 569) + chr(56)))(teUmM7cKWZUa) for teUmM7cKWZUa in KUAb0oPq1zJV]))
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
convert
|
def convert(word):
"""This method converts given `word` to UTF-8 encoding and `bytes` type for the
SWIG wrapper."""
if six.PY2:
if isinstance(word, unicode):
return word.encode('utf-8')
else:
return word.decode('utf-8').encode('utf-8') # make sure it is real utf8, otherwise complain
else: # ==> Py3
if isinstance(word, bytes):
return word.decode('utf-8') # bytes must be in utf8
return word
|
python
|
def convert(word):
"""This method converts given `word` to UTF-8 encoding and `bytes` type for the
SWIG wrapper."""
if six.PY2:
if isinstance(word, unicode):
return word.encode('utf-8')
else:
return word.decode('utf-8').encode('utf-8') # make sure it is real utf8, otherwise complain
else: # ==> Py3
if isinstance(word, bytes):
return word.decode('utf-8') # bytes must be in utf8
return word
|
[
"def",
"convert",
"(",
"word",
")",
":",
"if",
"six",
".",
"PY2",
":",
"if",
"isinstance",
"(",
"word",
",",
"unicode",
")",
":",
"return",
"word",
".",
"encode",
"(",
"'utf-8'",
")",
"else",
":",
"return",
"word",
".",
"decode",
"(",
"'utf-8'",
")",
".",
"encode",
"(",
"'utf-8'",
")",
"# make sure it is real utf8, otherwise complain",
"else",
":",
"# ==> Py3",
"if",
"isinstance",
"(",
"word",
",",
"bytes",
")",
":",
"return",
"word",
".",
"decode",
"(",
"'utf-8'",
")",
"# bytes must be in utf8",
"return",
"word"
] |
This method converts given `word` to UTF-8 encoding and `bytes` type for the
SWIG wrapper.
|
[
"This",
"method",
"converts",
"given",
"word",
"to",
"UTF",
"-",
"8",
"encoding",
"and",
"bytes",
"type",
"for",
"the",
"SWIG",
"wrapper",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc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zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(164 - 53) + chr(2170 - 2121) + chr(2367 - 2314) + '\x31', 0b1000), nzTpIcepk0o8(chr(2218 - 2170) + chr(111) + chr(0b110011) + '\066' + chr(888 - 840), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(0b110111) + chr(0b100011 + 0o17), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(330 - 280) + chr(1912 - 1861) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(1940 - 1892) + '\x6f' + '\062' + chr(0b100111 + 0o14), 0o10), nzTpIcepk0o8(chr(1109 - 1061) + chr(0b1001011 + 0o44) + chr(0b10010 + 0o40) + chr(532 - 483) + chr(0b110001), 57593 - 57585), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1104 - 1054) + chr(0b110101) + '\067', 0b1000), nzTpIcepk0o8(chr(1729 - 1681) + '\157' + chr(998 - 949) + chr(0b110101) + '\065', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\x36' + '\065', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(50) + '\x33' + chr(2919 - 2864), 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(111) + chr(0b110011) + '\x34' + chr(0b101001 + 0o12), 14023 - 14015), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(790 - 740) + '\x34' + '\062', 0b1000), nzTpIcepk0o8(chr(2291 - 2243) + chr(0b1101111) + chr(0b100100 + 0o17) + '\060' + '\x31', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b11111 + 0o23) + chr(1258 - 1207), 8), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(0b110110 + 0o71) + '\x32' + '\066' + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110111) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1010111 + 0o30) + chr(49) + chr(50) + chr(0b110001), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b11100 + 0o26) + '\x33', 8), nzTpIcepk0o8('\x30' + chr(111) + chr(566 - 512) + chr(51), 64834 - 64826), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1319 - 1269) + '\x36' + chr(292 - 244), ord("\x08")), nzTpIcepk0o8(chr(183 - 135) + chr(0b111111 + 0o60) + '\063' + '\x36' + chr(1972 - 1923), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + chr(637 - 586) + chr(834 - 786), 0o10), nzTpIcepk0o8(chr(436 - 388) + chr(111) + '\x32' + chr(52) + chr(50), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(850 - 799) + chr(48) + '\x37', 0o10), nzTpIcepk0o8(chr(94 - 46) + chr(7205 - 7094) + '\064' + chr(55), 27931 - 27923), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + '\066' + chr(48), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110110) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1010 + 0o54) + '\064', 41360 - 41352), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(111) + chr(0b101011 + 0o10) + chr(54) + '\067', 0o10), nzTpIcepk0o8('\060' + chr(0b10010 + 0o135) + chr(49) + chr(55) + chr(0b110110), 16563 - 16555), nzTpIcepk0o8(chr(152 - 104) + chr(3936 - 3825) + chr(1509 - 1459) + chr(767 - 715) + chr(52), 55021 - 55013), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + chr(2398 - 2347) + chr(416 - 364), 31192 - 31184), nzTpIcepk0o8(chr(2147 - 2099) + chr(0b1101111) + chr(0b100011 + 0o17) + chr(1574 - 1520) + '\067', 8), nzTpIcepk0o8('\x30' + chr(0b100110 + 0o111) + chr(51) + chr(0b10111 + 0o33), 58949 - 58941), nzTpIcepk0o8('\060' + chr(1960 - 1849) + '\061' + chr(0b110010) + chr(0b100100 + 0o21), 3141 - 3133), nzTpIcepk0o8('\060' + chr(0b100101 + 0o112) + chr(0b110001) + chr(447 - 392) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b1001 + 0o47) + '\x6f' + chr(702 - 647) + '\063', 58970 - 58962), nzTpIcepk0o8(chr(48) + chr(5722 - 5611) + '\x32' + chr(0b111 + 0o51) + chr(0b110100), 33182 - 33174), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\157' + chr(51) + chr(0b11011 + 0o32) + chr(54), 0o10), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\x6f' + chr(0b110010) + chr(0b110000), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(5312 - 5201) + '\x35' + '\060', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'G'), chr(0b1100100) + '\x65' + '\x63' + chr(111) + '\x64' + chr(0b10000 + 0o125))(chr(0b1110101) + chr(116) + '\146' + '\055' + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Ke7SAGs_qhbe(JXVFyF8k4nGR):
if roI3spqORKae(YVS_F7_wWn_o, roI3spqORKae(ES5oEprVxulp(b'9\xa9\x88'), chr(880 - 780) + '\145' + '\x63' + chr(0b1101111) + chr(0b11010 + 0o112) + chr(0b10000 + 0o125))('\165' + chr(5036 - 4920) + chr(102) + chr(923 - 878) + chr(0b111000))):
if suIjIS24Zkqw(JXVFyF8k4nGR, Q_7vuEo5dYOf):
return roI3spqORKae(JXVFyF8k4nGR, roI3spqORKae(ES5oEprVxulp(b'0\x81\xf3\xfaA\xcf\xc9\x08Z\xab\xab\xc3'), chr(2031 - 1931) + '\x65' + chr(0b111101 + 0o46) + chr(111) + chr(8102 - 8002) + chr(0b1001011 + 0o32))('\165' + chr(0b1110100) + '\146' + chr(0b10100 + 0o31) + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\x1c\x84\xdc\xb6+'), chr(0b1100100) + chr(101) + '\x63' + '\157' + chr(0b1100100) + chr(8264 - 8163))('\165' + '\164' + chr(0b1100110) + '\x2d' + '\x38'))
else:
return roI3spqORKae(JXVFyF8k4nGR.decode(roI3spqORKae(ES5oEprVxulp(b'\x1c\x84\xdc\xb6+'), chr(2478 - 2378) + chr(101) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1001011 + 0o51) + chr(0b1000011 + 0o43) + chr(0b101101) + '\x38')), roI3spqORKae(ES5oEprVxulp(b'0\x81\xf3\xfaA\xcf\xc9\x08Z\xab\xab\xc3'), chr(100) + '\x65' + chr(0b1001100 + 0o27) + chr(1973 - 1862) + chr(100) + chr(0b1010000 + 0o25))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(326 - 270)))(roI3spqORKae(ES5oEprVxulp(b'\x1c\x84\xdc\xb6+'), chr(0b110101 + 0o57) + '\x65' + '\x63' + '\157' + chr(0b1000100 + 0o40) + '\x65')('\x75' + '\x74' + chr(0b1000000 + 0o46) + '\055' + chr(626 - 570)))
else:
if suIjIS24Zkqw(JXVFyF8k4nGR, QNQS9e6tJqMV):
return roI3spqORKae(JXVFyF8k4nGR, roI3spqORKae(ES5oEprVxulp(b'\x05\x96\xd8\xdd`\xed\xf8\x01a\xac\xae\xe0'), chr(7536 - 7436) + chr(101) + chr(1221 - 1122) + chr(0b1100110 + 0o11) + chr(0b1100100) + '\x65')(chr(1062 - 945) + chr(116) + chr(0b1100110) + chr(0b101101) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\x1c\x84\xdc\xb6+'), chr(100) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(5044 - 4943))(chr(4855 - 4738) + '\164' + chr(0b1100110) + '\x2d' + chr(56)))
return JXVFyF8k4nGR
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
postprocess_result
|
def postprocess_result(morphresult, trim_phonetic, trim_compound):
"""Postprocess vabamorf wrapper output."""
word, analysis = morphresult
return {
'text': deconvert(word),
'analysis': [postprocess_analysis(a, trim_phonetic, trim_compound) for a in analysis]
}
|
python
|
def postprocess_result(morphresult, trim_phonetic, trim_compound):
"""Postprocess vabamorf wrapper output."""
word, analysis = morphresult
return {
'text': deconvert(word),
'analysis': [postprocess_analysis(a, trim_phonetic, trim_compound) for a in analysis]
}
|
[
"def",
"postprocess_result",
"(",
"morphresult",
",",
"trim_phonetic",
",",
"trim_compound",
")",
":",
"word",
",",
"analysis",
"=",
"morphresult",
"return",
"{",
"'text'",
":",
"deconvert",
"(",
"word",
")",
",",
"'analysis'",
":",
"[",
"postprocess_analysis",
"(",
"a",
",",
"trim_phonetic",
",",
"trim_compound",
")",
"for",
"a",
"in",
"analysis",
"]",
"}"
] |
Postprocess vabamorf wrapper output.
|
[
"Postprocess",
"vabamorf",
"wrapper",
"output",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L302-L308
|
train
|
Postprocess vabamorf wrapper output.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH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h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + '\x31' + chr(2034 - 1981) + chr(266 - 215), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b111011 + 0o64) + chr(0b110001) + '\x31' + '\064', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110110), 34641 - 34633), nzTpIcepk0o8('\x30' + chr(8404 - 8293) + '\063' + chr(261 - 209) + chr(0b110 + 0o57), 59404 - 59396), nzTpIcepk0o8(chr(761 - 713) + chr(111) + '\x32' + '\060' + chr(50), 33997 - 33989), nzTpIcepk0o8(chr(1481 - 1433) + chr(0b10010 + 0o135) + chr(0b110010) + chr(53), 36082 - 36074), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(49) + '\x36', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(1302 - 1252) + chr(52) + chr(0b110110), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(0b100001 + 0o24) + '\061', ord("\x08")), nzTpIcepk0o8(chr(1563 - 1515) + chr(111) + chr(2163 - 2110) + '\060', 49980 - 49972), nzTpIcepk0o8(chr(1896 - 1848) + chr(9430 - 9319) + '\063' + chr(0b101000 + 0o11) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(655 - 607) + chr(111) + '\063' + chr(0b100010 + 0o17) + chr(54), 8), nzTpIcepk0o8(chr(649 - 601) + chr(0b1101111) + chr(0b101111 + 0o10) + chr(0b110000), 37325 - 37317), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + chr(0b11100 + 0o33) + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1100101 + 0o12) + '\062' + chr(2059 - 2011) + chr(0b110 + 0o53), 27245 - 27237), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(111) + chr(49) + chr(0b1 + 0o66) + chr(0b100111 + 0o16), 0b1000), nzTpIcepk0o8('\x30' + chr(10234 - 10123) + chr(0b110001) + chr(51) + chr(52), 16214 - 16206), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100110 + 0o20) + chr(2294 - 2246), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b11000 + 0o31) + chr(0b11101 + 0o25) + '\x33', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011) + chr(2153 - 2098) + chr(0b10 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\157' + chr(0b10101 + 0o34) + chr(50) + chr(0b11111 + 0o22), 0b1000), nzTpIcepk0o8(chr(832 - 784) + '\x6f' + chr(0b110010) + chr(0b110011) + '\x33', 0o10), nzTpIcepk0o8('\060' + chr(5206 - 5095) + chr(49) + chr(0b110010) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b11100 + 0o24) + '\x6f' + chr(0b100011 + 0o17) + '\063' + chr(50), 52142 - 52134), nzTpIcepk0o8(chr(2210 - 2162) + chr(10202 - 10091) + '\063' + chr(0b110010) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10111 + 0o34) + chr(0b0 + 0o62) + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + chr(48) + '\061', 8), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + '\x32' + '\x36', 64310 - 64302), nzTpIcepk0o8(chr(845 - 797) + '\x6f' + '\x33' + chr(0b10010 + 0o37) + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(50) + '\065', 8), nzTpIcepk0o8('\060' + chr(2030 - 1919) + chr(1250 - 1200) + '\060' + chr(2729 - 2674), 49039 - 49031), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b100100 + 0o14) + '\x31', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1011101 + 0o22) + '\063' + chr(50) + chr(1414 - 1363), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\065' + chr(0b110101), ord("\x08")), nzTpIcepk0o8('\060' + chr(1887 - 1776) + chr(675 - 625) + '\x31' + '\060', 15875 - 15867), nzTpIcepk0o8(chr(0b110000) + chr(11271 - 11160) + chr(0b110011) + '\065' + chr(54), 35256 - 35248), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100000 + 0o22) + chr(0b10000 + 0o40) + chr(0b110111), 8), nzTpIcepk0o8(chr(1785 - 1737) + '\x6f' + '\x32' + chr(49) + '\063', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b11101 + 0o24) + chr(1687 - 1636), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(781 - 730) + '\x33' + chr(0b101101 + 0o4), 56182 - 56174)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + '\065' + chr(0b11000 + 0o30), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'E'), chr(1391 - 1291) + '\x65' + chr(0b1100011) + chr(9628 - 9517) + chr(0b111001 + 0o53) + chr(0b1100101))(chr(10496 - 10379) + '\x74' + chr(0b111100 + 0o52) + '\055' + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def G5QxzK4hhvxN(pXMGnbiVdwcR, anZA9mzkExpe, zfAeJn8ZsJCa):
(JXVFyF8k4nGR, eBWh51EcnNXz) = pXMGnbiVdwcR
return {roI3spqORKae(ES5oEprVxulp(b'\x1f)~\x91'), chr(8290 - 8190) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\x64' + chr(2042 - 1941))(chr(4001 - 3884) + '\x74' + chr(0b111000 + 0o56) + chr(0b11100 + 0o21) + chr(56)): eYftgUdPaBGz(JXVFyF8k4nGR), roI3spqORKae(ES5oEprVxulp(b'\n"g\x89\xfbf\xa7\xd5'), '\144' + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + chr(0b1000111 + 0o36))(chr(0b1110101) + chr(116) + chr(102) + '\055' + chr(56)): [FNVUrjlAH_JK(AQ9ceR9AaoT1, anZA9mzkExpe, zfAeJn8ZsJCa) for AQ9ceR9AaoT1 in eBWh51EcnNXz]}
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
trim_phonetics
|
def trim_phonetics(root):
"""Function that trims phonetic markup from the root.
Parameters
----------
root: str
The string to remove the phonetic markup.
Returns
-------
str
The string with phonetic markup removed.
"""
global phonetic_markers
global phonetic_regex
if root in phonetic_markers:
return root
else:
return phonetic_regex.sub('', root)
|
python
|
def trim_phonetics(root):
"""Function that trims phonetic markup from the root.
Parameters
----------
root: str
The string to remove the phonetic markup.
Returns
-------
str
The string with phonetic markup removed.
"""
global phonetic_markers
global phonetic_regex
if root in phonetic_markers:
return root
else:
return phonetic_regex.sub('', root)
|
[
"def",
"trim_phonetics",
"(",
"root",
")",
":",
"global",
"phonetic_markers",
"global",
"phonetic_regex",
"if",
"root",
"in",
"phonetic_markers",
":",
"return",
"root",
"else",
":",
"return",
"phonetic_regex",
".",
"sub",
"(",
"''",
",",
"root",
")"
] |
Function that trims phonetic markup from the root.
Parameters
----------
root: str
The string to remove the phonetic markup.
Returns
-------
str
The string with phonetic markup removed.
|
[
"Function",
"that",
"trims",
"phonetic",
"markup",
"from",
"the",
"root",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L330-L348
|
train
|
Function that trims phonetic markup from the root.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K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aYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(8349 - 8238) + chr(50) + chr(0b1101 + 0o43) + '\064', 10913 - 10905), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110100 + 0o0) + chr(0b101101 + 0o5), 32590 - 32582), nzTpIcepk0o8('\x30' + chr(0b1011 + 0o144) + chr(0b11001 + 0o31) + chr(0b101000 + 0o16) + chr(51), 65016 - 65008), nzTpIcepk0o8(chr(241 - 193) + chr(2591 - 2480) + '\066' + chr(55), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + '\x30' + '\061', 0b1000), nzTpIcepk0o8(chr(866 - 818) + chr(0b111100 + 0o63) + chr(0b110011) + '\066' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x31' + chr(0b110010) + '\x32', 41266 - 41258), nzTpIcepk0o8(chr(48) + chr(0b1000011 + 0o54) + '\061' + chr(0b110110) + chr(0b100110 + 0o21), 20145 - 20137), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\157' + chr(0b1111 + 0o43) + '\x34' + chr(0b110101), 52587 - 52579), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(0b110010) + chr(53), 0o10), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(8565 - 8454) + '\x32' + '\x37' + chr(0b110011), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + '\063' + '\x31', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + chr(0b111 + 0o54) + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b10001 + 0o136) + '\063' + chr(1698 - 1645) + '\062', 59877 - 59869), nzTpIcepk0o8(chr(0b110000) + chr(0b10001 + 0o136) + chr(0b110011) + chr(55) + '\x31', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\062' + '\062', ord("\x08")), nzTpIcepk0o8(chr(1528 - 1480) + chr(111) + '\061' + chr(53) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(1247 - 1199) + '\x6f' + chr(0b10 + 0o63) + chr(48), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(7640 - 7529) + chr(0b10111 + 0o33) + chr(54) + chr(0b110011), 8), nzTpIcepk0o8(chr(2035 - 1987) + '\x6f' + '\064', 15903 - 15895), nzTpIcepk0o8(chr(118 - 70) + chr(0b1101111) + chr(50) + chr(2354 - 2301) + '\061', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b10001 + 0o41) + chr(0b110010) + '\064', 19827 - 19819), nzTpIcepk0o8(chr(48) + chr(111) + chr(2067 - 2017) + '\x37' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110100 + 0o3) + chr(49), 44930 - 44922), nzTpIcepk0o8(chr(48) + chr(11639 - 11528) + chr(1719 - 1668) + chr(0b10001 + 0o41) + '\063', ord("\x08")), nzTpIcepk0o8('\x30' + chr(5105 - 4994) + '\x36' + '\x36', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + chr(682 - 631) + '\x37', 53500 - 53492), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(53) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(1834 - 1723) + chr(0b101010 + 0o10) + chr(0b110000) + chr(0b10101 + 0o42), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + '\060' + chr(53), 0o10), nzTpIcepk0o8(chr(48) + chr(11561 - 11450) + '\x32' + chr(0b110111) + chr(0b110010), 24398 - 24390), nzTpIcepk0o8('\x30' + chr(0b1111 + 0o140) + chr(0b110111) + chr(0b11101 + 0o32), 59441 - 59433), nzTpIcepk0o8(chr(0b110000) + chr(4361 - 4250) + chr(50) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(5430 - 5319) + '\x32' + chr(0b110011) + chr(1674 - 1626), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10010 + 0o41) + chr(0b110010 + 0o5) + '\066', ord("\x08")), nzTpIcepk0o8('\060' + chr(4957 - 4846) + chr(0b100100 + 0o21) + '\064', ord("\x08")), nzTpIcepk0o8(chr(326 - 278) + '\157' + '\x31' + chr(50) + '\063', 64241 - 64233), nzTpIcepk0o8('\x30' + chr(2947 - 2836) + chr(2020 - 1971) + '\062' + '\064', 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x31' + chr(1740 - 1689) + '\066', 8), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(11618 - 11507) + '\063' + '\062' + chr(2215 - 2161), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b100010 + 0o115) + '\x35' + chr(48), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xaa'), chr(0b1100100) + chr(0b110110 + 0o57) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1110101) + '\x74' + '\146' + chr(176 - 131) + chr(0b100101 + 0o23)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Wchu4kDqYqx9(kF9CWBi2ucGu):
global C2T9g44JzQt9
global lYtdlU37eigz
if kF9CWBi2ucGu in C2T9g44JzQt9:
return kF9CWBi2ucGu
else:
return roI3spqORKae(lYtdlU37eigz, roI3spqORKae(ES5oEprVxulp(b'\xdbX\xe3Y\xa5\xbb#A\xdd\xd8\xdc\xa9'), chr(0b1100100) + chr(0b1001100 + 0o31) + chr(8872 - 8773) + chr(7297 - 7186) + chr(0b1100100) + chr(0b1100101))(chr(214 - 97) + chr(0b1110100) + chr(0b10 + 0o144) + '\x2d' + '\x38'))(roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + '\145' + '\x63' + '\x6f' + chr(100) + chr(0b1100101))(chr(11258 - 11141) + chr(11004 - 10888) + chr(0b1100110) + chr(0b101101) + chr(0b111000)), kF9CWBi2ucGu)
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
get_root
|
def get_root(root, phonetic, compound):
"""Get the root form without markers.
Parameters
----------
root: str
The word root form.
phonetic: boolean
If True, add phonetic information to the root forms.
compound: boolean
if True, add compound word markers to root forms.
"""
global compound_regex
if not phonetic:
root = trim_phonetics(root)
if not compound:
root = trim_compounds(root)
return root
|
python
|
def get_root(root, phonetic, compound):
"""Get the root form without markers.
Parameters
----------
root: str
The word root form.
phonetic: boolean
If True, add phonetic information to the root forms.
compound: boolean
if True, add compound word markers to root forms.
"""
global compound_regex
if not phonetic:
root = trim_phonetics(root)
if not compound:
root = trim_compounds(root)
return root
|
[
"def",
"get_root",
"(",
"root",
",",
"phonetic",
",",
"compound",
")",
":",
"global",
"compound_regex",
"if",
"not",
"phonetic",
":",
"root",
"=",
"trim_phonetics",
"(",
"root",
")",
"if",
"not",
"compound",
":",
"root",
"=",
"trim_compounds",
"(",
"root",
")",
"return",
"root"
] |
Get the root form without markers.
Parameters
----------
root: str
The word root form.
phonetic: boolean
If True, add phonetic information to the root forms.
compound: boolean
if True, add compound word markers to root forms.
|
[
"Get",
"the",
"root",
"form",
"without",
"markers",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L370-L387
|
train
|
Get the root form without markers.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,b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ticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + '\x31' + '\067', 0o10), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(0b0 + 0o157) + chr(0b10011 + 0o37) + '\065' + chr(53), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(260 - 209) + chr(0b11101 + 0o27), 0o10), nzTpIcepk0o8(chr(48) + chr(0b111100 + 0o63) + chr(0b10100 + 0o36) + chr(0b110000) + chr(124 - 74), 59916 - 59908), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1449 - 1400) + chr(857 - 808) + '\x32', 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + chr(1181 - 1126) + chr(0b10011 + 0o43), 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + '\x6f' + chr(52) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(53) + '\061', 59689 - 59681), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + '\067' + chr(53), 0b1000), nzTpIcepk0o8(chr(2234 - 2186) + chr(111) + chr(0b10 + 0o60) + chr(0b1111 + 0o47) + chr(0b100010 + 0o16), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + chr(49) + chr(53), 17993 - 17985), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(55) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(111) + chr(49) + chr(0b1110 + 0o50), 0o10), nzTpIcepk0o8(chr(48) + chr(11739 - 11628) + '\x31' + chr(0b110001) + chr(55), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(49) + chr(51), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(3212 - 3101) + '\066' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(383 - 335) + chr(5447 - 5336) + chr(1158 - 1108) + chr(54) + chr(0b100011 + 0o21), 0o10), nzTpIcepk0o8('\060' + chr(1117 - 1006) + chr(0b110111) + chr(0b110011), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1138 - 1089) + chr(0b1111 + 0o44) + chr(0b110111), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(50) + chr(53) + chr(0b110111), 52041 - 52033), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(49) + chr(0b11010 + 0o30), 0b1000), nzTpIcepk0o8(chr(170 - 122) + '\157' + chr(50) + chr(50) + '\x37', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10101 + 0o34) + chr(0b110001) + chr(1904 - 1856), 19889 - 19881), nzTpIcepk0o8(chr(2236 - 2188) + chr(0b1101111) + chr(51) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b111 + 0o51) + '\x6f' + '\067' + '\062', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\062' + chr(0b110100 + 0o3) + chr(2342 - 2289), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011) + '\065' + chr(0b1100 + 0o51), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b1001 + 0o51) + chr(0b110101) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(1831 - 1783) + chr(10674 - 10563) + chr(0b10100 + 0o37) + '\x37', 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + '\066' + '\062', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b10011 + 0o40) + chr(2844 - 2790) + chr(1210 - 1156), ord("\x08")), nzTpIcepk0o8(chr(1333 - 1285) + '\157' + chr(0b101100 + 0o5) + chr(51) + '\x35', 0o10), nzTpIcepk0o8('\x30' + chr(0b1000010 + 0o55) + '\x32' + chr(0b110111) + chr(1257 - 1209), 40678 - 40670), nzTpIcepk0o8('\060' + chr(111) + '\063' + chr(1665 - 1612) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\x6f' + chr(0b110010) + chr(51) + chr(509 - 454), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + '\063', 0o10), nzTpIcepk0o8('\x30' + chr(0b100001 + 0o116) + chr(1876 - 1825) + '\x35' + chr(0b110111), 38819 - 38811), nzTpIcepk0o8(chr(152 - 104) + '\157' + chr(0b100100 + 0o17) + chr(0b110010 + 0o2) + chr(1822 - 1774), 0b1000), nzTpIcepk0o8(chr(48) + chr(3424 - 3313) + '\x31' + chr(255 - 200) + '\066', 32555 - 32547), nzTpIcepk0o8(chr(2133 - 2085) + '\157' + chr(49) + '\060' + '\x32', 12319 - 12311)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(3326 - 3215) + chr(53) + '\x30', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xa1'), chr(0b1100100) + chr(0b1011000 + 0o15) + '\x63' + '\x6f' + '\x64' + '\145')(chr(0b1110101) + '\164' + '\x66' + chr(1545 - 1500) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Nx01PwdYkqmp(kF9CWBi2ucGu, le5B5CDXyXdY, Zj_QUDrWCBHm):
global AFzMP2KSIm3v
if not le5B5CDXyXdY:
kF9CWBi2ucGu = Wchu4kDqYqx9(kF9CWBi2ucGu)
if not Zj_QUDrWCBHm:
kF9CWBi2ucGu = KU891GC_eZ9D(kF9CWBi2ucGu)
return kF9CWBi2ucGu
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
get_group_tokens
|
def get_group_tokens(root):
"""Function to extract tokens in hyphenated groups (saunameheks-tallimeheks).
Parameters
----------
root: str
The root form.
Returns
-------
list of (list of str)
List of grouped root tokens.
"""
global all_markers
if root in all_markers or root in ['-', '_']: # special case
return [[root]]
groups = []
for group in root.split('-'):
toks = [trim_phonetics(trim_compounds(tok)) for tok in group.split('_')]
groups.append(toks)
return groups
|
python
|
def get_group_tokens(root):
"""Function to extract tokens in hyphenated groups (saunameheks-tallimeheks).
Parameters
----------
root: str
The root form.
Returns
-------
list of (list of str)
List of grouped root tokens.
"""
global all_markers
if root in all_markers or root in ['-', '_']: # special case
return [[root]]
groups = []
for group in root.split('-'):
toks = [trim_phonetics(trim_compounds(tok)) for tok in group.split('_')]
groups.append(toks)
return groups
|
[
"def",
"get_group_tokens",
"(",
"root",
")",
":",
"global",
"all_markers",
"if",
"root",
"in",
"all_markers",
"or",
"root",
"in",
"[",
"'-'",
",",
"'_'",
"]",
":",
"# special case",
"return",
"[",
"[",
"root",
"]",
"]",
"groups",
"=",
"[",
"]",
"for",
"group",
"in",
"root",
".",
"split",
"(",
"'-'",
")",
":",
"toks",
"=",
"[",
"trim_phonetics",
"(",
"trim_compounds",
"(",
"tok",
")",
")",
"for",
"tok",
"in",
"group",
".",
"split",
"(",
"'_'",
")",
"]",
"groups",
".",
"append",
"(",
"toks",
")",
"return",
"groups"
] |
Function to extract tokens in hyphenated groups (saunameheks-tallimeheks).
Parameters
----------
root: str
The root form.
Returns
-------
list of (list of str)
List of grouped root tokens.
|
[
"Function",
"to",
"extract",
"tokens",
"in",
"hyphenated",
"groups",
"(",
"saunameheks",
"-",
"tallimeheks",
")",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L390-L410
|
train
|
Function to extract tokens in hyphenated groups ( saunameheks - tallimeheks.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,K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2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b11100 + 0o26) + chr(0b110110) + chr(394 - 345), 0o10), nzTpIcepk0o8('\060' + chr(1287 - 1176) + chr(49) + '\060' + '\064', 42017 - 42009), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + '\065' + chr(1773 - 1721), 0b1000), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(6179 - 6068) + '\x32' + chr(49) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(111) + chr(49) + chr(0b11101 + 0o23) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + '\x33' + '\060', 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(3815 - 3704) + chr(0b110001) + '\065' + chr(51), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + '\x35' + '\067', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(979 - 926) + '\x35', 42151 - 42143), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(0b100011 + 0o16) + chr(1828 - 1778), 13013 - 13005), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2268 - 2218) + '\x37', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1010010 + 0o35) + '\062' + '\x37' + chr(0b110001), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + '\x37' + chr(0b110110), 25567 - 25559), nzTpIcepk0o8(chr(0b110000) + chr(1166 - 1055) + chr(1035 - 984) + '\x37' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1101111) + chr(0b110010) + chr(48) + chr(1693 - 1641), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(50) + '\x31' + chr(173 - 120), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b100101 + 0o20) + chr(48), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b100100 + 0o16) + chr(0b110011) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32' + chr(0b11110 + 0o22), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\x33' + chr(0b1000 + 0o57), 18534 - 18526), nzTpIcepk0o8(chr(1066 - 1018) + chr(111) + chr(1694 - 1645) + chr(313 - 264), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + chr(2335 - 2281) + '\066', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b101101 + 0o4) + '\066' + chr(2455 - 2404), 0b1000), nzTpIcepk0o8(chr(385 - 337) + '\x6f' + chr(0b110010) + '\x30' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\157' + '\x33' + chr(0b110100) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(111) + chr(0b10001 + 0o42) + '\064' + '\x32', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(821 - 772) + chr(0b110001) + '\x30', 22443 - 22435), nzTpIcepk0o8('\060' + chr(0b111101 + 0o62) + '\062' + chr(0b110010) + chr(882 - 827), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + chr(0b1000 + 0o51) + chr(0b11101 + 0o31), ord("\x08")), nzTpIcepk0o8(chr(1339 - 1291) + '\157' + chr(0b100101 + 0o14) + '\063' + '\062', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(49) + chr(0b10101 + 0o34), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(55) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101011 + 0o4) + chr(0b110011) + '\062' + '\061', 19950 - 19942), nzTpIcepk0o8(chr(0b10101 + 0o33) + '\x6f' + '\x34' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(1079 - 1031) + '\x6f' + chr(0b110010) + chr(0b101111 + 0o2) + chr(51), 35561 - 35553), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1640 - 1585) + '\x34', 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(5793 - 5682) + chr(0b110011) + chr(0b11011 + 0o27) + '\063', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + '\064' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x36' + chr(547 - 497), 0b1000), nzTpIcepk0o8('\060' + chr(0b1010101 + 0o32) + chr(0b110001) + '\x35' + chr(50), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(2693 - 2582) + '\065' + '\060', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9f'), '\x64' + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(7278 - 7178) + chr(6048 - 5947))(chr(0b11111 + 0o126) + chr(0b0 + 0o164) + chr(102) + chr(45) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def nr0iNZuSlAtb(kF9CWBi2ucGu):
global xk661cpsKB5B
if kF9CWBi2ucGu in xk661cpsKB5B or kF9CWBi2ucGu in [roI3spqORKae(ES5oEprVxulp(b'\x9c'), chr(0b1011111 + 0o5) + '\145' + chr(8632 - 8533) + chr(0b1101111) + chr(6140 - 6040) + chr(0b1100101))(chr(117) + '\x74' + chr(0b111010 + 0o54) + chr(0b101101) + chr(3080 - 3024)), roI3spqORKae(ES5oEprVxulp(b'\xee'), '\144' + '\145' + chr(0b1100011) + chr(0b1100001 + 0o16) + chr(0b1100100) + '\x65')(chr(1857 - 1740) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b111000))]:
return [[kF9CWBi2ucGu]]
Npj4un59pdkA = []
for F9lJ8RbIonqb in roI3spqORKae(kF9CWBi2ucGu, roI3spqORKae(ES5oEprVxulp(b'\xfd">\xff\x12\x97\x13\x9a\xe9<y\xfa'), chr(0b1100100) + chr(0b10001 + 0o124) + chr(3168 - 3069) + chr(0b1101111) + chr(0b1100100) + '\x65')('\165' + chr(0b1110100) + chr(102) + chr(0b111 + 0o46) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\x9c'), '\144' + chr(0b1010000 + 0o25) + chr(0b1100011) + chr(111) + chr(100) + chr(7624 - 7523))('\165' + chr(0b1001011 + 0o51) + chr(0b1100110) + chr(0b101101) + chr(0b111000))):
K8ATK8ghvFIv = [Wchu4kDqYqx9(KU891GC_eZ9D(AhM9MW1jY_Tn)) for AhM9MW1jY_Tn in F9lJ8RbIonqb.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'\xee'), chr(100) + '\145' + chr(0b100000 + 0o103) + chr(0b1101111) + '\x64' + '\145')(chr(0b1000111 + 0o56) + chr(116) + chr(0b11111 + 0o107) + chr(45) + chr(0b10011 + 0o45)))]
roI3spqORKae(Npj4un59pdkA, roI3spqORKae(ES5oEprVxulp(b'\xf9\x10?\xb9;\xbf,\x80\xc7%B\x8c'), '\144' + chr(9937 - 9836) + chr(99) + chr(0b1101111) + chr(5368 - 5268) + '\x65')(chr(0b1110101 + 0o0) + chr(2325 - 2209) + chr(0b1010100 + 0o22) + chr(0b101010 + 0o3) + chr(1777 - 1721)))(K8ATK8ghvFIv)
return Npj4un59pdkA
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
fix_spelling
|
def fix_spelling(words, join=True, joinstring=' '):
"""Simple function for quickly correcting misspelled words.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
join: boolean (default: True)
Should we join the list of words into a single string.
joinstring: str (default: ' ')
The string that will be used to join together the fixed words.
Returns
-------
str
In case join is True
list of str
In case join is False.
"""
return Vabamorf.instance().fix_spelling(words, join, joinstring)
|
python
|
def fix_spelling(words, join=True, joinstring=' '):
"""Simple function for quickly correcting misspelled words.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
join: boolean (default: True)
Should we join the list of words into a single string.
joinstring: str (default: ' ')
The string that will be used to join together the fixed words.
Returns
-------
str
In case join is True
list of str
In case join is False.
"""
return Vabamorf.instance().fix_spelling(words, join, joinstring)
|
[
"def",
"fix_spelling",
"(",
"words",
",",
"join",
"=",
"True",
",",
"joinstring",
"=",
"' '",
")",
":",
"return",
"Vabamorf",
".",
"instance",
"(",
")",
".",
"fix_spelling",
"(",
"words",
",",
"join",
",",
"joinstring",
")"
] |
Simple function for quickly correcting misspelled words.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
join: boolean (default: True)
Should we join the list of words into a single string.
joinstring: str (default: ' ')
The string that will be used to join together the fixed words.
Returns
-------
str
In case join is True
list of str
In case join is False.
|
[
"Simple",
"function",
"for",
"quickly",
"correcting",
"misspelled",
"words",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L508-L528
|
train
|
Simple function for quickly correcting misspelled words.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ip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EV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\x6f' + chr(0b110101) + '\x35', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(53) + chr(0b11100 + 0o26), 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1110 + 0o141) + chr(0b101 + 0o57) + chr(0b10011 + 0o44), 0b1000), nzTpIcepk0o8(chr(1737 - 1689) + '\x6f' + chr(53) + chr(52), 0o10), nzTpIcepk0o8(chr(48) + chr(0b101 + 0o152) + chr(55) + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(2438 - 2383) + chr(341 - 293), 0b1000), nzTpIcepk0o8(chr(0b101000 + 0o10) + '\x6f' + chr(50) + chr(1552 - 1499), 23861 - 23853), nzTpIcepk0o8(chr(588 - 540) + '\x6f' + chr(0b110011) + '\x36' + chr(1772 - 1724), 0b1000), nzTpIcepk0o8(chr(504 - 456) + '\x6f' + '\067' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110110) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(111) + chr(2496 - 2442) + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + chr(3869 - 3758) + '\067' + chr(2048 - 2000), 8), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + chr(295 - 244) + '\x33' + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + chr(10782 - 10671) + chr(53) + chr(0b110 + 0o54), 8), nzTpIcepk0o8(chr(0b110000) + chr(11517 - 11406) + chr(0b110001) + chr(0b110110) + '\x32', 49132 - 49124), nzTpIcepk0o8(chr(86 - 38) + chr(111) + chr(50) + chr(847 - 798) + '\066', 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b1101111) + '\x36' + '\x31', 22404 - 22396), nzTpIcepk0o8(chr(267 - 219) + '\x6f' + chr(0b110000 + 0o3) + chr(55) + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + chr(0b101110 + 0o101) + chr(0b110011) + chr(0b110100) + '\x31', 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x31' + chr(1385 - 1332) + chr(0b1101 + 0o44), 0b1000), nzTpIcepk0o8('\x30' + chr(11094 - 10983) + chr(0b101000 + 0o11) + chr(0b110011) + chr(0b10010 + 0o37), 33064 - 33056), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b1101111) + chr(0b110010) + chr(0b1011 + 0o50) + '\x33', 23020 - 23012), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\x6f' + chr(0b10101 + 0o36) + '\067' + chr(54), 0b1000), nzTpIcepk0o8('\060' + chr(0b101010 + 0o105) + '\x32' + chr(48) + '\x36', 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(7761 - 7650) + '\063' + '\062' + chr(0b110000 + 0o6), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1011011 + 0o24) + chr(0b101101 + 0o11) + chr(54), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(53) + chr(1475 - 1424), 30964 - 30956), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(111) + chr(0b110011) + chr(946 - 898) + chr(50), 0b1000), nzTpIcepk0o8(chr(48) + chr(5145 - 5034) + chr(2492 - 2441) + '\x30' + '\x30', 32390 - 32382), nzTpIcepk0o8(chr(0b11000 + 0o30) + '\157' + '\x31' + '\063' + chr(0b101010 + 0o13), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(54) + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(53) + chr(0b110101), 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + '\x33' + chr(2267 - 2219), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1001100 + 0o43) + '\061' + chr(1039 - 986) + chr(0b11001 + 0o36), 14397 - 14389), nzTpIcepk0o8(chr(2006 - 1958) + chr(0b1101 + 0o142) + '\063', 0b1000), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(111) + chr(0b110011) + chr(0b110010) + chr(55), 22076 - 22068), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(0b100110 + 0o15) + chr(49), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b101110 + 0o3) + '\061' + chr(0b11 + 0o56), 0o10), nzTpIcepk0o8(chr(2270 - 2222) + chr(0b1100000 + 0o17) + chr(0b110011) + chr(51) + '\x31', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(817 - 767) + '\061' + '\065', 107 - 99)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(1334 - 1223) + chr(0b110101) + chr(1259 - 1211), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x03'), chr(9863 - 9763) + '\145' + '\143' + chr(8948 - 8837) + chr(0b110 + 0o136) + chr(8450 - 8349))(chr(1240 - 1123) + '\x74' + '\146' + chr(0b11001 + 0o24) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Dp3LYmpUdwfT(cHmedxd8XMtK, Y4yM9BcfTCNq=nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(747 - 698), 41265 - 41257), JBUoMWtZ4MdI=roI3spqORKae(ES5oEprVxulp(b'\r'), '\x64' + '\x65' + chr(0b110111 + 0o54) + chr(0b111111 + 0o60) + chr(0b1100100) + '\145')(chr(117) + '\164' + chr(102) + chr(740 - 695) + chr(1454 - 1398))):
return roI3spqORKae(UUu1v1lnNuPT.instance(), roI3spqORKae(ES5oEprVxulp(b'KC_sIHp\x9cSZ\\_'), '\144' + chr(101) + chr(6683 - 6584) + chr(111) + chr(9412 - 9312) + '\x65')(chr(117) + '\x74' + chr(0b111010 + 0o54) + chr(0b1111 + 0o36) + chr(3021 - 2965)))(cHmedxd8XMtK, Y4yM9BcfTCNq, JBUoMWtZ4MdI)
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
synthesize
|
def synthesize(lemma, form, partofspeech='', hint='', guess=True, phonetic=False):
"""Synthesize a single word based on given morphological attributes.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
lemma: str
The lemma of the word(s) to be synthesized.
form: str
The form of the word(s) to be synthesized.
partofspeech: str
Part-of-speech.
hint: str
Hint.
guess: boolean (default: True)
Use heuristics when synthesizing unknown words.
phonetic: boolean (default: False)
Add phonetic markup to synthesized words.
Returns
-------
list
List of synthesized words.
"""
return Vabamorf.instance().synthesize(lemma, form, partofspeech, hint, guess, phonetic)
|
python
|
def synthesize(lemma, form, partofspeech='', hint='', guess=True, phonetic=False):
"""Synthesize a single word based on given morphological attributes.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
lemma: str
The lemma of the word(s) to be synthesized.
form: str
The form of the word(s) to be synthesized.
partofspeech: str
Part-of-speech.
hint: str
Hint.
guess: boolean (default: True)
Use heuristics when synthesizing unknown words.
phonetic: boolean (default: False)
Add phonetic markup to synthesized words.
Returns
-------
list
List of synthesized words.
"""
return Vabamorf.instance().synthesize(lemma, form, partofspeech, hint, guess, phonetic)
|
[
"def",
"synthesize",
"(",
"lemma",
",",
"form",
",",
"partofspeech",
"=",
"''",
",",
"hint",
"=",
"''",
",",
"guess",
"=",
"True",
",",
"phonetic",
"=",
"False",
")",
":",
"return",
"Vabamorf",
".",
"instance",
"(",
")",
".",
"synthesize",
"(",
"lemma",
",",
"form",
",",
"partofspeech",
",",
"hint",
",",
"guess",
",",
"phonetic",
")"
] |
Synthesize a single word based on given morphological attributes.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
lemma: str
The lemma of the word(s) to be synthesized.
form: str
The form of the word(s) to be synthesized.
partofspeech: str
Part-of-speech.
hint: str
Hint.
guess: boolean (default: True)
Use heuristics when synthesizing unknown words.
phonetic: boolean (default: False)
Add phonetic markup to synthesized words.
Returns
-------
list
List of synthesized words.
|
[
"Synthesize",
"a",
"single",
"word",
"based",
"on",
"given",
"morphological",
"attributes",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L531-L557
|
train
|
Synthesize a single word based on given morphological attributes.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFax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9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b11110 + 0o22) + '\157' + chr(1882 - 1832) + chr(284 - 236) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + '\067' + chr(0b110110), 58269 - 58261), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b10110 + 0o131) + '\x33' + '\060' + chr(0b1100 + 0o44), 0b1000), nzTpIcepk0o8('\060' + chr(0b101001 + 0o106) + chr(0b110001) + chr(0b110001) + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\063' + '\x37', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1000001 + 0o56) + chr(0b110001) + '\x37' + '\x33', 0o10), nzTpIcepk0o8(chr(760 - 712) + chr(0b111010 + 0o65) + chr(0b100100 + 0o15) + '\067' + chr(0b101101 + 0o3), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + chr(54) + chr(0b110111), 4073 - 4065), nzTpIcepk0o8('\x30' + chr(0b1010011 + 0o34) + chr(909 - 860) + '\062' + '\x34', 24995 - 24987), nzTpIcepk0o8(chr(0b10 + 0o56) + '\x6f' + '\x33' + chr(1241 - 1191) + chr(0b100 + 0o54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(1482 - 1432), 0b1000), nzTpIcepk0o8(chr(1098 - 1050) + '\x6f' + chr(0b100001 + 0o22) + chr(50) + '\064', 6721 - 6713), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + chr(0b101111 + 0o3) + chr(0b100010 + 0o25), 22050 - 22042), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(55), 0o10), nzTpIcepk0o8(chr(72 - 24) + chr(111) + '\062' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1001 + 0o52) + chr(1734 - 1685) + '\x33', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + '\x33' + '\067', 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(0b110111), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010) + chr(0b1001 + 0o51), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(2557 - 2506) + chr(0b1101 + 0o45) + chr(0b101111 + 0o7), 0o10), nzTpIcepk0o8('\x30' + chr(0b10110 + 0o131) + '\062' + chr(51) + chr(1326 - 1277), 4347 - 4339), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(111) + chr(0b10111 + 0o33) + chr(179 - 131) + '\x36', 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + '\x30' + chr(2307 - 2255), ord("\x08")), nzTpIcepk0o8('\x30' + chr(6803 - 6692) + '\062' + chr(273 - 220) + '\x33', 49588 - 49580), nzTpIcepk0o8('\060' + chr(0b1000111 + 0o50) + '\063' + chr(378 - 329) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(313 - 264) + '\066' + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\x6f' + chr(0b110010 + 0o3) + chr(0b110110), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\x36' + chr(50), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + chr(0b101100 + 0o6), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(50) + '\066' + '\x36', 0b1000), nzTpIcepk0o8('\060' + chr(0b100001 + 0o116) + '\062' + '\x33' + chr(54), 33460 - 33452), nzTpIcepk0o8(chr(1298 - 1250) + chr(6602 - 6491) + chr(0b110011) + chr(0b110111) + '\x34', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010101 + 0o32) + chr(2063 - 2014) + '\065' + chr(2936 - 2881), 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b11111 + 0o120) + chr(0b110001) + '\060' + chr(0b110010 + 0o2), 8), nzTpIcepk0o8('\x30' + chr(5387 - 5276) + chr(1086 - 1036) + chr(1518 - 1464) + chr(0b110001), 62324 - 62316), nzTpIcepk0o8(chr(1433 - 1385) + chr(111) + chr(0b11101 + 0o25) + chr(0b110111) + '\066', 0b1000), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(11946 - 11835) + chr(0b110010) + chr(1401 - 1352) + chr(0b1100 + 0o47), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1011110 + 0o21) + chr(1471 - 1420) + chr(1427 - 1375) + chr(0b110110 + 0o0), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + '\x34' + chr(0b110010 + 0o5), 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + '\157' + chr(369 - 318) + '\063' + '\x30', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(111) + chr(0b101110 + 0o7) + '\x30', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xaa'), chr(0b1100100) + '\145' + chr(99) + '\157' + chr(0b10001 + 0o123) + chr(101))(chr(0b0 + 0o165) + '\164' + chr(8261 - 8159) + chr(0b10000 + 0o35) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def DmvEECLLmgVV(W6axg8J0N9kP, qnYTYR39V38E, Hv2u8JijDJY4=roI3spqORKae(ES5oEprVxulp(b''), '\144' + chr(101) + chr(99) + chr(111) + chr(7116 - 7016) + '\x65')(chr(0b1110101) + chr(9000 - 8884) + chr(102) + chr(45) + chr(0b111000)), bcPgAa5xDKMy=roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(5994 - 5893) + chr(6249 - 6150) + chr(378 - 267) + chr(0b1100100) + chr(101))('\x75' + chr(116) + '\x66' + chr(0b10110 + 0o27) + chr(56)), OMXmEHlNcnc4=nzTpIcepk0o8(chr(48) + chr(111) + '\x31', 2097 - 2089), le5B5CDXyXdY=nzTpIcepk0o8('\x30' + '\157' + '\060', 0b1000)):
return roI3spqORKae(UUu1v1lnNuPT.instance(), roI3spqORKae(ES5oEprVxulp(b'\xf7\x87\xae>\xf7\x1e\x0b\x9e.\xb5'), chr(0b1100100) + chr(4545 - 4444) + chr(0b1100011) + chr(5189 - 5078) + chr(5046 - 4946) + '\145')(chr(0b1110101) + chr(116) + chr(0b1001010 + 0o34) + '\x2d' + chr(759 - 703)))(W6axg8J0N9kP, qnYTYR39V38E, Hv2u8JijDJY4, bcPgAa5xDKMy, OMXmEHlNcnc4, le5B5CDXyXdY)
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
Vabamorf.instance
|
def instance():
"""Return an PyVabamorf instance.
It returns the previously initialized instance or creates a new
one if nothing exists. Also creates new instance in case the
process has been forked.
"""
if not hasattr(Vabamorf, 'pid') or Vabamorf.pid != os.getpid():
Vabamorf.pid = os.getpid()
Vabamorf.morf = Vabamorf()
return Vabamorf.morf
|
python
|
def instance():
"""Return an PyVabamorf instance.
It returns the previously initialized instance or creates a new
one if nothing exists. Also creates new instance in case the
process has been forked.
"""
if not hasattr(Vabamorf, 'pid') or Vabamorf.pid != os.getpid():
Vabamorf.pid = os.getpid()
Vabamorf.morf = Vabamorf()
return Vabamorf.morf
|
[
"def",
"instance",
"(",
")",
":",
"if",
"not",
"hasattr",
"(",
"Vabamorf",
",",
"'pid'",
")",
"or",
"Vabamorf",
".",
"pid",
"!=",
"os",
".",
"getpid",
"(",
")",
":",
"Vabamorf",
".",
"pid",
"=",
"os",
".",
"getpid",
"(",
")",
"Vabamorf",
".",
"morf",
"=",
"Vabamorf",
"(",
")",
"return",
"Vabamorf",
".",
"morf"
] |
Return an PyVabamorf instance.
It returns the previously initialized instance or creates a new
one if nothing exists. Also creates new instance in case the
process has been forked.
|
[
"Return",
"an",
"PyVabamorf",
"instance",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L101-L111
|
train
|
Return an instance of PyVabamorf.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ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KXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1011101 + 0o22) + chr(50) + chr(0b10100 + 0o37) + '\067', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1000001 + 0o56) + chr(64 - 14) + '\061' + chr(55), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b1 + 0o60) + '\x37' + chr(0b1101 + 0o51), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49) + chr(0b110000) + chr(49), 0o10), nzTpIcepk0o8(chr(1319 - 1271) + chr(0b1101111) + chr(51) + chr(673 - 624) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b101001 + 0o7) + '\157' + chr(0b10001 + 0o40) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1011100 + 0o23) + chr(0b110011) + chr(0b11111 + 0o23) + chr(249 - 195), 0b1000), nzTpIcepk0o8('\060' + chr(0b1011001 + 0o26) + chr(50) + '\061' + chr(52), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110100) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b10001 + 0o40) + chr(442 - 390) + chr(51), 4102 - 4094), nzTpIcepk0o8('\x30' + chr(0b1011111 + 0o20) + chr(49) + chr(793 - 742) + chr(52), 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\157' + chr(0b1 + 0o62) + '\x30' + chr(55), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(4002 - 3891) + chr(0b1111 + 0o42) + '\x36' + '\063', ord("\x08")), nzTpIcepk0o8(chr(605 - 557) + chr(1502 - 1391) + '\066' + chr(0b101110 + 0o7), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + chr(0b11100 + 0o32) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(111) + '\066' + chr(53), 8), nzTpIcepk0o8('\x30' + '\157' + '\063' + chr(2249 - 2196) + '\x37', 9572 - 9564), nzTpIcepk0o8(chr(0b110000) + chr(4525 - 4414) + chr(0b10011 + 0o36) + '\x34' + chr(52), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + chr(0b110100), 16187 - 16179), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1250 - 1201) + '\x37' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b0 + 0o60) + '\157' + chr(0b100 + 0o56) + chr(53) + chr(1950 - 1898), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\063' + '\x32' + chr(0b110011), 32 - 24), nzTpIcepk0o8(chr(1629 - 1581) + '\157' + '\061' + chr(48) + chr(0b100111 + 0o14), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + chr(0b100010 + 0o17) + chr(50), 0o10), nzTpIcepk0o8('\x30' + chr(2241 - 2130) + '\063' + chr(2875 - 2820) + chr(0b110111 + 0o0), 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b1101111) + '\062' + '\x34' + '\066', 0o10), nzTpIcepk0o8('\060' + chr(3292 - 3181) + chr(0b10111 + 0o32) + chr(0b110100) + chr(0b110011), 8), nzTpIcepk0o8(chr(0b110000) + chr(2743 - 2632) + '\x32' + chr(0b1000 + 0o52) + chr(53), 62833 - 62825), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + chr(49) + chr(1491 - 1442) + chr(0b110 + 0o54), 20543 - 20535), nzTpIcepk0o8('\060' + chr(1918 - 1807) + chr(52) + '\066', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b100111 + 0o13) + chr(0b11100 + 0o26) + chr(54), 0o10), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\x6f' + chr(0b110 + 0o55) + '\065' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(50) + chr(0b110110) + '\x33', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110010) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1947 - 1898) + '\060', 0o10), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(111) + chr(0b110011) + '\x34' + chr(53), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1001100 + 0o43) + chr(50) + chr(0b101011 + 0o11), 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(356 - 245) + '\061' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(111) + '\x34' + '\x30', 46212 - 46204)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(9677 - 9566) + chr(2483 - 2430) + '\060', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb1'), '\144' + chr(1789 - 1688) + chr(8312 - 8213) + chr(0b1101001 + 0o6) + chr(100) + chr(2172 - 2071))('\165' + chr(0b1110100) + chr(102) + chr(1783 - 1738) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def pjsAJr7KGJ5V():
if not dRKdVnHPFq7C(UUu1v1lnNuPT, roI3spqORKae(ES5oEprVxulp(b'\xef\xe6i'), '\144' + chr(0b1100101) + '\143' + '\x6f' + chr(0b1100001 + 0o3) + chr(0b1011000 + 0o15))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(1443 - 1398) + '\x38')) or roI3spqORKae(UUu1v1lnNuPT, roI3spqORKae(ES5oEprVxulp(b'\xdb\xf9Z&\x0e\x9b`\xb8\xcbZ"%'), chr(0b1100100) + '\x65' + chr(0b100100 + 0o77) + chr(0b1000101 + 0o52) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(8979 - 8863) + chr(0b1 + 0o145) + chr(45) + chr(56))) != roI3spqORKae(aHUqKstZLeS6, roI3spqORKae(ES5oEprVxulp(b'\xf8\xeay\x0e(\xac'), '\144' + '\145' + chr(0b1100011) + '\157' + chr(0b1100100) + '\145')(chr(588 - 471) + chr(116) + chr(0b1100110) + '\055' + '\070'))():
UUu1v1lnNuPT.DvWXOSonGyAy = aHUqKstZLeS6.getpid()
UUu1v1lnNuPT.cjBt1FQ7CuY8 = UUu1v1lnNuPT()
return roI3spqORKae(UUu1v1lnNuPT, roI3spqORKae(ES5oEprVxulp(b'\xfc\xe5O\np\x8e^\xe1\xcfV:d'), chr(100) + chr(0b101 + 0o140) + '\x63' + chr(0b1000100 + 0o53) + chr(100) + chr(101))(chr(117) + chr(0b10000 + 0o144) + '\x66' + '\x2d' + chr(0b10001 + 0o47)))
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
Vabamorf.analyze
|
def analyze(self, words, **kwargs):
"""Perform morphological analysis and disambiguation of given text.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
disambiguate: boolean (default: True)
Disambiguate the output and remove incosistent analysis.
guess: boolean (default: True)
Use guessing in case of unknown words
propername: boolean (default: True)
Perform additional analysis of proper names.
compound: boolean (default: True)
Add compound word markers to root forms.
phonetic: boolean (default: False)
Add phonetic information to root forms.
Returns
-------
list of (list of dict)
List of analysis for each word in input.
"""
# if input is a string, then tokenize it
if isinstance(words, six.string_types):
words = words.split()
# convert words to native strings
words = [convert(w) for w in words]
morfresults = self._morf.analyze(
vm.StringVector(words),
kwargs.get('disambiguate', True),
kwargs.get('guess', True),
True, # phonetic and compound information
kwargs.get('propername', True))
trim_phonetic = kwargs.get('phonetic', False)
trim_compound = kwargs.get('compound', True)
return [postprocess_result(mr, trim_phonetic, trim_compound) for mr in morfresults]
|
python
|
def analyze(self, words, **kwargs):
"""Perform morphological analysis and disambiguation of given text.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
disambiguate: boolean (default: True)
Disambiguate the output and remove incosistent analysis.
guess: boolean (default: True)
Use guessing in case of unknown words
propername: boolean (default: True)
Perform additional analysis of proper names.
compound: boolean (default: True)
Add compound word markers to root forms.
phonetic: boolean (default: False)
Add phonetic information to root forms.
Returns
-------
list of (list of dict)
List of analysis for each word in input.
"""
# if input is a string, then tokenize it
if isinstance(words, six.string_types):
words = words.split()
# convert words to native strings
words = [convert(w) for w in words]
morfresults = self._morf.analyze(
vm.StringVector(words),
kwargs.get('disambiguate', True),
kwargs.get('guess', True),
True, # phonetic and compound information
kwargs.get('propername', True))
trim_phonetic = kwargs.get('phonetic', False)
trim_compound = kwargs.get('compound', True)
return [postprocess_result(mr, trim_phonetic, trim_compound) for mr in morfresults]
|
[
"def",
"analyze",
"(",
"self",
",",
"words",
",",
"*",
"*",
"kwargs",
")",
":",
"# if input is a string, then tokenize it",
"if",
"isinstance",
"(",
"words",
",",
"six",
".",
"string_types",
")",
":",
"words",
"=",
"words",
".",
"split",
"(",
")",
"# convert words to native strings",
"words",
"=",
"[",
"convert",
"(",
"w",
")",
"for",
"w",
"in",
"words",
"]",
"morfresults",
"=",
"self",
".",
"_morf",
".",
"analyze",
"(",
"vm",
".",
"StringVector",
"(",
"words",
")",
",",
"kwargs",
".",
"get",
"(",
"'disambiguate'",
",",
"True",
")",
",",
"kwargs",
".",
"get",
"(",
"'guess'",
",",
"True",
")",
",",
"True",
",",
"# phonetic and compound information",
"kwargs",
".",
"get",
"(",
"'propername'",
",",
"True",
")",
")",
"trim_phonetic",
"=",
"kwargs",
".",
"get",
"(",
"'phonetic'",
",",
"False",
")",
"trim_compound",
"=",
"kwargs",
".",
"get",
"(",
"'compound'",
",",
"True",
")",
"return",
"[",
"postprocess_result",
"(",
"mr",
",",
"trim_phonetic",
",",
"trim_compound",
")",
"for",
"mr",
"in",
"morfresults",
"]"
] |
Perform morphological analysis and disambiguation of given text.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
disambiguate: boolean (default: True)
Disambiguate the output and remove incosistent analysis.
guess: boolean (default: True)
Use guessing in case of unknown words
propername: boolean (default: True)
Perform additional analysis of proper names.
compound: boolean (default: True)
Add compound word markers to root forms.
phonetic: boolean (default: False)
Add phonetic information to root forms.
Returns
-------
list of (list of dict)
List of analysis for each word in input.
|
[
"Perform",
"morphological",
"analysis",
"and",
"disambiguation",
"of",
"given",
"text",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L129-L169
|
train
|
Perform morphological analysis and disambiguation of given text.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1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PFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b10010 + 0o36) + '\x6f' + chr(0b110001) + chr(1859 - 1805) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + chr(0b110001) + '\060', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + chr(0b110010) + chr(0b110101), 20874 - 20866), nzTpIcepk0o8(chr(0b110000) + chr(0b1111 + 0o140) + '\062' + chr(0b110101) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(8262 - 8151) + chr(323 - 272) + '\063' + '\061', 20627 - 20619), nzTpIcepk0o8(chr(1213 - 1165) + chr(111) + chr(2628 - 2574) + chr(54), 0b1000), nzTpIcepk0o8(chr(1264 - 1216) + '\x6f' + chr(2414 - 2364) + '\064' + '\x33', 12088 - 12080), nzTpIcepk0o8(chr(1882 - 1834) + '\x6f' + chr(0b110010) + '\x35' + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(10478 - 10367) + chr(51) + chr(0b11010 + 0o33) + chr(0b100000 + 0o22), 13937 - 13929), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1101111) + '\062' + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1233 - 1179) + '\x37', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b1001 + 0o50) + chr(0b11010 + 0o32) + chr(55), 12163 - 12155), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b101011 + 0o104) + chr(0b110010) + chr(55) + '\062', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(55), 17497 - 17489), nzTpIcepk0o8(chr(0b1011 + 0o45) + '\x6f' + chr(49) + chr(52) + chr(0b110110), 64192 - 64184), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(111) + chr(0b111 + 0o52) + '\062' + chr(54), 0b1000), nzTpIcepk0o8('\x30' + chr(2137 - 2026) + chr(49) + '\060' + chr(1349 - 1298), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b100111 + 0o110) + chr(2300 - 2249) + chr(55) + '\x34', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(10747 - 10636) + chr(226 - 176) + chr(55) + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b11111 + 0o24) + '\065' + chr(0b11101 + 0o23), 0o10), nzTpIcepk0o8(chr(1164 - 1116) + '\157' + '\x31' + chr(49) + chr(0b11010 + 0o27), 0o10), nzTpIcepk0o8(chr(1132 - 1084) + chr(0b1101111) + chr(0b101 + 0o55) + '\x33' + chr(0b10111 + 0o32), 0b1000), nzTpIcepk0o8(chr(1142 - 1094) + chr(111) + chr(0b110101) + '\066', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\065' + '\067', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + chr(0b101011 + 0o14) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + '\x6f' + '\x32' + chr(0b10000 + 0o47) + '\061', 8), nzTpIcepk0o8('\060' + '\x6f' + chr(2247 - 2198) + chr(54) + chr(1152 - 1103), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\x33' + chr(0b110011) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x34' + chr(2251 - 2198), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + chr(48) + chr(0b11010 + 0o32), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + '\065' + '\060', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\064' + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\x6f' + chr(2374 - 2323) + chr(0b10001 + 0o46) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + '\061' + chr(0b1111 + 0o43), ord("\x08")), nzTpIcepk0o8('\060' + chr(2743 - 2632) + chr(0b110010) + '\x34' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(712 - 660) + '\066', 8), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110110) + chr(0b110001), 12114 - 12106), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b11101 + 0o24) + chr(2244 - 2191) + '\x32', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b1110 + 0o45) + '\064' + '\x34', 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + '\157' + chr(102 - 53) + chr(1666 - 1615) + chr(49), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b101010 + 0o6) + '\157' + '\x35' + '\060', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b']'), '\x64' + chr(101) + '\x63' + chr(1188 - 1077) + '\144' + '\145')(chr(0b1110101) + chr(116) + chr(102) + chr(0b101101) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def F0E3qnVmaCz7(hXMPsSrOQzbh, cHmedxd8XMtK, **q5n0sHDDTy90):
if suIjIS24Zkqw(cHmedxd8XMtK, roI3spqORKae(YVS_F7_wWn_o, roI3spqORKae(ES5oEprVxulp(b'\x00\xfc\xe7\xc7\xb7Q\xfc\xdd\x93bR\x14'), '\x64' + chr(0b110011 + 0o62) + '\143' + '\157' + chr(0b10001 + 0o123) + '\x65')(chr(117) + chr(116) + '\146' + chr(575 - 530) + '\x38'))):
cHmedxd8XMtK = cHmedxd8XMtK.LfRrQOxuDvnC()
cHmedxd8XMtK = [Ke7SAGs_qhbe(sm7_CLmeWGR7) for sm7_CLmeWGR7 in cHmedxd8XMtK]
fVtj35heXuBz = hXMPsSrOQzbh._morf.analyze(jfR8qmy1vJ8o.StringVector(cHmedxd8XMtK), q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\x17\xe1\xe6\xcf\xb4T\xca\xce\x9fsC\x02'), chr(0b1001000 + 0o34) + chr(101) + chr(0b1011110 + 0o5) + chr(4468 - 4357) + '\144' + '\x65')('\x75' + '\x74' + chr(0b1100110) + chr(1004 - 959) + '\x38'), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b100001 + 0o116) + '\x31', ord("\x08"))), q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\x14\xfd\xf0\xdd\xaa'), chr(100) + '\145' + '\x63' + chr(0b110111 + 0o70) + '\144' + '\145')('\165' + '\x74' + '\x66' + chr(0b11101 + 0o20) + '\070'), nzTpIcepk0o8(chr(1191 - 1143) + chr(111) + '\061', 8)), nzTpIcepk0o8('\060' + chr(111) + chr(2091 - 2042), 8), q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\x03\xfa\xfa\xde\xbcD\xcd\xc8\x87w'), chr(0b1100100) + chr(0b1100101) + chr(0b1010101 + 0o16) + chr(111) + chr(7307 - 7207) + chr(0b101101 + 0o70))('\165' + chr(116) + '\x66' + '\055' + chr(0b100 + 0o64)), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001), 8)))
anZA9mzkExpe = q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\x03\xe0\xfa\xc0\xbcB\xca\xca'), chr(100) + '\145' + chr(0b1100011) + '\157' + '\x64' + chr(0b101011 + 0o72))(chr(0b1110101) + chr(0b10100 + 0o140) + chr(0b111101 + 0o51) + '\x2d' + chr(56)), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\060', 0o10))
zfAeJn8ZsJCa = q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\x10\xe7\xf8\xde\xb6C\xcd\xcd'), '\144' + chr(0b1000 + 0o135) + chr(0b111111 + 0o44) + chr(11706 - 11595) + '\144' + chr(6169 - 6068))('\165' + '\x74' + chr(10133 - 10031) + chr(0b100001 + 0o14) + chr(0b111000)), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31', 8))
return [G5QxzK4hhvxN(yAQToW9n1j_S, anZA9mzkExpe, zfAeJn8ZsJCa) for yAQToW9n1j_S in fVtj35heXuBz]
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
Vabamorf.disambiguate
|
def disambiguate(self, words):
"""Disambiguate previously analyzed words.
Parameters
----------
words: list of dict
A sentence of words.
Returns
-------
list of dict
Sentence of disambiguated words.
"""
words = vm.SentenceAnalysis([as_wordanalysis(w) for w in words])
disambiguated = self._morf.disambiguate(words)
return [postprocess_result(mr, False, True) for mr in disambiguated]
|
python
|
def disambiguate(self, words):
"""Disambiguate previously analyzed words.
Parameters
----------
words: list of dict
A sentence of words.
Returns
-------
list of dict
Sentence of disambiguated words.
"""
words = vm.SentenceAnalysis([as_wordanalysis(w) for w in words])
disambiguated = self._morf.disambiguate(words)
return [postprocess_result(mr, False, True) for mr in disambiguated]
|
[
"def",
"disambiguate",
"(",
"self",
",",
"words",
")",
":",
"words",
"=",
"vm",
".",
"SentenceAnalysis",
"(",
"[",
"as_wordanalysis",
"(",
"w",
")",
"for",
"w",
"in",
"words",
"]",
")",
"disambiguated",
"=",
"self",
".",
"_morf",
".",
"disambiguate",
"(",
"words",
")",
"return",
"[",
"postprocess_result",
"(",
"mr",
",",
"False",
",",
"True",
")",
"for",
"mr",
"in",
"disambiguated",
"]"
] |
Disambiguate previously analyzed words.
Parameters
----------
words: list of dict
A sentence of words.
Returns
-------
list of dict
Sentence of disambiguated words.
|
[
"Disambiguate",
"previously",
"analyzed",
"words",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L171-L186
|
train
|
Disambiguate previously analyzed words.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwE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,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + '\063' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + chr(50) + chr(621 - 568), ord("\x08")), nzTpIcepk0o8(chr(1104 - 1056) + '\x6f' + '\061' + chr(1100 - 1048) + chr(0b110001), 45672 - 45664), nzTpIcepk0o8('\060' + chr(0b1011000 + 0o27) + '\061' + chr(48) + chr(1874 - 1826), 0b1000), nzTpIcepk0o8('\060' + chr(7654 - 7543) + chr(0b10101 + 0o34) + '\x36' + chr(133 - 85), ord("\x08")), nzTpIcepk0o8(chr(1406 - 1358) + chr(7237 - 7126) + chr(0b110010) + '\060' + chr(0b110010), 18313 - 18305), nzTpIcepk0o8('\060' + chr(0b110000 + 0o77) + chr(50) + chr(2527 - 2475) + chr(1996 - 1946), 0b1000), nzTpIcepk0o8(chr(807 - 759) + '\x6f' + chr(49) + '\064' + '\x32', 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\x6f' + '\x32' + chr(0b110011) + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110110) + '\066', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b11001 + 0o126) + chr(54), 47678 - 47670), nzTpIcepk0o8(chr(0b110000) + chr(0b10110 + 0o131) + '\x31' + chr(48) + chr(48), 8), nzTpIcepk0o8(chr(0b110000) + chr(4218 - 4107) + chr(506 - 458), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101001 + 0o6) + chr(0b1 + 0o60) + chr(1745 - 1697) + chr(0b100000 + 0o20), 8), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b1101111) + chr(0b110100) + chr(480 - 426), 0b1000), nzTpIcepk0o8(chr(309 - 261) + '\157' + chr(52) + chr(55), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1100111 + 0o10) + chr(0b110101) + chr(2213 - 2160), 0b1000), nzTpIcepk0o8('\x30' + chr(0b101101 + 0o102) + '\x31' + chr(0b100001 + 0o26) + chr(2440 - 2388), 0b1000), nzTpIcepk0o8(chr(718 - 670) + chr(0b1101 + 0o142) + chr(0b10001 + 0o40) + chr(54) + '\066', 0o10), nzTpIcepk0o8('\060' + chr(2286 - 2175) + chr(0b110001) + chr(0b110110) + '\067', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\061' + chr(49) + '\x34', 36125 - 36117), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + chr(51) + chr(1798 - 1747), 3532 - 3524), nzTpIcepk0o8(chr(608 - 560) + chr(0b1101111) + chr(0b110110), 8), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101111) + '\063' + chr(0b110000) + '\x33', 8467 - 8459), nzTpIcepk0o8(chr(0b0 + 0o60) + '\157' + chr(0b101010 + 0o11) + chr(50), 0o10), nzTpIcepk0o8('\x30' + chr(4466 - 4355) + '\x37', 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\x6f' + '\062' + chr(55) + chr(50), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + chr(55) + chr(456 - 403), 13043 - 13035), nzTpIcepk0o8(chr(829 - 781) + chr(4891 - 4780) + chr(0b110011) + '\062' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(55) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(0b1101 + 0o142) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1101111) + chr(0b110001) + chr(0b101111 + 0o6) + '\061', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b1010 + 0o50) + chr(49) + chr(0b110110), 62935 - 62927), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(111) + '\x31' + chr(53) + chr(1310 - 1255), ord("\x08")), nzTpIcepk0o8(chr(1441 - 1393) + '\157' + chr(51) + chr(0b110001) + chr(53), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(986 - 935) + chr(2139 - 2089) + chr(0b110110), 8), nzTpIcepk0o8('\x30' + '\x6f' + chr(50) + '\x32' + chr(0b11 + 0o57), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101111 + 0o3) + chr(0b110111) + chr(0b110101), 8), nzTpIcepk0o8(chr(2262 - 2214) + '\x6f' + '\063' + '\x37' + '\x34', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(4595 - 4484) + '\x31' + chr(51), 17736 - 17728)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + '\065' + chr(0b100001 + 0o17), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'q'), chr(0b1100100) + '\145' + chr(0b110100 + 0o57) + '\157' + chr(8526 - 8426) + chr(101))(chr(0b111110 + 0o67) + '\x74' + chr(0b1100110) + chr(45) + chr(0b111 + 0o61)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def BlNtFadPzZ8p(hXMPsSrOQzbh, cHmedxd8XMtK):
cHmedxd8XMtK = jfR8qmy1vJ8o.SentenceAnalysis([P57k_7Y4lbai(sm7_CLmeWGR7) for sm7_CLmeWGR7 in cHmedxd8XMtK])
_AtsvHSIeuhw = hXMPsSrOQzbh._morf.BlNtFadPzZ8p(cHmedxd8XMtK)
return [G5QxzK4hhvxN(yAQToW9n1j_S, nzTpIcepk0o8('\x30' + '\x6f' + chr(0b101011 + 0o5), 8), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(111) + chr(49), 0b1000)) for yAQToW9n1j_S in _AtsvHSIeuhw]
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
Vabamorf.spellcheck
|
def spellcheck(self, words, suggestions=True):
"""Spellcheck given sentence.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
suggestions: boolean (default: True)
Add spell suggestions to result.
Returns
-------
list of dict
Each dictionary contains following values:
'word': the original word
'spelling': True, if the word was spelled correctly
'suggestions': list of suggested strings in case of incorrect spelling
"""
if isinstance(words, six.string_types):
words = words.split()
# convert words to native strings
words = [convert(w) for w in words]
spellresults = self._morf.spellcheck(words, suggestions)
results = []
for spellresult in spellresults:
suggestions = [deconvert(s) for s in spellresult.suggestions]
result = {
'text': deconvert(spellresult.word),
'spelling': spellresult.spelling,
'suggestions': suggestions
}
results.append(result)
return results
|
python
|
def spellcheck(self, words, suggestions=True):
"""Spellcheck given sentence.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
suggestions: boolean (default: True)
Add spell suggestions to result.
Returns
-------
list of dict
Each dictionary contains following values:
'word': the original word
'spelling': True, if the word was spelled correctly
'suggestions': list of suggested strings in case of incorrect spelling
"""
if isinstance(words, six.string_types):
words = words.split()
# convert words to native strings
words = [convert(w) for w in words]
spellresults = self._morf.spellcheck(words, suggestions)
results = []
for spellresult in spellresults:
suggestions = [deconvert(s) for s in spellresult.suggestions]
result = {
'text': deconvert(spellresult.word),
'spelling': spellresult.spelling,
'suggestions': suggestions
}
results.append(result)
return results
|
[
"def",
"spellcheck",
"(",
"self",
",",
"words",
",",
"suggestions",
"=",
"True",
")",
":",
"if",
"isinstance",
"(",
"words",
",",
"six",
".",
"string_types",
")",
":",
"words",
"=",
"words",
".",
"split",
"(",
")",
"# convert words to native strings",
"words",
"=",
"[",
"convert",
"(",
"w",
")",
"for",
"w",
"in",
"words",
"]",
"spellresults",
"=",
"self",
".",
"_morf",
".",
"spellcheck",
"(",
"words",
",",
"suggestions",
")",
"results",
"=",
"[",
"]",
"for",
"spellresult",
"in",
"spellresults",
":",
"suggestions",
"=",
"[",
"deconvert",
"(",
"s",
")",
"for",
"s",
"in",
"spellresult",
".",
"suggestions",
"]",
"result",
"=",
"{",
"'text'",
":",
"deconvert",
"(",
"spellresult",
".",
"word",
")",
",",
"'spelling'",
":",
"spellresult",
".",
"spelling",
",",
"'suggestions'",
":",
"suggestions",
"}",
"results",
".",
"append",
"(",
"result",
")",
"return",
"results"
] |
Spellcheck given sentence.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
suggestions: boolean (default: True)
Add spell suggestions to result.
Returns
-------
list of dict
Each dictionary contains following values:
'word': the original word
'spelling': True, if the word was spelled correctly
'suggestions': list of suggested strings in case of incorrect spelling
|
[
"Spellcheck",
"given",
"sentence",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L188-L226
|
train
|
Spellcheck given sentence.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9y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ingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(10401 - 10290) + chr(0b100 + 0o60) + chr(2461 - 2411), 0b1000), nzTpIcepk0o8(chr(677 - 629) + chr(0b101010 + 0o105) + chr(0b110010 + 0o1) + '\065' + '\061', 22611 - 22603), nzTpIcepk0o8(chr(0b110000) + chr(0b100100 + 0o113) + '\x32' + chr(879 - 826) + chr(53), 63915 - 63907), nzTpIcepk0o8(chr(48) + chr(111) + chr(897 - 848) + chr(0b110000 + 0o7) + '\062', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x33' + '\x31' + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(1211 - 1100) + '\x35' + chr(0b11011 + 0o31), 0o10), nzTpIcepk0o8(chr(604 - 556) + chr(8770 - 8659) + chr(0b11110 + 0o24) + chr(1624 - 1571) + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + '\x36' + chr(0b110101), 55174 - 55166), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + chr(54) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(432 - 384) + '\x6f' + chr(0b101010 + 0o11) + '\x33' + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1561 - 1511) + '\x36' + chr(0b110000), 0b1000), nzTpIcepk0o8('\060' + chr(0b1100010 + 0o15) + chr(49) + chr(51) + chr(0b110100), 62472 - 62464), nzTpIcepk0o8('\x30' + '\157' + '\x33' + '\x34' + chr(0b10100 + 0o42), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(186 - 137) + '\x30' + chr(0b110010), 2593 - 2585), nzTpIcepk0o8(chr(0b110000) + chr(0b1101 + 0o142) + '\x33' + chr(97 - 42) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\060' + chr(7480 - 7369) + chr(1286 - 1236) + chr(0b110110) + chr(51), ord("\x08")), nzTpIcepk0o8('\x30' + chr(7651 - 7540) + chr(2373 - 2324) + '\061', 0o10), nzTpIcepk0o8(chr(48) + chr(3125 - 3014) + chr(0b110010) + '\066' + '\x34', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b101001 + 0o15), 55620 - 55612), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(9947 - 9836) + chr(0b100101 + 0o16) + chr(1734 - 1685) + chr(2028 - 1974), 0b1000), nzTpIcepk0o8(chr(740 - 692) + '\x6f' + chr(1709 - 1660) + chr(0b11000 + 0o32) + '\x35', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110101) + '\065', 47031 - 47023), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b10101 + 0o34) + chr(0b110110) + '\x31', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + '\063' + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + chr(53) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(842 - 794) + chr(0b1101111) + chr(1296 - 1245) + '\x37' + chr(1099 - 1046), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(1535 - 1484) + chr(393 - 343) + '\063', 0b1000), nzTpIcepk0o8(chr(551 - 503) + chr(10141 - 10030) + chr(0b110011) + chr(0b110010) + chr(1650 - 1602), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + chr(1345 - 1297) + '\x33', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + '\x34' + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(0b110010) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b1000 + 0o52) + '\x36', 62009 - 62001), nzTpIcepk0o8('\x30' + chr(7225 - 7114) + '\x32' + chr(2775 - 2722), 0o10), nzTpIcepk0o8('\060' + chr(6263 - 6152) + chr(0b110011) + chr(0b1001 + 0o52) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(728 - 678) + chr(0b110010) + chr(0b110010 + 0o2), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(691 - 637) + '\066', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1579 - 1529) + '\x31' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1101 + 0o44) + '\067' + chr(53), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1001 + 0o50) + chr(55) + chr(0b11001 + 0o30), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + chr(1368 - 1319), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(111) + chr(0b110101) + chr(0b110000), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x0c'), chr(0b1100100) + chr(0b1100101) + chr(7015 - 6916) + chr(111) + chr(0b110110 + 0o56) + chr(0b1010110 + 0o17))(chr(0b1100101 + 0o20) + chr(116) + chr(0b1100110) + '\x2d' + chr(1663 - 1607)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def lupTpg9ICfIl(hXMPsSrOQzbh, cHmedxd8XMtK, a_MXx18jyYQa=nzTpIcepk0o8(chr(0b110000) + chr(8000 - 7889) + chr(0b11001 + 0o30), 0o10)):
if suIjIS24Zkqw(cHmedxd8XMtK, roI3spqORKae(YVS_F7_wWn_o, roI3spqORKae(ES5oEprVxulp(b'Q\x9d\xdf\x13\xa7K\xf5\x81\t\xa9\xd5/'), '\144' + chr(0b1010010 + 0o23) + chr(1333 - 1234) + chr(4723 - 4612) + chr(2112 - 2012) + '\x65')(chr(117) + '\164' + '\146' + chr(45) + chr(0b111000)))):
cHmedxd8XMtK = cHmedxd8XMtK.LfRrQOxuDvnC()
cHmedxd8XMtK = [Ke7SAGs_qhbe(sm7_CLmeWGR7) for sm7_CLmeWGR7 in cHmedxd8XMtK]
U57DGXAwLVX7 = hXMPsSrOQzbh._morf.spellcheck(cHmedxd8XMtK, a_MXx18jyYQa)
v3B6eeO_B_ws = []
for OKLVdEXWmTaB in U57DGXAwLVX7:
a_MXx18jyYQa = [eYftgUdPaBGz(PmE5_h409JAA) for PmE5_h409JAA in OKLVdEXWmTaB.a_MXx18jyYQa]
POx95m7SPOVy = {roI3spqORKae(ES5oEprVxulp(b'V\x8c\xd5\x0e'), chr(1491 - 1391) + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(101))('\x75' + '\x74' + chr(0b1001101 + 0o31) + chr(0b11001 + 0o24) + '\x38'): eYftgUdPaBGz(OKLVdEXWmTaB.JXVFyF8k4nGR), roI3spqORKae(ES5oEprVxulp(b'Q\x99\xc8\x16\xa5E\xc4\x92'), chr(100) + '\145' + chr(0b1011011 + 0o10) + chr(0b1011111 + 0o20) + chr(1523 - 1423) + chr(0b10 + 0o143))('\165' + '\x74' + '\146' + '\x2d' + chr(2767 - 2711)): OKLVdEXWmTaB.spelling, roI3spqORKae(ES5oEprVxulp(b'Q\x9c\xca\x1d\xac_\xde\x9c\x1f\xb7\xc3'), chr(0b1100100) + chr(2816 - 2715) + chr(5796 - 5697) + '\157' + '\144' + chr(0b10101 + 0o120))(chr(8793 - 8676) + '\x74' + '\x66' + chr(45) + chr(56)): a_MXx18jyYQa}
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'j\xbd\xfeN\xb1K\xed\x9a\x1a\xb6\xe5i'), '\x64' + '\x65' + '\143' + '\x6f' + chr(0b1100100) + chr(101))(chr(0b101010 + 0o113) + chr(0b1110100) + chr(0b1011000 + 0o16) + chr(0b101101) + chr(0b1111 + 0o51)))(POx95m7SPOVy)
return v3B6eeO_B_ws
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
Vabamorf.fix_spelling
|
def fix_spelling(self, words, join=True, joinstring=' '):
"""Simple function for quickly correcting misspelled words.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
join: boolean (default: True)
Should we join the list of words into a single string.
joinstring: str (default: ' ')
The string that will be used to join together the fixed words.
Returns
-------
str
In case join is True
list of str
In case join is False.
"""
fixed_words = []
for word in self.spellcheck(words, suggestions=True):
if word['spelling']:
fixed_words.append(word['text'])
else:
suggestions = word['suggestions']
if len(suggestions) > 0:
fixed_words.append(suggestions[0])
else:
fixed_words.append(word['text'])
if join:
return joinstring.join(fixed_words)
else:
return fixed_words
|
python
|
def fix_spelling(self, words, join=True, joinstring=' '):
"""Simple function for quickly correcting misspelled words.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
join: boolean (default: True)
Should we join the list of words into a single string.
joinstring: str (default: ' ')
The string that will be used to join together the fixed words.
Returns
-------
str
In case join is True
list of str
In case join is False.
"""
fixed_words = []
for word in self.spellcheck(words, suggestions=True):
if word['spelling']:
fixed_words.append(word['text'])
else:
suggestions = word['suggestions']
if len(suggestions) > 0:
fixed_words.append(suggestions[0])
else:
fixed_words.append(word['text'])
if join:
return joinstring.join(fixed_words)
else:
return fixed_words
|
[
"def",
"fix_spelling",
"(",
"self",
",",
"words",
",",
"join",
"=",
"True",
",",
"joinstring",
"=",
"' '",
")",
":",
"fixed_words",
"=",
"[",
"]",
"for",
"word",
"in",
"self",
".",
"spellcheck",
"(",
"words",
",",
"suggestions",
"=",
"True",
")",
":",
"if",
"word",
"[",
"'spelling'",
"]",
":",
"fixed_words",
".",
"append",
"(",
"word",
"[",
"'text'",
"]",
")",
"else",
":",
"suggestions",
"=",
"word",
"[",
"'suggestions'",
"]",
"if",
"len",
"(",
"suggestions",
")",
">",
"0",
":",
"fixed_words",
".",
"append",
"(",
"suggestions",
"[",
"0",
"]",
")",
"else",
":",
"fixed_words",
".",
"append",
"(",
"word",
"[",
"'text'",
"]",
")",
"if",
"join",
":",
"return",
"joinstring",
".",
"join",
"(",
"fixed_words",
")",
"else",
":",
"return",
"fixed_words"
] |
Simple function for quickly correcting misspelled words.
Parameters
----------
words: list of str or str
Either a list of pretokenized words or a string. In case of a string, it will be splitted using
default behaviour of string.split() function.
join: boolean (default: True)
Should we join the list of words into a single string.
joinstring: str (default: ' ')
The string that will be used to join together the fixed words.
Returns
-------
str
In case join is True
list of str
In case join is False.
|
[
"Simple",
"function",
"for",
"quickly",
"correcting",
"misspelled",
"words",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L228-L262
|
train
|
Simple function for quickly correcting misspelled words.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjV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vC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b101111 + 0o100) + '\063' + '\061' + chr(54), 50131 - 50123), nzTpIcepk0o8(chr(714 - 666) + chr(111) + chr(0b110011) + chr(1500 - 1445) + chr(672 - 620), 0o10), nzTpIcepk0o8(chr(48) + chr(6923 - 6812) + chr(55) + chr(841 - 792), 32213 - 32205), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(0b100101 + 0o112) + '\061' + chr(55) + chr(48), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x31' + chr(0b110110 + 0o0) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(6542 - 6431) + chr(0b110001) + chr(0b110111) + chr(55), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b11101 + 0o122) + '\063' + chr(2155 - 2106) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\x6f' + '\x32' + chr(55) + chr(51), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + '\x35' + '\x35', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b10101 + 0o132) + chr(0b110001) + chr(1934 - 1886) + '\063', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b100010 + 0o20) + '\x35' + chr(96 - 46), 34411 - 34403), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(0b10111 + 0o33) + chr(1749 - 1697), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1100111 + 0o10) + chr(0b110001) + chr(0b110000) + chr(0b110110), 58556 - 58548), nzTpIcepk0o8(chr(1220 - 1172) + '\x6f' + chr(0b10 + 0o60) + chr(0b100011 + 0o20) + '\066', 1315 - 1307), nzTpIcepk0o8('\060' + '\157' + '\062' + chr(0b100011 + 0o17) + '\062', 0o10), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(3932 - 3821) + chr(1611 - 1560) + chr(2322 - 2272) + chr(0b110001), 9766 - 9758), nzTpIcepk0o8('\x30' + chr(0b111001 + 0o66) + chr(0b100010 + 0o21) + '\061' + chr(0b111 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(1771 - 1723) + '\157' + '\062' + '\x36' + chr(0b11100 + 0o30), 37217 - 37209), nzTpIcepk0o8(chr(48) + chr(10150 - 10039) + chr(0b110001) + chr(51) + '\064', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(421 - 372) + chr(49) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(80 - 32) + chr(9369 - 9258) + '\063' + '\x34' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(111) + chr(0b100001 + 0o20) + chr(2971 - 2916) + '\061', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b11110 + 0o30) + chr(0b100011 + 0o17), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b10011 + 0o37) + chr(50) + chr(53), 63776 - 63768), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x32' + '\x31' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + '\062' + '\061', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + chr(2166 - 2118) + chr(0b100011 + 0o15), 3948 - 3940), nzTpIcepk0o8('\060' + chr(0b11111 + 0o120) + '\x31' + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(7634 - 7523) + '\x33' + chr(49) + chr(0b101101 + 0o12), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + chr(1265 - 1211), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b101010 + 0o10) + chr(2716 - 2662) + '\066', 0o10), nzTpIcepk0o8('\060' + chr(8013 - 7902) + chr(0b101011 + 0o10) + chr(71 - 22) + chr(565 - 510), 8), nzTpIcepk0o8('\060' + chr(0b1011001 + 0o26) + '\063' + chr(54) + chr(53), 27973 - 27965), nzTpIcepk0o8(chr(1087 - 1039) + chr(4924 - 4813) + chr(493 - 442) + chr(1367 - 1314), 17149 - 17141), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(50) + '\x34' + chr(0b101 + 0o62), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110011) + chr(0b11000 + 0o31) + chr(0b11110 + 0o27), 8), nzTpIcepk0o8('\060' + chr(10240 - 10129) + chr(932 - 883) + chr(0b100001 + 0o24) + chr(0b11000 + 0o33), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(350 - 239) + chr(0b110000 + 0o4) + chr(150 - 100), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(2397 - 2345) + chr(0b1110 + 0o47), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(0b101100 + 0o12) + '\x31', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1948 - 1900) + chr(0b100 + 0o153) + '\065' + chr(48), 4621 - 4613)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe0'), chr(2999 - 2899) + chr(101) + chr(99) + chr(922 - 811) + chr(0b100001 + 0o103) + chr(0b1100101))(chr(10538 - 10421) + chr(3143 - 3027) + chr(4051 - 3949) + chr(45) + chr(3109 - 3053)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Dp3LYmpUdwfT(hXMPsSrOQzbh, cHmedxd8XMtK, Y4yM9BcfTCNq=nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b101111 + 0o2), ord("\x08")), JBUoMWtZ4MdI=roI3spqORKae(ES5oEprVxulp(b'\xee'), chr(1013 - 913) + '\145' + chr(0b1010101 + 0o16) + chr(111) + chr(7499 - 7399) + chr(0b1000 + 0o135))(chr(117) + chr(9773 - 9657) + '\x66' + chr(45) + chr(56))):
l_bgPImRACDh = []
for JXVFyF8k4nGR in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xbd\x8c\\\x14\x1e\x1c\xa7\xde\x0e('), chr(5270 - 5170) + '\x65' + chr(2708 - 2609) + chr(111) + chr(0b1100100) + chr(101))(chr(117) + chr(116) + chr(0b110101 + 0o61) + chr(0b100001 + 0o14) + chr(343 - 287)))(cHmedxd8XMtK, suggestions=nzTpIcepk0o8(chr(0b110000) + chr(4458 - 4347) + chr(0b110001), 8)):
if JXVFyF8k4nGR[roI3spqORKae(ES5oEprVxulp(b'\xbd\x8c\\\x14\x1e\x16\xa1\xdc'), chr(407 - 307) + chr(0b1100101) + '\143' + chr(111) + '\144' + '\145')('\165' + '\x74' + '\146' + chr(45) + '\x38')]:
roI3spqORKae(l_bgPImRACDh, roI3spqORKae(ES5oEprVxulp(b'\x86\xa8jL\n\x18\x88\xd4\x07,\xff\xa1'), chr(8083 - 7983) + chr(101) + chr(0b1011100 + 0o7) + '\157' + '\x64' + chr(0b1100101))(chr(117) + '\x74' + chr(0b1100110 + 0o0) + chr(0b101100 + 0o1) + chr(56)))(JXVFyF8k4nGR[roI3spqORKae(ES5oEprVxulp(b'\xba\x99A\x0c'), chr(0b11100 + 0o110) + chr(101) + chr(0b1100011) + '\x6f' + chr(0b1100000 + 0o4) + chr(6582 - 6481))(chr(0b1110101) + chr(10864 - 10748) + '\146' + chr(0b1101 + 0o40) + chr(0b110111 + 0o1))])
else:
a_MXx18jyYQa = JXVFyF8k4nGR[roI3spqORKae(ES5oEprVxulp(b'\xbd\x89^\x1f\x17\x0c\xbb\xd2\x02-\xd9'), '\144' + chr(8525 - 8424) + chr(0b1100011) + chr(0b1100000 + 0o17) + chr(0b111111 + 0o45) + '\145')(chr(117) + '\164' + chr(7056 - 6954) + chr(0b101001 + 0o4) + chr(1047 - 991))]
if ftfygxgFas5X(a_MXx18jyYQa) > nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b1101111) + chr(1569 - 1521), 0b1000):
roI3spqORKae(l_bgPImRACDh, roI3spqORKae(ES5oEprVxulp(b'\x86\xa8jL\n\x18\x88\xd4\x07,\xff\xa1'), '\144' + '\145' + '\x63' + chr(111) + '\x64' + '\x65')(chr(0b11101 + 0o130) + '\x74' + '\146' + chr(0b110 + 0o47) + '\x38'))(a_MXx18jyYQa[nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x30', 8)])
else:
roI3spqORKae(l_bgPImRACDh, roI3spqORKae(ES5oEprVxulp(b'\x86\xa8jL\n\x18\x88\xd4\x07,\xff\xa1'), '\144' + '\145' + chr(3953 - 3854) + chr(0b1101111) + chr(0b1100100) + chr(3647 - 3546))('\165' + chr(11015 - 10899) + '\146' + '\055' + chr(0b111000)))(JXVFyF8k4nGR[roI3spqORKae(ES5oEprVxulp(b'\xba\x99A\x0c'), chr(100) + chr(334 - 233) + chr(0b1111 + 0o124) + chr(0b1101000 + 0o7) + chr(0b10100 + 0o120) + chr(101))(chr(0b1110101) + '\164' + chr(0b111100 + 0o52) + '\x2d' + chr(2967 - 2911))])
if Y4yM9BcfTCNq:
return roI3spqORKae(JBUoMWtZ4MdI, roI3spqORKae(ES5oEprVxulp(b'\x97\xc8@5K=\xac\xdd9\x00\xe4\xe5'), chr(2845 - 2745) + chr(0b1100101) + chr(99) + chr(0b111000 + 0o67) + chr(0b1011111 + 0o5) + chr(3641 - 3540))(chr(0b1110101) + chr(0b1100 + 0o150) + chr(102) + chr(0b100101 + 0o10) + '\070'))(l_bgPImRACDh)
else:
return l_bgPImRACDh
|
estnltk/estnltk
|
estnltk/vabamorf/morf.py
|
Vabamorf.synthesize
|
def synthesize(self, lemma, form, partofspeech='', hint='', guess=True, phonetic=False):
"""Synthesize a single word based on given morphological attributes.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
lemma: str
The lemma of the word(s) to be synthesized.
form: str
The form of the word(s) to be synthesized.
partofspeech: str
Part-of-speech.
hint: str
Hint.
guess: boolean (default: True)
Use heuristics when synthesizing unknown words.
phonetic: boolean (default: False)
Add phonetic markup to synthesized words.
Returns
-------
list
List of synthesized words.
"""
words = self._morf.synthesize(
convert(lemma.strip()),
convert(form.strip()),
convert(partofspeech.strip()),
convert(hint.strip()),
guess,
phonetic
)
return [deconvert(w) for w in words]
|
python
|
def synthesize(self, lemma, form, partofspeech='', hint='', guess=True, phonetic=False):
"""Synthesize a single word based on given morphological attributes.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
lemma: str
The lemma of the word(s) to be synthesized.
form: str
The form of the word(s) to be synthesized.
partofspeech: str
Part-of-speech.
hint: str
Hint.
guess: boolean (default: True)
Use heuristics when synthesizing unknown words.
phonetic: boolean (default: False)
Add phonetic markup to synthesized words.
Returns
-------
list
List of synthesized words.
"""
words = self._morf.synthesize(
convert(lemma.strip()),
convert(form.strip()),
convert(partofspeech.strip()),
convert(hint.strip()),
guess,
phonetic
)
return [deconvert(w) for w in words]
|
[
"def",
"synthesize",
"(",
"self",
",",
"lemma",
",",
"form",
",",
"partofspeech",
"=",
"''",
",",
"hint",
"=",
"''",
",",
"guess",
"=",
"True",
",",
"phonetic",
"=",
"False",
")",
":",
"words",
"=",
"self",
".",
"_morf",
".",
"synthesize",
"(",
"convert",
"(",
"lemma",
".",
"strip",
"(",
")",
")",
",",
"convert",
"(",
"form",
".",
"strip",
"(",
")",
")",
",",
"convert",
"(",
"partofspeech",
".",
"strip",
"(",
")",
")",
",",
"convert",
"(",
"hint",
".",
"strip",
"(",
")",
")",
",",
"guess",
",",
"phonetic",
")",
"return",
"[",
"deconvert",
"(",
"w",
")",
"for",
"w",
"in",
"words",
"]"
] |
Synthesize a single word based on given morphological attributes.
Note that spellchecker does not respect pre-tokenized words and concatenates
token sequences such as "New York".
Parameters
----------
lemma: str
The lemma of the word(s) to be synthesized.
form: str
The form of the word(s) to be synthesized.
partofspeech: str
Part-of-speech.
hint: str
Hint.
guess: boolean (default: True)
Use heuristics when synthesizing unknown words.
phonetic: boolean (default: False)
Add phonetic markup to synthesized words.
Returns
-------
list
List of synthesized words.
|
[
"Synthesize",
"a",
"single",
"word",
"based",
"on",
"given",
"morphological",
"attributes",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/vabamorf/morf.py#L265-L299
|
train
|
Synthesize a single word based on given morphological attributes.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204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Py2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(400 - 289) + chr(0b10010 + 0o41) + chr(0b10011 + 0o42) + chr(574 - 521), 0b1000), nzTpIcepk0o8(chr(779 - 731) + chr(0b1101111) + chr(599 - 549) + chr(0b110011) + chr(0b110000), 29449 - 29441), nzTpIcepk0o8('\060' + chr(5827 - 5716) + '\x31' + '\066' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1017 - 968) + chr(0b101100 + 0o11) + '\065', 0o10), nzTpIcepk0o8(chr(900 - 852) + '\157' + '\065' + chr(2403 - 2348), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + '\x34' + chr(0b110100), 17466 - 17458), nzTpIcepk0o8('\x30' + chr(0b101010 + 0o105) + chr(1845 - 1794) + chr(49) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(2460 - 2349) + '\063' + chr(0b101 + 0o53) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(8278 - 8167) + chr(0b101000 + 0o11) + chr(690 - 636) + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(563 - 512) + chr(52) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(1827 - 1779) + chr(111) + '\x32' + chr(2190 - 2135) + chr(53), 46714 - 46706), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(108 - 54) + chr(262 - 213), ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(111) + '\x32' + chr(0b110011) + '\x37', 0b1000), nzTpIcepk0o8('\x30' + chr(3956 - 3845) + chr(0b110001) + chr(0b110101) + '\066', 27085 - 27077), nzTpIcepk0o8('\x30' + chr(3644 - 3533) + chr(522 - 472) + chr(56 - 3) + chr(748 - 696), 0o10), nzTpIcepk0o8(chr(2033 - 1985) + chr(2990 - 2879) + chr(0b110011) + chr(1442 - 1388) + '\x33', 0b1000), nzTpIcepk0o8('\x30' + chr(1545 - 1434) + chr(50) + chr(548 - 497), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(426 - 377) + chr(51) + chr(0b110001), 60460 - 60452), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061' + '\x33' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b11011 + 0o32), 0o10), nzTpIcepk0o8(chr(1072 - 1024) + chr(9558 - 9447) + chr(0b110001) + chr(1981 - 1929) + chr(0b101111 + 0o5), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(9852 - 9741) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b10001 + 0o40) + chr(53) + '\061', 58203 - 58195), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(4160 - 4049) + chr(2252 - 2203) + '\x30' + '\x37', 41323 - 41315), nzTpIcepk0o8(chr(1918 - 1870) + chr(0b1101111) + chr(0b11110 + 0o24), 0o10), nzTpIcepk0o8(chr(1930 - 1882) + chr(0b1101111) + chr(49) + chr(51) + chr(0b11011 + 0o27), 0o10), nzTpIcepk0o8(chr(1882 - 1834) + chr(0b1101111) + chr(651 - 600) + chr(1393 - 1345), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + '\x36' + '\x34', 48024 - 48016), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(6814 - 6703) + chr(0b110011) + chr(55) + '\x30', 40424 - 40416), nzTpIcepk0o8(chr(2010 - 1962) + chr(111) + '\061' + '\x35' + chr(2762 - 2707), 25351 - 25343), nzTpIcepk0o8('\060' + chr(111) + chr(0b10101 + 0o34) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + chr(7188 - 7077) + '\x32', 8), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1000000 + 0o57) + chr(49) + '\x34' + chr(2163 - 2113), 9317 - 9309), nzTpIcepk0o8(chr(48) + chr(3849 - 3738) + chr(1012 - 961) + '\065' + '\x30', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + chr(0b110111) + '\065', 45303 - 45295), nzTpIcepk0o8('\x30' + '\157' + chr(0b110 + 0o54) + '\x33' + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(1553 - 1505) + '\157' + chr(51) + '\x36', 29722 - 29714), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\063' + chr(0b110111) + '\066', ord("\x08")), nzTpIcepk0o8(chr(1976 - 1928) + '\157' + '\063' + chr(1155 - 1101) + chr(0b110000), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x35' + chr(793 - 745), 28362 - 28354)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xc3'), '\x64' + '\x65' + '\x63' + '\x6f' + '\144' + '\145')('\x75' + chr(0b1000100 + 0o60) + chr(0b1001011 + 0o33) + chr(658 - 613) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def DmvEECLLmgVV(hXMPsSrOQzbh, W6axg8J0N9kP, qnYTYR39V38E, Hv2u8JijDJY4=roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(0b1001001 + 0o34) + '\x63' + chr(0b1011111 + 0o20) + chr(0b1000111 + 0o35) + chr(0b1100101))('\x75' + chr(11149 - 11033) + chr(0b1110 + 0o130) + chr(0b101101) + chr(0b111000)), bcPgAa5xDKMy=roI3spqORKae(ES5oEprVxulp(b''), chr(100) + chr(0b1011011 + 0o12) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(117) + chr(116) + '\x66' + chr(660 - 615) + chr(56)), OMXmEHlNcnc4=nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49), 8), le5B5CDXyXdY=nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(1068 - 957) + chr(48), ord("\x08"))):
cHmedxd8XMtK = hXMPsSrOQzbh._morf.synthesize(Ke7SAGs_qhbe(W6axg8J0N9kP.kdIDrcwZTCs5()), Ke7SAGs_qhbe(qnYTYR39V38E.kdIDrcwZTCs5()), Ke7SAGs_qhbe(Hv2u8JijDJY4.kdIDrcwZTCs5()), Ke7SAGs_qhbe(bcPgAa5xDKMy.kdIDrcwZTCs5()), OMXmEHlNcnc4, le5B5CDXyXdY)
return [eYftgUdPaBGz(sm7_CLmeWGR7) for sm7_CLmeWGR7 in cHmedxd8XMtK]
|
estnltk/estnltk
|
estnltk/clausesegmenter.py
|
ClauseSegmenter.prepare_sentence
|
def prepare_sentence(self, sentence):
"""Prepare the sentence for segment detection."""
# depending on how the morphological analysis was added, there may be
# phonetic markup. Remove it, if it exists.
for word in sentence:
for analysis in word[ANALYSIS]:
analysis[ROOT] = analysis[ROOT].replace('~', '')
analysis[ROOT] = re.sub('[?<\]]([aioueöäõü])', '\\1', analysis[ROOT])
return json.dumps({WORDS: sentence})
|
python
|
def prepare_sentence(self, sentence):
"""Prepare the sentence for segment detection."""
# depending on how the morphological analysis was added, there may be
# phonetic markup. Remove it, if it exists.
for word in sentence:
for analysis in word[ANALYSIS]:
analysis[ROOT] = analysis[ROOT].replace('~', '')
analysis[ROOT] = re.sub('[?<\]]([aioueöäõü])', '\\1', analysis[ROOT])
return json.dumps({WORDS: sentence})
|
[
"def",
"prepare_sentence",
"(",
"self",
",",
"sentence",
")",
":",
"# depending on how the morphological analysis was added, there may be",
"# phonetic markup. Remove it, if it exists.",
"for",
"word",
"in",
"sentence",
":",
"for",
"analysis",
"in",
"word",
"[",
"ANALYSIS",
"]",
":",
"analysis",
"[",
"ROOT",
"]",
"=",
"analysis",
"[",
"ROOT",
"]",
".",
"replace",
"(",
"'~'",
",",
"''",
")",
"analysis",
"[",
"ROOT",
"]",
"=",
"re",
".",
"sub",
"(",
"'[?<\\]]([aioueöäõü])', '\\",
"\\",
"', an",
"a",
"ysis[ROO",
"T",
"])",
"",
"",
"return",
"json",
".",
"dumps",
"(",
"{",
"WORDS",
":",
"sentence",
"}",
")"
] |
Prepare the sentence for segment detection.
|
[
"Prepare",
"the",
"sentence",
"for",
"segment",
"detection",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/clausesegmenter.py#L53-L61
|
train
|
Prepare the sentence for segment detection.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3A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vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + chr(1348 - 1297), 46777 - 46769), nzTpIcepk0o8(chr(48) + chr(111) + chr(1376 - 1327) + chr(0b11111 + 0o24) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b100100 + 0o14) + '\x6f' + chr(1417 - 1366) + chr(0b110110) + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x33' + '\x33' + chr(48), 55631 - 55623), nzTpIcepk0o8('\060' + chr(111) + chr(0b110101) + chr(0b11 + 0o56), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1829 - 1779) + '\x32' + '\x36', 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b11001 + 0o126) + '\x32' + chr(0b100000 + 0o24) + '\x37', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\062' + chr(0b110011) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + chr(1901 - 1853) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + '\065' + '\x31', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x36' + chr(1699 - 1648), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(2290 - 2239) + '\067' + chr(0b110011 + 0o3), 44954 - 44946), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(0b101001 + 0o11) + chr(54), 3371 - 3363), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(2535 - 2483) + chr(0b111 + 0o51), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b101100 + 0o6) + chr(48) + chr(49), 27330 - 27322), nzTpIcepk0o8(chr(48) + chr(0b10011 + 0o134) + chr(0b100101 + 0o15) + chr(0b110110) + chr(53), 9446 - 9438), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(0b1101111) + '\067' + '\060', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1011110 + 0o21) + chr(0b110010) + chr(761 - 709) + '\064', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001 + 0o0) + '\063' + '\x32', 0o10), nzTpIcepk0o8('\060' + chr(0b1101001 + 0o6) + '\062' + '\x36', 45948 - 45940), nzTpIcepk0o8('\x30' + '\157' + '\x31' + chr(0b110011 + 0o4) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10 + 0o57) + chr(1128 - 1080) + chr(2254 - 2203), ord("\x08")), nzTpIcepk0o8(chr(1435 - 1387) + '\x6f' + chr(0b111 + 0o54) + chr(1413 - 1362), 8), nzTpIcepk0o8('\x30' + chr(12039 - 11928) + chr(0b101111 + 0o4) + chr(1097 - 1048) + chr(752 - 704), 0o10), nzTpIcepk0o8(chr(896 - 848) + '\157' + '\x31' + '\060' + chr(1665 - 1612), 0b1000), nzTpIcepk0o8(chr(48) + chr(8296 - 8185) + '\x33' + chr(49) + chr(0b100 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1977 - 1928) + chr(211 - 158) + chr(48), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100000 + 0o22) + chr(0b110110) + chr(0b110101), 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + chr(1287 - 1239) + chr(2566 - 2514), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(50) + chr(50) + chr(0b10 + 0o64), 8), nzTpIcepk0o8('\060' + chr(0b110000 + 0o77) + chr(2152 - 2101) + '\064' + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + chr(2400 - 2347) + chr(0b1110 + 0o47), ord("\x08")), nzTpIcepk0o8('\060' + chr(8040 - 7929) + chr(0b1011 + 0o47) + chr(48) + chr(1832 - 1782), ord("\x08")), nzTpIcepk0o8('\060' + chr(2855 - 2744) + chr(1227 - 1178) + chr(0b1001 + 0o50) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b11111 + 0o120) + chr(1198 - 1147) + chr(586 - 534) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\x30' + chr(744 - 633) + '\x31' + '\064' + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(111) + chr(49) + '\x33' + chr(1717 - 1663), 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(111) + '\x32' + chr(55) + '\x32', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(735 - 685) + chr(0b100101 + 0o17) + chr(0b10101 + 0o33), 0b1000), nzTpIcepk0o8(chr(2029 - 1981) + chr(0b1101111) + chr(0b100111 + 0o13) + chr(209 - 160) + chr(0b101010 + 0o13), 41773 - 41765)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1011111 + 0o20) + chr(2107 - 2054) + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'5'), chr(0b1100100) + chr(0b10110 + 0o117) + chr(4660 - 4561) + chr(5891 - 5780) + chr(946 - 846) + chr(0b1100101))(chr(117) + '\164' + '\x66' + chr(1672 - 1627) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def kE6QrqO6ScAP(hXMPsSrOQzbh, v3YfwzoUholR):
for JXVFyF8k4nGR in v3YfwzoUholR:
for eBWh51EcnNXz in JXVFyF8k4nGR[otAw_H2b5sjH]:
eBWh51EcnNXz[XsvoTOpX8A2b] = eBWh51EcnNXz[XsvoTOpX8A2b].E91dbqOZXBpJ(roI3spqORKae(ES5oEprVxulp(b'e'), chr(100) + '\145' + '\x63' + chr(0b1101001 + 0o6) + chr(100) + chr(0b1011111 + 0o6))(chr(0b1110101) + chr(116) + chr(0b1100101 + 0o1) + '\x2d' + chr(56)), roI3spqORKae(ES5oEprVxulp(b''), chr(0b101100 + 0o70) + '\145' + chr(0b1100011) + '\x6f' + chr(0b10000 + 0o124) + chr(0b1010001 + 0o24))(chr(117) + chr(0b1110100) + '\146' + chr(0b101101) + chr(1718 - 1662)))
eBWh51EcnNXz[XsvoTOpX8A2b] = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'@d\xce\x84t\xcb\x8f\xc1!\xc0\\\x8b3\xa37v\x9cg\xef\xd5\xc5\x1e2'), chr(0b1100100) + chr(0b101 + 0o140) + '\x63' + '\x6f' + chr(0b1010101 + 0o17) + '\x65')(chr(0b1100010 + 0o23) + '\x74' + chr(0b1100110) + '\x2d' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'Gj'), '\144' + chr(0b1011 + 0o132) + '\x63' + chr(0b1010111 + 0o30) + chr(0b1011111 + 0o5) + chr(0b1100101))(chr(9040 - 8923) + chr(116) + '\146' + chr(1866 - 1821) + chr(56)), eBWh51EcnNXz[XsvoTOpX8A2b])
return roI3spqORKae(LNUKEwZDIbyb, roI3spqORKae(ES5oEprVxulp(b'A1\x95\xb4D\xfb\x9f\xef%\xc7X\xbd'), chr(0b110010 + 0o62) + '\x65' + chr(9635 - 9536) + chr(0b110111 + 0o70) + chr(100) + '\145')(chr(6996 - 6879) + '\x74' + '\x66' + '\055' + '\x38'))({dwqZnwPLrnLJ: v3YfwzoUholR})
|
estnltk/estnltk
|
estnltk/clausesegmenter.py
|
ClauseSegmenter.annotate_indices
|
def annotate_indices(self, sentence):
"""Add clause indexes to already annotated sentence."""
max_index = 0
max_depth = 1
stack_of_indexes = [ max_index ]
for token in sentence:
if CLAUSE_ANNOT not in token:
token[CLAUSE_IDX] = stack_of_indexes[-1]
else:
# Alustavad märgendused
for annotation in token[CLAUSE_ANNOT]:
if annotation == "KIILU_ALGUS":
# Liigume sügavamale, alustame järgmist kiilu
max_index += 1
stack_of_indexes.append(max_index)
if (len(stack_of_indexes) > max_depth):
max_depth = len(stack_of_indexes)
token[CLAUSE_IDX] = stack_of_indexes[-1]
# Lõpetavad märgendused
for annotation in token[CLAUSE_ANNOT]:
if annotation == "KINDEL_PIIR":
# Liigume edasi samal tasandil, alustame järgmist osalauset
max_index += 1
stack_of_indexes[-1] = max_index
elif annotation == "KIILU_LOPP":
# Taandume sügavusest, sulgeme ühe kiilu
stack_of_indexes.pop()
return sentence
|
python
|
def annotate_indices(self, sentence):
"""Add clause indexes to already annotated sentence."""
max_index = 0
max_depth = 1
stack_of_indexes = [ max_index ]
for token in sentence:
if CLAUSE_ANNOT not in token:
token[CLAUSE_IDX] = stack_of_indexes[-1]
else:
# Alustavad märgendused
for annotation in token[CLAUSE_ANNOT]:
if annotation == "KIILU_ALGUS":
# Liigume sügavamale, alustame järgmist kiilu
max_index += 1
stack_of_indexes.append(max_index)
if (len(stack_of_indexes) > max_depth):
max_depth = len(stack_of_indexes)
token[CLAUSE_IDX] = stack_of_indexes[-1]
# Lõpetavad märgendused
for annotation in token[CLAUSE_ANNOT]:
if annotation == "KINDEL_PIIR":
# Liigume edasi samal tasandil, alustame järgmist osalauset
max_index += 1
stack_of_indexes[-1] = max_index
elif annotation == "KIILU_LOPP":
# Taandume sügavusest, sulgeme ühe kiilu
stack_of_indexes.pop()
return sentence
|
[
"def",
"annotate_indices",
"(",
"self",
",",
"sentence",
")",
":",
"max_index",
"=",
"0",
"max_depth",
"=",
"1",
"stack_of_indexes",
"=",
"[",
"max_index",
"]",
"for",
"token",
"in",
"sentence",
":",
"if",
"CLAUSE_ANNOT",
"not",
"in",
"token",
":",
"token",
"[",
"CLAUSE_IDX",
"]",
"=",
"stack_of_indexes",
"[",
"-",
"1",
"]",
"else",
":",
"# Alustavad märgendused",
"for",
"annotation",
"in",
"token",
"[",
"CLAUSE_ANNOT",
"]",
":",
"if",
"annotation",
"==",
"\"KIILU_ALGUS\"",
":",
"# Liigume sügavamale, alustame järgmist kiilu",
"max_index",
"+=",
"1",
"stack_of_indexes",
".",
"append",
"(",
"max_index",
")",
"if",
"(",
"len",
"(",
"stack_of_indexes",
")",
">",
"max_depth",
")",
":",
"max_depth",
"=",
"len",
"(",
"stack_of_indexes",
")",
"token",
"[",
"CLAUSE_IDX",
"]",
"=",
"stack_of_indexes",
"[",
"-",
"1",
"]",
"# Lõpetavad märgendused",
"for",
"annotation",
"in",
"token",
"[",
"CLAUSE_ANNOT",
"]",
":",
"if",
"annotation",
"==",
"\"KINDEL_PIIR\"",
":",
"# Liigume edasi samal tasandil, alustame järgmist osalauset",
"max_index",
"+=",
"1",
"stack_of_indexes",
"[",
"-",
"1",
"]",
"=",
"max_index",
"elif",
"annotation",
"==",
"\"KIILU_LOPP\"",
":",
"# Taandume sügavusest, sulgeme ühe kiilu",
"stack_of_indexes",
".",
"pop",
"(",
")",
"return",
"sentence"
] |
Add clause indexes to already annotated sentence.
|
[
"Add",
"clause",
"indexes",
"to",
"already",
"annotated",
"sentence",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae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L_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\x6f' + chr(977 - 926) + chr(55) + chr(0b110000), 44913 - 44905), nzTpIcepk0o8('\x30' + chr(111) + chr(3014 - 2959) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + '\x6f' + chr(50) + chr(0b110000) + chr(55), 0b1000), nzTpIcepk0o8(chr(0b11111 + 0o21) + '\157' + '\061' + '\x31' + '\x37', 47210 - 47202), nzTpIcepk0o8(chr(0b110000) + chr(5996 - 5885) + chr(0b110010 + 0o1) + '\062' + chr(2053 - 2002), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1100101 + 0o12) + chr(49) + chr(53) + '\062', 10620 - 10612), nzTpIcepk0o8('\x30' + chr(5470 - 5359) + chr(50) + '\x32' + chr(0b101001 + 0o16), 8936 - 8928), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + chr(0b110101) + '\062', 62630 - 62622), nzTpIcepk0o8(chr(48) + '\x6f' + '\062' + '\x35' + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063' + '\x35' + chr(0b10101 + 0o42), 3522 - 3514), nzTpIcepk0o8(chr(215 - 167) + chr(12276 - 12165) + chr(0b110000 + 0o2) + '\061' + chr(0b11111 + 0o21), 59423 - 59415), nzTpIcepk0o8(chr(676 - 628) + chr(0b1101111) + '\x31' + '\x37' + '\x32', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x33' + chr(2260 - 2212) + chr(189 - 135), ord("\x08")), nzTpIcepk0o8(chr(1535 - 1487) + chr(2907 - 2796) + chr(0b10101 + 0o36) + chr(0b110100) + chr(48), 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b100011 + 0o114) + chr(0b11 + 0o56) + chr(49) + '\x33', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101011 + 0o4) + '\061', 0b1000), nzTpIcepk0o8(chr(1904 - 1856) + '\x6f' + chr(0b101100 + 0o7) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b1101111) + chr(0b110001) + chr(51) + '\x37', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x36' + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(0b1001 + 0o146) + chr(372 - 323) + chr(49), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(263 - 215) + chr(51), 0b1000), nzTpIcepk0o8('\x30' + chr(4384 - 4273) + '\061' + chr(49) + chr(50), 0b1000), nzTpIcepk0o8(chr(48) + chr(662 - 551) + chr(0b110010) + chr(193 - 144) + '\x35', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(658 - 607) + '\x36' + chr(0b110011), 6381 - 6373), nzTpIcepk0o8(chr(0b110000) + chr(3460 - 3349) + '\x31' + chr(0b110010) + chr(0b11 + 0o64), 0b1000), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(943 - 832) + chr(0b110111) + '\062', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1784 - 1735) + chr(0b1011 + 0o50) + chr(529 - 481), 0b1000), nzTpIcepk0o8('\060' + chr(6927 - 6816) + chr(0b110011) + '\x33' + chr(0b0 + 0o64), ord("\x08")), nzTpIcepk0o8(chr(915 - 867) + chr(0b1101111) + chr(50) + chr(50) + chr(0b110100), 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x32' + '\x33' + chr(48), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\066', 64316 - 64308), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + chr(0b110000) + '\x33', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + '\060' + chr(51), 8), nzTpIcepk0o8(chr(48) + chr(0b1001001 + 0o46) + '\x32' + chr(51) + chr(55), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(944 - 893) + chr(1854 - 1806), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(49) + chr(0b110001), 8), nzTpIcepk0o8('\x30' + '\157' + '\063' + chr(53) + '\060', 2761 - 2753), nzTpIcepk0o8('\x30' + chr(0b1100000 + 0o17) + chr(0b110011) + '\x34' + chr(1738 - 1689), 44228 - 44220), nzTpIcepk0o8(chr(48) + chr(6886 - 6775) + chr(0b11001 + 0o30) + '\x35' + chr(50), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(111) + '\065' + chr(0b1 + 0o57), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xd6'), '\144' + '\x65' + '\x63' + '\157' + chr(8265 - 8165) + '\145')('\165' + chr(10018 - 9902) + chr(0b1100110) + '\055' + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def gQKiVdliThE3(hXMPsSrOQzbh, v3YfwzoUholR):
H706FT3kXp0G = nzTpIcepk0o8('\060' + chr(542 - 431) + chr(0b110000), 0b1000)
dQNXocQ4z2HF = nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(111) + chr(0b101001 + 0o10), 8)
Z5YwladWc9d2 = [H706FT3kXp0G]
for Hd4nWPplSa3h in v3YfwzoUholR:
if JwB4XhiZ0NDO not in Hd4nWPplSa3h:
Hd4nWPplSa3h[DLXKWZHG1d62] = Z5YwladWc9d2[-nzTpIcepk0o8(chr(0b1000 + 0o50) + '\x6f' + '\061', 8)]
else:
for bKP0IesFF4Pq in Hd4nWPplSa3h[JwB4XhiZ0NDO]:
if bKP0IesFF4Pq == roI3spqORKae(ES5oEprVxulp(b'\xb3u\xce\x03\x865\xd6\xa6\xef\xba\xdb'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b11011 + 0o111) + '\x65')('\165' + '\x74' + chr(0b10111 + 0o117) + '\055' + chr(0b111 + 0o61)):
H706FT3kXp0G += nzTpIcepk0o8('\060' + chr(0b110100 + 0o73) + chr(568 - 519), 8)
roI3spqORKae(Z5YwladWc9d2, roI3spqORKae(ES5oEprVxulp(b'\xb0h\xd4{\xab\r\xd0\x85\xc2\x80\xddO'), chr(100) + '\x65' + chr(0b100 + 0o137) + '\x6f' + chr(3373 - 3273) + chr(0b1100101))(chr(0b1100 + 0o151) + '\164' + chr(0b1101 + 0o131) + chr(292 - 247) + chr(1926 - 1870)))(H706FT3kXp0G)
if ftfygxgFas5X(Z5YwladWc9d2) > dQNXocQ4z2HF:
dQNXocQ4z2HF = ftfygxgFas5X(Z5YwladWc9d2)
Hd4nWPplSa3h[DLXKWZHG1d62] = Z5YwladWc9d2[-nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061', 8)]
for bKP0IesFF4Pq in Hd4nWPplSa3h[JwB4XhiZ0NDO]:
if bKP0IesFF4Pq == roI3spqORKae(ES5oEprVxulp(b'\xb3u\xc9\x0b\x96&\xc8\xba\xe1\xa6\xda'), chr(0b1100100) + chr(0b1100101) + chr(0b110001 + 0o62) + chr(406 - 295) + chr(100) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b10011 + 0o45)):
H706FT3kXp0G += nzTpIcepk0o8('\x30' + chr(111) + '\061', 8)
Z5YwladWc9d2[-nzTpIcepk0o8('\x30' + chr(111) + chr(0b101011 + 0o6), 8)] = H706FT3kXp0G
elif bKP0IesFF4Pq == roI3spqORKae(ES5oEprVxulp(b'\xb3u\xce\x03\x865\xdb\xa5\xf8\xbf'), chr(8269 - 8169) + '\145' + chr(0b1000100 + 0o37) + chr(0b1101111) + '\144' + chr(4823 - 4722))(chr(13408 - 13291) + chr(0b1110100) + '\146' + '\x2d' + '\x38'):
roI3spqORKae(Z5YwladWc9d2, roI3spqORKae(ES5oEprVxulp(b'\x8d\x7f\xd8\x16\xbc\x13\xf5\x92\x9f\xa5\xb83'), chr(194 - 94) + chr(0b1100101) + '\x63' + '\x6f' + chr(0b1100100) + chr(7994 - 7893))(chr(0b11111 + 0o126) + chr(1135 - 1019) + chr(0b101100 + 0o72) + chr(45) + chr(2149 - 2093)))()
return v3YfwzoUholR
|
estnltk/estnltk
|
estnltk/clausesegmenter.py
|
ClauseSegmenter.rename_annotations
|
def rename_annotations(self, sentence):
"""Function that renames and restructures clause information."""
annotations = []
for token in sentence:
data = {CLAUSE_IDX: token[CLAUSE_IDX]}
if CLAUSE_ANNOT in token:
if 'KINDEL_PIIR' in token[CLAUSE_ANNOT]:
data[CLAUSE_ANNOTATION] = CLAUSE_BOUNDARY
elif 'KIILU_ALGUS' in token[CLAUSE_ANNOT]:
data[CLAUSE_ANNOTATION] = EMBEDDED_CLAUSE_START
elif 'KIILU_LOPP' in token[CLAUSE_ANNOT]:
data[CLAUSE_ANNOTATION] = EMBEDDED_CLAUSE_END
annotations.append(data)
return annotations
|
python
|
def rename_annotations(self, sentence):
"""Function that renames and restructures clause information."""
annotations = []
for token in sentence:
data = {CLAUSE_IDX: token[CLAUSE_IDX]}
if CLAUSE_ANNOT in token:
if 'KINDEL_PIIR' in token[CLAUSE_ANNOT]:
data[CLAUSE_ANNOTATION] = CLAUSE_BOUNDARY
elif 'KIILU_ALGUS' in token[CLAUSE_ANNOT]:
data[CLAUSE_ANNOTATION] = EMBEDDED_CLAUSE_START
elif 'KIILU_LOPP' in token[CLAUSE_ANNOT]:
data[CLAUSE_ANNOTATION] = EMBEDDED_CLAUSE_END
annotations.append(data)
return annotations
|
[
"def",
"rename_annotations",
"(",
"self",
",",
"sentence",
")",
":",
"annotations",
"=",
"[",
"]",
"for",
"token",
"in",
"sentence",
":",
"data",
"=",
"{",
"CLAUSE_IDX",
":",
"token",
"[",
"CLAUSE_IDX",
"]",
"}",
"if",
"CLAUSE_ANNOT",
"in",
"token",
":",
"if",
"'KINDEL_PIIR'",
"in",
"token",
"[",
"CLAUSE_ANNOT",
"]",
":",
"data",
"[",
"CLAUSE_ANNOTATION",
"]",
"=",
"CLAUSE_BOUNDARY",
"elif",
"'KIILU_ALGUS'",
"in",
"token",
"[",
"CLAUSE_ANNOT",
"]",
":",
"data",
"[",
"CLAUSE_ANNOTATION",
"]",
"=",
"EMBEDDED_CLAUSE_START",
"elif",
"'KIILU_LOPP'",
"in",
"token",
"[",
"CLAUSE_ANNOT",
"]",
":",
"data",
"[",
"CLAUSE_ANNOTATION",
"]",
"=",
"EMBEDDED_CLAUSE_END",
"annotations",
".",
"append",
"(",
"data",
")",
"return",
"annotations"
] |
Function that renames and restructures clause information.
|
[
"Function",
"that",
"renames",
"and",
"restructures",
"clause",
"information",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/clausesegmenter.py#L93-L106
|
train
|
Function that renames and restructures clause information.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1g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IhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\157' + chr(0b1100 + 0o51) + chr(0b110100), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b100101 + 0o14) + chr(0b110100 + 0o1) + chr(1931 - 1883), 0b1000), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(0b1001101 + 0o42) + chr(50) + chr(218 - 166) + chr(0b11101 + 0o25), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(2480 - 2369) + chr(51) + chr(52) + chr(0b10111 + 0o37), 0b1000), nzTpIcepk0o8(chr(1697 - 1649) + '\157' + chr(0b10000 + 0o43) + chr(2133 - 2083) + '\x33', 0b1000), nzTpIcepk0o8(chr(1862 - 1814) + chr(0b1101111) + chr(978 - 929) + chr(53) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(920 - 872) + '\x6f' + chr(50) + chr(1473 - 1418) + chr(0b1000 + 0o55), ord("\x08")), nzTpIcepk0o8(chr(506 - 458) + chr(0b1101111) + '\x33' + chr(0b11100 + 0o26) + '\064', 0b1000), nzTpIcepk0o8(chr(2259 - 2211) + '\157' + '\061' + '\067' + chr(51), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31' + chr(0b10101 + 0o36) + '\064', 0b1000), nzTpIcepk0o8(chr(242 - 194) + chr(0b1100000 + 0o17) + chr(0b110111) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b11001 + 0o126) + '\x34' + chr(55), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100011 + 0o23), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x35' + chr(0b110100), 8), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(3278 - 3167) + chr(2246 - 2196) + chr(54) + '\063', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(8034 - 7923) + '\065' + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b101111 + 0o3) + chr(0b110001) + chr(0b11011 + 0o30), 18319 - 18311), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110111) + '\066', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110 + 0o55) + chr(55) + chr(778 - 723), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(2044 - 1993) + '\065' + chr(0b10010 + 0o44), 11997 - 11989), nzTpIcepk0o8(chr(1808 - 1760) + chr(8323 - 8212) + chr(0b110100) + '\x34', 0b1000), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1101111) + chr(0b110000), 6861 - 6853), nzTpIcepk0o8(chr(1178 - 1130) + chr(0b1100111 + 0o10) + '\061' + chr(49), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + chr(0b110111 + 0o0) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b100001 + 0o22) + chr(49) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10101 + 0o41) + chr(52), 11591 - 11583), nzTpIcepk0o8(chr(48) + chr(0b100 + 0o153) + chr(0b10110 + 0o33) + chr(0b10 + 0o63) + '\064', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1011111 + 0o20) + chr(1829 - 1778) + chr(1900 - 1852) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + chr(637 - 583) + chr(50), 37967 - 37959), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + chr(0b100101 + 0o14) + chr(2228 - 2176), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(0b100 + 0o60) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\061' + chr(328 - 280), 12948 - 12940), nzTpIcepk0o8('\060' + '\157' + chr(0b11110 + 0o25) + chr(2900 - 2845) + chr(0b110000), 53185 - 53177), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(74 - 23) + chr(92 - 39) + '\x30', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + '\x32' + chr(53), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1100 + 0o47) + chr(282 - 232), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110011) + chr(495 - 447) + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(2016 - 1967) + chr(55), 0o10), nzTpIcepk0o8('\x30' + chr(3834 - 3723) + chr(0b110001) + chr(0b110000) + chr(0b110101 + 0o2), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\157' + chr(2071 - 2018) + chr(2174 - 2126), 29057 - 29049)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x02'), '\x64' + chr(4593 - 4492) + chr(2233 - 2134) + chr(111) + chr(0b1100010 + 0o2) + '\145')(chr(5244 - 5127) + '\164' + chr(102) + '\055' + chr(306 - 250)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def uTr5_ldaj8wT(hXMPsSrOQzbh, v3YfwzoUholR):
jHRyQfcmt4BG = []
for Hd4nWPplSa3h in v3YfwzoUholR:
FfKOThdpoDTb = {DLXKWZHG1d62: Hd4nWPplSa3h[DLXKWZHG1d62]}
if JwB4XhiZ0NDO in Hd4nWPplSa3h:
if roI3spqORKae(ES5oEprVxulp(b'g!\xec\xa2\x96"\xe2\x842\x15h'), '\x64' + '\145' + '\x63' + '\x6f' + chr(0b1100100) + chr(4430 - 4329))('\x75' + chr(116) + '\146' + chr(0b101101) + '\x38') in Hd4nWPplSa3h[JwB4XhiZ0NDO]:
FfKOThdpoDTb[Y0Z9FjwlIxV6] = xFYwKIHwzmVz
elif roI3spqORKae(ES5oEprVxulp(b'g!\xeb\xaa\x861\xfc\x98<\ti'), '\144' + '\x65' + '\143' + chr(0b100000 + 0o117) + chr(0b1100100) + chr(6800 - 6699))(chr(0b1001011 + 0o52) + chr(116) + '\x66' + chr(0b101101) + chr(0b11101 + 0o33)) in Hd4nWPplSa3h[JwB4XhiZ0NDO]:
FfKOThdpoDTb[Y0Z9FjwlIxV6] = pbCCljotctx8
elif roI3spqORKae(ES5oEprVxulp(b'g!\xeb\xaa\x861\xf1\x9b+\x0c'), chr(100) + chr(0b1000110 + 0o37) + '\x63' + chr(6086 - 5975) + '\x64' + '\x65')(chr(13626 - 13509) + chr(116) + chr(102) + chr(980 - 935) + '\x38') in Hd4nWPplSa3h[JwB4XhiZ0NDO]:
FfKOThdpoDTb[Y0Z9FjwlIxV6] = U1p1_3PvCz_g
roI3spqORKae(jHRyQfcmt4BG, roI3spqORKae(ES5oEprVxulp(b'd<\xf1\xd2\xab\t\xfa\xbb\x113o\x12'), chr(7153 - 7053) + chr(0b101110 + 0o67) + chr(0b11101 + 0o106) + chr(0b1101111) + chr(8864 - 8764) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b110011 + 0o63) + chr(0b101101) + chr(0b10001 + 0o47)))(FfKOThdpoDTb)
return jHRyQfcmt4BG
|
estnltk/estnltk
|
estnltk/examples/split_large_koondkorpus_files.py
|
format_time
|
def format_time( sec ):
''' Re-formats time duration in seconds (*sec*) into more easily readable
form, where (days,) hours, minutes, and seconds are explicitly shown.
Returns the new duration as a formatted string.
'''
import time
if sec < 864000:
# Idea from: http://stackoverflow.com/a/1384565
return time.strftime('%H:%M:%S', time.gmtime(sec))
else:
days = int(sec / 864000)
secs = sec % 864000
return str(days)+'d, '+time.strftime('%H:%M:%S', time.gmtime(secs))
|
python
|
def format_time( sec ):
''' Re-formats time duration in seconds (*sec*) into more easily readable
form, where (days,) hours, minutes, and seconds are explicitly shown.
Returns the new duration as a formatted string.
'''
import time
if sec < 864000:
# Idea from: http://stackoverflow.com/a/1384565
return time.strftime('%H:%M:%S', time.gmtime(sec))
else:
days = int(sec / 864000)
secs = sec % 864000
return str(days)+'d, '+time.strftime('%H:%M:%S', time.gmtime(secs))
|
[
"def",
"format_time",
"(",
"sec",
")",
":",
"import",
"time",
"if",
"sec",
"<",
"864000",
":",
"# Idea from: http://stackoverflow.com/a/1384565",
"return",
"time",
".",
"strftime",
"(",
"'%H:%M:%S'",
",",
"time",
".",
"gmtime",
"(",
"sec",
")",
")",
"else",
":",
"days",
"=",
"int",
"(",
"sec",
"/",
"864000",
")",
"secs",
"=",
"sec",
"%",
"864000",
"return",
"str",
"(",
"days",
")",
"+",
"'d, '",
"+",
"time",
".",
"strftime",
"(",
"'%H:%M:%S'",
",",
"time",
".",
"gmtime",
"(",
"secs",
")",
")"
] |
Re-formats time duration in seconds (*sec*) into more easily readable
form, where (days,) hours, minutes, and seconds are explicitly shown.
Returns the new duration as a formatted string.
|
[
"Re",
"-",
"formats",
"time",
"duration",
"in",
"seconds",
"(",
"*",
"sec",
"*",
")",
"into",
"more",
"easily",
"readable",
"form",
"where",
"(",
"days",
")",
"hours",
"minutes",
"and",
"seconds",
"are",
"explicitly",
"shown",
".",
"Returns",
"the",
"new",
"duration",
"as",
"a",
"formatted",
"string",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/examples/split_large_koondkorpus_files.py#L35-L47
|
train
|
Re - formats time duration in seconds into more easily readable
form where days hours minutes and seconds are explicitly shown.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h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fNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1892 - 1844) + chr(111) + chr(54) + chr(0b11010 + 0o30), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(10744 - 10633) + chr(0b111 + 0o60), 17057 - 17049), nzTpIcepk0o8(chr(1810 - 1762) + chr(111) + chr(0b110100) + chr(554 - 504), 32831 - 32823), nzTpIcepk0o8('\x30' + '\x6f' + '\066' + chr(0b100010 + 0o16), 22852 - 22844), nzTpIcepk0o8('\x30' + chr(0b10 + 0o155) + '\063' + '\x34' + chr(0b10111 + 0o33), 0b1000), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(111) + chr(0b110001) + chr(0b100101 + 0o13) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\157' + '\063' + chr(0b110001) + chr(0b101001 + 0o10), 0b1000), nzTpIcepk0o8(chr(826 - 778) + chr(368 - 257) + '\x32' + '\064' + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(111) + chr(55) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(6796 - 6685) + '\x31' + chr(0b1101 + 0o51) + chr(0b10010 + 0o43), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(1406 - 1295) + chr(1182 - 1131) + chr(0b100111 + 0o17), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\064', 0b1000), nzTpIcepk0o8(chr(1288 - 1240) + '\x6f' + '\x31' + chr(0b110010) + '\067', 45315 - 45307), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(51) + '\x36', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010 + 0o2) + '\066', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b101100 + 0o103) + chr(956 - 905) + chr(0b11110 + 0o30) + chr(49), 0b1000), nzTpIcepk0o8(chr(720 - 672) + chr(111) + chr(0b1 + 0o62) + chr(1682 - 1629) + '\067', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x35' + chr(51), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31' + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(560 - 512) + chr(0b1101111) + chr(1127 - 1078) + chr(693 - 643) + chr(0b11 + 0o64), 8), nzTpIcepk0o8('\x30' + chr(1554 - 1443) + chr(0b110010) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110 + 0o54) + chr(1155 - 1105) + '\065', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b100111 + 0o12) + chr(0b100000 + 0o26) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(723 - 675) + '\x6f' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b101010 + 0o6) + '\157' + chr(0b100011 + 0o20) + '\060' + '\x30', 0o10), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\157' + chr(0b110101) + chr(54), 52143 - 52135), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1606 - 1557) + '\x34', 36937 - 36929), nzTpIcepk0o8('\060' + chr(12188 - 12077) + chr(0b110 + 0o54) + '\x30' + chr(52), 0o10), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b10010 + 0o135) + chr(450 - 397) + chr(48), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(0b110000 + 0o4) + chr(0b1101 + 0o51), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(1602 - 1548) + '\062', 8), nzTpIcepk0o8(chr(1319 - 1271) + chr(0b1000011 + 0o54) + chr(49) + '\061' + chr(49), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1215 - 1161), 0b1000), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\157' + '\063' + chr(0b110110 + 0o1) + chr(50), 0b1000), nzTpIcepk0o8('\x30' + chr(9456 - 9345) + '\062' + chr(0b110110) + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b10110 + 0o34) + chr(2683 - 2631) + chr(645 - 595), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(6267 - 6156) + chr(0b110011) + '\064' + '\x34', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(0b110011) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b10101 + 0o132) + chr(54) + '\063', ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(111) + chr(0b110101) + '\x30', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x1c'), chr(100) + chr(0b1100101) + chr(3266 - 3167) + chr(0b1101111) + chr(8485 - 8385) + chr(4480 - 4379))('\165' + chr(0b1110100) + chr(4493 - 4391) + '\x2d' + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def xuCOSoprVeqg(V0oYBuGZwtxs):
(oprIvDIRQyCb,) = (zGgTE_CdZfvi(roI3spqORKae(ES5oEprVxulp(b'FnOU'), chr(100) + chr(0b11100 + 0o111) + chr(8285 - 8186) + '\157' + chr(0b1100100) + chr(0b1001101 + 0o30))(chr(117) + '\164' + chr(0b1100110) + '\055' + chr(0b111000))),)
if V0oYBuGZwtxs < nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + chr(50) + chr(50) + chr(55) + '\064' + '\060' + chr(0b110000), ord("\x08")):
return roI3spqORKae(oprIvDIRQyCb, roI3spqORKae(ES5oEprVxulp(b'AsPV\x96)\xa4\xc4'), chr(100) + chr(0b101 + 0o140) + chr(99) + '\x6f' + chr(3050 - 2950) + chr(4678 - 4577))(chr(117) + chr(116) + '\x66' + chr(0b11100 + 0o21) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\x17O\x18\x15\xafz\xec\xf2'), '\x64' + '\145' + chr(99) + chr(0b1101111) + chr(100) + chr(0b1100101))('\x75' + '\x74' + '\146' + chr(0b101101) + chr(3053 - 2997)), roI3spqORKae(oprIvDIRQyCb, roI3spqORKae(ES5oEprVxulp(b'UjVY\x8f%'), chr(0b1101 + 0o127) + '\145' + chr(99) + chr(0b10000 + 0o137) + '\x64' + chr(0b1010000 + 0o25))(chr(0b1110101) + chr(0b1000011 + 0o61) + '\146' + chr(0b10010 + 0o33) + chr(0b10000 + 0o50)))(V0oYBuGZwtxs))
else:
Ix2rHpQkE2Ix = nzTpIcepk0o8(V0oYBuGZwtxs / nzTpIcepk0o8(chr(48) + '\157' + chr(2332 - 2281) + chr(50) + chr(0b101000 + 0o12) + chr(55) + '\x34' + chr(48) + chr(0b1110 + 0o42), 8))
KS6fN3sbAjCz = V0oYBuGZwtxs % nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(0b100001 + 0o116) + '\x33' + chr(0b101 + 0o55) + chr(262 - 212) + chr(646 - 591) + '\x34' + chr(0b1101 + 0o43) + chr(48), 8)
return N9zlRy29S1SS(Ix2rHpQkE2Ix) + roI3spqORKae(ES5oEprVxulp(b'V+\x02'), '\144' + chr(6290 - 6189) + chr(0b1100011) + '\157' + chr(100) + '\x65')(chr(0b1110101) + chr(116) + chr(0b101100 + 0o72) + chr(1135 - 1090) + '\070') + roI3spqORKae(oprIvDIRQyCb, roI3spqORKae(ES5oEprVxulp(b'AsPV\x96)\xa4\xc4'), '\x64' + '\x65' + chr(0b10010 + 0o121) + '\x6f' + chr(0b1001011 + 0o31) + '\145')(chr(0b10100 + 0o141) + chr(2164 - 2048) + chr(3373 - 3271) + chr(0b101101) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\x17O\x18\x15\xafz\xec\xf2'), chr(100) + chr(101) + chr(0b1100011) + '\x6f' + '\144' + chr(101))('\x75' + chr(5052 - 4936) + '\146' + chr(0b101011 + 0o2) + '\070'), roI3spqORKae(oprIvDIRQyCb, roI3spqORKae(ES5oEprVxulp(b'UjVY\x8f%'), chr(0b111000 + 0o54) + chr(0b1001001 + 0o34) + chr(0b1100011) + chr(0b110011 + 0o74) + chr(100) + chr(0b1100101))(chr(0b101110 + 0o107) + chr(0b1110100) + '\146' + '\x2d' + '\x38'))(KS6fN3sbAjCz))
|
estnltk/estnltk
|
estnltk/examples/split_large_koondkorpus_files.py
|
split_Text
|
def split_Text( text, file_name, verbose = True ):
''' Tokenizes the *text* (from *file_name*) into sentences, and if the number of
sentences exceeds *max_sentences*, splits the text into smaller texts.
Returns a list containing the original text (if no splitting was required),
or a list containing results of the splitting (smaller texts);
'''
if verbose:
print(' processing '+file_name+' ... ', end="" )
# Tokenize text into sentences
start = timer()
text = text.tokenize_sentences()
all_sentences = len(text[SENTENCES])
end = timer()
if verbose:
print(' (tok time: '+format_time( end-start )+')', end="" )
if all_sentences > max_sentences:
# Acquire spans of length *max_sentences* from the text
start = timer()
i = 0
spans = []
len_total = 0
while i < all_sentences:
startSent = text[SENTENCES][i]
endSent = text[SENTENCES][min(i+(max_sentences-1), all_sentences-1)]
span = (startSent[START], endSent[END])
len_total += (span[1]-span[0])
spans.append(span)
i += max_sentences
# Divide the text into spans
text_spans = text.texts_from_spans(spans)
assert len(text.text) >= len_total, '(!) Total spans_len must be =< than text_len: '+str(len_total)+'/'+str(len(text.text))
new_texts = []
for i, small_text in enumerate( text_spans ):
newText = Text( small_text )
for key in text.keys():
if key != TEXT and key != SENTENCES and key != PARAGRAPHS:
newText[key] = text[key]
newText['_text_split_id'] = i
newText['_text_split_origin'] = str(spans[i]) # Convert it to string; Otherwise, split_by(*) may mistakenly consider
# it a layer and may run into error while trying to split it;
newText['_text_split_file'] = file_name
#print( json.dumps(newText) )
new_texts.append( newText )
end = timer()
if verbose:
print(' (split time: '+format_time( end-start )+')', end="" )
print(' (sents: '+str(all_sentences)+', new_texts:'+str(len(new_texts))+')', end="")
print()
return new_texts
else:
if verbose:
print(' (sents: '+str(all_sentences)+', no_split)', end=" \n")
return [text]
|
python
|
def split_Text( text, file_name, verbose = True ):
''' Tokenizes the *text* (from *file_name*) into sentences, and if the number of
sentences exceeds *max_sentences*, splits the text into smaller texts.
Returns a list containing the original text (if no splitting was required),
or a list containing results of the splitting (smaller texts);
'''
if verbose:
print(' processing '+file_name+' ... ', end="" )
# Tokenize text into sentences
start = timer()
text = text.tokenize_sentences()
all_sentences = len(text[SENTENCES])
end = timer()
if verbose:
print(' (tok time: '+format_time( end-start )+')', end="" )
if all_sentences > max_sentences:
# Acquire spans of length *max_sentences* from the text
start = timer()
i = 0
spans = []
len_total = 0
while i < all_sentences:
startSent = text[SENTENCES][i]
endSent = text[SENTENCES][min(i+(max_sentences-1), all_sentences-1)]
span = (startSent[START], endSent[END])
len_total += (span[1]-span[0])
spans.append(span)
i += max_sentences
# Divide the text into spans
text_spans = text.texts_from_spans(spans)
assert len(text.text) >= len_total, '(!) Total spans_len must be =< than text_len: '+str(len_total)+'/'+str(len(text.text))
new_texts = []
for i, small_text in enumerate( text_spans ):
newText = Text( small_text )
for key in text.keys():
if key != TEXT and key != SENTENCES and key != PARAGRAPHS:
newText[key] = text[key]
newText['_text_split_id'] = i
newText['_text_split_origin'] = str(spans[i]) # Convert it to string; Otherwise, split_by(*) may mistakenly consider
# it a layer and may run into error while trying to split it;
newText['_text_split_file'] = file_name
#print( json.dumps(newText) )
new_texts.append( newText )
end = timer()
if verbose:
print(' (split time: '+format_time( end-start )+')', end="" )
print(' (sents: '+str(all_sentences)+', new_texts:'+str(len(new_texts))+')', end="")
print()
return new_texts
else:
if verbose:
print(' (sents: '+str(all_sentences)+', no_split)', end=" \n")
return [text]
|
[
"def",
"split_Text",
"(",
"text",
",",
"file_name",
",",
"verbose",
"=",
"True",
")",
":",
"if",
"verbose",
":",
"print",
"(",
"' processing '",
"+",
"file_name",
"+",
"' ... '",
",",
"end",
"=",
"\"\"",
")",
"# Tokenize text into sentences",
"start",
"=",
"timer",
"(",
")",
"text",
"=",
"text",
".",
"tokenize_sentences",
"(",
")",
"all_sentences",
"=",
"len",
"(",
"text",
"[",
"SENTENCES",
"]",
")",
"end",
"=",
"timer",
"(",
")",
"if",
"verbose",
":",
"print",
"(",
"' (tok time: '",
"+",
"format_time",
"(",
"end",
"-",
"start",
")",
"+",
"')'",
",",
"end",
"=",
"\"\"",
")",
"if",
"all_sentences",
">",
"max_sentences",
":",
"# Acquire spans of length *max_sentences* from the text",
"start",
"=",
"timer",
"(",
")",
"i",
"=",
"0",
"spans",
"=",
"[",
"]",
"len_total",
"=",
"0",
"while",
"i",
"<",
"all_sentences",
":",
"startSent",
"=",
"text",
"[",
"SENTENCES",
"]",
"[",
"i",
"]",
"endSent",
"=",
"text",
"[",
"SENTENCES",
"]",
"[",
"min",
"(",
"i",
"+",
"(",
"max_sentences",
"-",
"1",
")",
",",
"all_sentences",
"-",
"1",
")",
"]",
"span",
"=",
"(",
"startSent",
"[",
"START",
"]",
",",
"endSent",
"[",
"END",
"]",
")",
"len_total",
"+=",
"(",
"span",
"[",
"1",
"]",
"-",
"span",
"[",
"0",
"]",
")",
"spans",
".",
"append",
"(",
"span",
")",
"i",
"+=",
"max_sentences",
"# Divide the text into spans",
"text_spans",
"=",
"text",
".",
"texts_from_spans",
"(",
"spans",
")",
"assert",
"len",
"(",
"text",
".",
"text",
")",
">=",
"len_total",
",",
"'(!) Total spans_len must be =< than text_len: '",
"+",
"str",
"(",
"len_total",
")",
"+",
"'/'",
"+",
"str",
"(",
"len",
"(",
"text",
".",
"text",
")",
")",
"new_texts",
"=",
"[",
"]",
"for",
"i",
",",
"small_text",
"in",
"enumerate",
"(",
"text_spans",
")",
":",
"newText",
"=",
"Text",
"(",
"small_text",
")",
"for",
"key",
"in",
"text",
".",
"keys",
"(",
")",
":",
"if",
"key",
"!=",
"TEXT",
"and",
"key",
"!=",
"SENTENCES",
"and",
"key",
"!=",
"PARAGRAPHS",
":",
"newText",
"[",
"key",
"]",
"=",
"text",
"[",
"key",
"]",
"newText",
"[",
"'_text_split_id'",
"]",
"=",
"i",
"newText",
"[",
"'_text_split_origin'",
"]",
"=",
"str",
"(",
"spans",
"[",
"i",
"]",
")",
"# Convert it to string; Otherwise, split_by(*) may mistakenly consider ",
"# it a layer and may run into error while trying to split it;",
"newText",
"[",
"'_text_split_file'",
"]",
"=",
"file_name",
"#print( json.dumps(newText) )",
"new_texts",
".",
"append",
"(",
"newText",
")",
"end",
"=",
"timer",
"(",
")",
"if",
"verbose",
":",
"print",
"(",
"' (split time: '",
"+",
"format_time",
"(",
"end",
"-",
"start",
")",
"+",
"')'",
",",
"end",
"=",
"\"\"",
")",
"print",
"(",
"' (sents: '",
"+",
"str",
"(",
"all_sentences",
")",
"+",
"', new_texts:'",
"+",
"str",
"(",
"len",
"(",
"new_texts",
")",
")",
"+",
"')'",
",",
"end",
"=",
"\"\"",
")",
"print",
"(",
")",
"return",
"new_texts",
"else",
":",
"if",
"verbose",
":",
"print",
"(",
"' (sents: '",
"+",
"str",
"(",
"all_sentences",
")",
"+",
"', no_split)'",
",",
"end",
"=",
"\" \\n\"",
")",
"return",
"[",
"text",
"]"
] |
Tokenizes the *text* (from *file_name*) into sentences, and if the number of
sentences exceeds *max_sentences*, splits the text into smaller texts.
Returns a list containing the original text (if no splitting was required),
or a list containing results of the splitting (smaller texts);
|
[
"Tokenizes",
"the",
"*",
"text",
"*",
"(",
"from",
"*",
"file_name",
"*",
")",
"into",
"sentences",
"and",
"if",
"the",
"number",
"of",
"sentences",
"exceeds",
"*",
"max_sentences",
"*",
"splits",
"the",
"text",
"into",
"smaller",
"texts",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/examples/split_large_koondkorpus_files.py#L50-L103
|
train
|
Splits the text into smaller texts.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,b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ticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1522 - 1474) + '\157' + '\065' + chr(0b110101), 13718 - 13710), nzTpIcepk0o8(chr(48) + chr(7727 - 7616) + chr(51) + chr(0b110001) + '\067', 0o10), nzTpIcepk0o8(chr(1109 - 1061) + '\x6f' + chr(0b110010) + chr(305 - 255) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(2206 - 2095) + '\x34' + '\x33', 36254 - 36246), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\157' + chr(50) + '\062' + chr(0b110010), 19963 - 19955), nzTpIcepk0o8('\x30' + chr(0b100000 + 0o117) + chr(1441 - 1390) + '\066' + chr(0b1 + 0o60), 60287 - 60279), nzTpIcepk0o8(chr(48) + chr(253 - 142) + chr(50) + '\066' + chr(345 - 297), 27405 - 27397), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(111) + chr(0b110010) + chr(928 - 879) + chr(1701 - 1646), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2095 - 2040) + chr(0b100101 + 0o15), 40008 - 40000), nzTpIcepk0o8('\x30' + '\157' + chr(0b100001 + 0o22) + chr(0b0 + 0o61) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b0 + 0o60) + '\157' + '\062' + chr(2236 - 2182) + chr(0b110001 + 0o2), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\065' + '\067', 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1101111) + chr(2397 - 2342) + chr(2236 - 2181), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110010) + '\x34' + chr(0b1011 + 0o45), 0b1000), nzTpIcepk0o8('\x30' + chr(7216 - 7105) + chr(49) + chr(0b110001) + '\065', 26875 - 26867), nzTpIcepk0o8(chr(0b110000) + chr(670 - 559) + chr(0b110010 + 0o2) + chr(51), 8), nzTpIcepk0o8('\060' + chr(0b111000 + 0o67) + chr(50) + chr(0b101010 + 0o10) + '\x35', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1001 + 0o51) + chr(0b110101) + chr(0b11101 + 0o24), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1775 - 1726) + '\063' + '\061', 0o10), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1101111) + chr(2170 - 2121) + '\066' + chr(1749 - 1701), 50989 - 50981), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b1100010 + 0o15) + chr(59 - 9) + chr(0b100101 + 0o16) + chr(443 - 388), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(350 - 300) + chr(0b101001 + 0o12) + chr(0b101110 + 0o3), 0o10), nzTpIcepk0o8('\060' + chr(0b1000000 + 0o57) + chr(2229 - 2180) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\061' + '\x35' + '\066', 0b1000), nzTpIcepk0o8(chr(1101 - 1053) + chr(0b1001001 + 0o46) + '\x36' + chr(0b110110), 59141 - 59133), nzTpIcepk0o8('\060' + '\157' + chr(49) + chr(0b1 + 0o64) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(81 - 27) + '\x37', 0o10), nzTpIcepk0o8('\x30' + chr(0b1001011 + 0o44) + chr(1177 - 1126) + '\063' + chr(0b100000 + 0o21), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b101 + 0o54) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1042 - 993), 14263 - 14255), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + '\x32' + chr(776 - 727), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + '\x30' + chr(51), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(1948 - 1837) + chr(0b1010 + 0o50) + chr(0b10111 + 0o37) + chr(0b110001), 35484 - 35476), nzTpIcepk0o8(chr(0b110000) + chr(1414 - 1303) + '\063' + chr(51) + '\060', 15577 - 15569), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + chr(0b110100) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(542 - 494) + chr(340 - 229) + '\063' + chr(923 - 873) + '\060', 38829 - 38821), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110011) + chr(1661 - 1607) + chr(2759 - 2705), ord("\x08")), nzTpIcepk0o8('\060' + chr(5070 - 4959) + chr(0b110010) + chr(2100 - 2051) + '\066', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1000111 + 0o50) + chr(0b110010) + chr(0b11 + 0o63) + '\067', 0o10), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b111010 + 0o65) + chr(0b100000 + 0o21) + '\061' + '\062', 50624 - 50616)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(577 - 466) + '\x35' + '\060', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x03'), chr(100) + chr(0b101011 + 0o72) + '\143' + '\157' + chr(100) + chr(8344 - 8243))('\165' + '\164' + '\146' + chr(45) + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def fJkv0Zsas3ij(cpStk7cY1TJd, Ob89R3fsHgUT, TseISVdPlfdM=nzTpIcepk0o8(chr(0b110000) + chr(0b100010 + 0o115) + '\x31', 8)):
if TseISVdPlfdM:
v8jsMqaYV6U2(roI3spqORKae(ES5oEprVxulp(b'\r\xef\xe1Q\xfd\x92\xd5\xfcI\xa5\xddH\x1f'), chr(7672 - 7572) + chr(101) + chr(0b101 + 0o136) + '\157' + '\x64' + '\x65')(chr(117) + '\164' + chr(0b111 + 0o137) + chr(336 - 291) + chr(0b11011 + 0o35)) + Ob89R3fsHgUT + roI3spqORKae(ES5oEprVxulp(b'\r\xe1\xbf\r\xb2'), '\144' + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(0b1101 + 0o127) + chr(0b1001 + 0o134))(chr(117) + '\164' + '\146' + '\x2d' + '\x38'), end=roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(101) + chr(99) + chr(0b11100 + 0o123) + chr(0b1001011 + 0o31) + chr(0b1010010 + 0o23))(chr(117) + chr(3022 - 2906) + '\x66' + chr(45) + '\070'))
KQbHFTcl_LKy = QpQhPtpeU4jL()
cpStk7cY1TJd = cpStk7cY1TJd.tokenize_sentences()
IsYjuAxVXvbk = ftfygxgFas5X(cpStk7cY1TJd[DUoBUczr5TtH])
NiWVjAWn0l6T = QpQhPtpeU4jL()
if TseISVdPlfdM:
v8jsMqaYV6U2(roI3spqORKae(ES5oEprVxulp(b'\r\xef\xb9W\xfd\x9a\x90\xfbS\xa1\xd6\x15\x1f'), '\x64' + chr(0b1100101) + chr(0b1011001 + 0o12) + chr(0b1011101 + 0o22) + chr(0b1100100) + chr(101))('\165' + '\x74' + chr(102) + chr(0b101101) + chr(2657 - 2601)) + xuCOSoprVeqg(NiWVjAWn0l6T - KQbHFTcl_LKy) + roI3spqORKae(ES5oEprVxulp(b'\x04'), '\144' + '\145' + chr(0b110110 + 0o55) + '\x6f' + chr(0b10001 + 0o123) + chr(6788 - 6687))('\165' + chr(6500 - 6384) + chr(102) + '\055' + chr(56)), end=roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + '\145' + chr(0b101100 + 0o67) + chr(0b1101110 + 0o1) + '\144' + '\x65')('\165' + '\164' + chr(0b1011010 + 0o14) + chr(0b101101) + chr(0b1110 + 0o52)))
if IsYjuAxVXvbk > ZBqQcNu7m_zH:
KQbHFTcl_LKy = QpQhPtpeU4jL()
ZlbFMSG8gCoF = nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110000), 23079 - 23071)
c4cCiQSW2VVF = []
iH7GnFQsiC0s = nzTpIcepk0o8('\x30' + chr(0b100000 + 0o117) + chr(48), 8)
while ZlbFMSG8gCoF < IsYjuAxVXvbk:
_CBcg5FcSN_3 = cpStk7cY1TJd[DUoBUczr5TtH][ZlbFMSG8gCoF]
ooXwXNMwnFkf = cpStk7cY1TJd[DUoBUczr5TtH][XURpmPuEWCNF(ZlbFMSG8gCoF + (ZBqQcNu7m_zH - nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(111) + chr(0b10 + 0o57), 8)), IsYjuAxVXvbk - nzTpIcepk0o8(chr(48) + '\157' + chr(49), 8))]
YE_goZOOqWUi = (_CBcg5FcSN_3[tMRCl49SUV2c], ooXwXNMwnFkf[rJed2cvrh1UW])
iH7GnFQsiC0s += YE_goZOOqWUi[nzTpIcepk0o8(chr(48) + chr(2773 - 2662) + '\x31', 8)] - YE_goZOOqWUi[nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1005 - 957), 8)]
roI3spqORKae(c4cCiQSW2VVF, roI3spqORKae(ES5oEprVxulp(b'e\x9b\xc2\x17\xea\x96\xf7\xe0P\xa3\xe6\x1a'), chr(100) + chr(0b1001000 + 0o35) + chr(0b1100011) + chr(9566 - 9455) + chr(0b1100100) + '\145')('\165' + chr(0b1000101 + 0o57) + chr(0b10000 + 0o126) + chr(45) + '\x38'))(YE_goZOOqWUi)
ZlbFMSG8gCoF += ZBqQcNu7m_zH
LfpPFwFguEul = cpStk7cY1TJd.texts_from_spans(c4cCiQSW2VVF)
assert ftfygxgFas5X(roI3spqORKae(cpStk7cY1TJd, roI3spqORKae(ES5oEprVxulp(b'N\xbf\xc2W\xf9\xc6\xd3\xd6\x0b\x98\xf9K'), chr(2136 - 2036) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(2489 - 2389) + '\x65')('\165' + '\x74' + '\x66' + chr(1148 - 1103) + chr(56)))) >= iH7GnFQsiC0s, roI3spqORKae(ES5oEprVxulp(b'\x05\xee\xb8\x03\xc6\x9e\xc4\xeeV\xec\xc0_^\xce>|\xf9\xcc7P\xf2\xec{\x1a\x16\tR\xf96=\xf1\xb7\xd9\xb9\xc9\xf0\x82\xeb\xcf>r\xa3\xf4M\xa8\xd1'), chr(0b111010 + 0o52) + chr(0b110111 + 0o56) + chr(0b1100011) + '\x6f' + chr(0b111111 + 0o45) + chr(0b1100101))(chr(546 - 429) + '\x74' + chr(102) + '\055' + '\070') + N9zlRy29S1SS(iH7GnFQsiC0s) + roI3spqORKae(ES5oEprVxulp(b'\x02'), '\144' + chr(101) + chr(0b1100011) + chr(111) + chr(9290 - 9190) + chr(0b1100101))(chr(8720 - 8603) + chr(3676 - 3560) + chr(8588 - 8486) + chr(0b10100 + 0o31) + '\070') + N9zlRy29S1SS(ftfygxgFas5X(roI3spqORKae(cpStk7cY1TJd, roI3spqORKae(ES5oEprVxulp(b'N\xbf\xc2W\xf9\xc6\xd3\xd6\x0b\x98\xf9K'), chr(1553 - 1453) + '\x65' + chr(99) + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(45) + '\070'))))
G3DCY4xnf7RW = []
for (ZlbFMSG8gCoF, rwBHZp0PcyoL) in _kV_Bomx8PZ4(LfpPFwFguEul):
XlB5bvzpK77d = Yunp_Kt7vLoC(rwBHZp0PcyoL)
for QYodcsDtoGq7 in roI3spqORKae(cpStk7cY1TJd, roI3spqORKae(ES5oEprVxulp(b'F\xaa\xe8P'), chr(100) + '\145' + chr(0b1100011) + '\x6f' + chr(8695 - 8595) + '\145')(chr(117) + '\164' + chr(7680 - 7578) + chr(348 - 303) + '\070'))():
if QYodcsDtoGq7 != JPzDaf6_RoFd and QYodcsDtoGq7 != DUoBUczr5TtH and (QYodcsDtoGq7 != Ij2uE1UcrtNN):
XlB5bvzpK77d[QYodcsDtoGq7] = cpStk7cY1TJd[QYodcsDtoGq7]
XlB5bvzpK77d[roI3spqORKae(ES5oEprVxulp(b'r\xbb\xf4[\xe6\xae\xc3\xffV\xa5\xc7pV\xc4'), chr(0b111011 + 0o51) + chr(0b1100101) + '\143' + '\x6f' + chr(100) + chr(101))(chr(11107 - 10990) + '\164' + chr(0b1100110) + '\x2d' + chr(0b10100 + 0o44))] = ZlbFMSG8gCoF
XlB5bvzpK77d[roI3spqORKae(ES5oEprVxulp(b'r\xbb\xf4[\xe6\xae\xc3\xffV\xa5\xc7pP\xd2$D\xfc\xc7'), chr(0b1000111 + 0o35) + chr(101) + '\143' + chr(111) + '\x64' + chr(0b1100101))(chr(117) + chr(116) + chr(102) + chr(45) + chr(0b111000))] = N9zlRy29S1SS(c4cCiQSW2VVF[ZlbFMSG8gCoF])
XlB5bvzpK77d[roI3spqORKae(ES5oEprVxulp(b'r\xbb\xf4[\xe6\xae\xc3\xffV\xa5\xc7pY\xc9!F'), chr(100) + chr(5694 - 5593) + '\143' + chr(0b101010 + 0o105) + chr(7668 - 7568) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b110 + 0o140) + '\x2d' + chr(0b110111 + 0o1))] = Ob89R3fsHgUT
roI3spqORKae(G3DCY4xnf7RW, roI3spqORKae(ES5oEprVxulp(b'e\x9b\xc2\x17\xea\x96\xf7\xe0P\xa3\xe6\x1a'), chr(100) + chr(2798 - 2697) + '\143' + '\157' + chr(100) + chr(0b1001101 + 0o30))('\x75' + '\164' + chr(102) + '\055' + chr(56)))(XlB5bvzpK77d)
NiWVjAWn0l6T = QpQhPtpeU4jL()
if TseISVdPlfdM:
v8jsMqaYV6U2(roI3spqORKae(ES5oEprVxulp(b'\r\xef\xb9P\xe2\x9d\xd9\xfb\x1a\xb8\xdaBZ\x9am'), chr(0b1000010 + 0o42) + chr(101) + '\x63' + '\157' + '\144' + '\145')(chr(0b111110 + 0o67) + chr(9379 - 9263) + chr(102) + chr(0b100111 + 0o6) + chr(0b111000)) + xuCOSoprVeqg(NiWVjAWn0l6T - KQbHFTcl_LKy) + roI3spqORKae(ES5oEprVxulp(b'\x04'), chr(8182 - 8082) + chr(0b100011 + 0o102) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b110100 + 0o61))(chr(7297 - 7180) + chr(0b1110100) + chr(0b1100110) + chr(0b1011 + 0o42) + '\070'), end=roI3spqORKae(ES5oEprVxulp(b''), '\144' + '\x65' + chr(0b1011011 + 0o10) + '\157' + '\144' + chr(2697 - 2596))(chr(0b1001010 + 0o53) + chr(0b1110010 + 0o2) + chr(0b1010010 + 0o24) + '\055' + chr(2844 - 2788)))
v8jsMqaYV6U2(roI3spqORKae(ES5oEprVxulp(b'\r\xef\xb9P\xf7\x9f\xc4\xfc\x00\xec'), '\x64' + '\145' + chr(99) + chr(111) + chr(100) + chr(2138 - 2037))(chr(0b110101 + 0o100) + chr(0b1110100) + '\x66' + chr(1433 - 1388) + '\x38') + N9zlRy29S1SS(IsYjuAxVXvbk) + roI3spqORKae(ES5oEprVxulp(b'\x01\xef\xffF\xe5\xae\xc4\xeaB\xb8\xc0\x15'), '\144' + chr(101) + '\143' + '\157' + '\144' + '\x65')(chr(0b1110101) + '\x74' + '\146' + '\055' + chr(0b111000)) + N9zlRy29S1SS(ftfygxgFas5X(G3DCY4xnf7RW)) + roI3spqORKae(ES5oEprVxulp(b'\x04'), '\x64' + chr(0b1100101) + '\143' + chr(7086 - 6975) + chr(2805 - 2705) + chr(0b1100 + 0o131))(chr(0b101001 + 0o114) + '\164' + chr(0b1100110) + chr(0b101101) + chr(2966 - 2910)), end=roI3spqORKae(ES5oEprVxulp(b''), '\144' + '\145' + chr(99) + '\157' + chr(0b111100 + 0o50) + chr(0b1001010 + 0o33))('\x75' + chr(0b1110100) + chr(1709 - 1607) + chr(0b10010 + 0o33) + chr(56)))
v8jsMqaYV6U2()
return G3DCY4xnf7RW
else:
if TseISVdPlfdM:
v8jsMqaYV6U2(roI3spqORKae(ES5oEprVxulp(b'\r\xef\xb9P\xf7\x9f\xc4\xfc\x00\xec'), '\144' + chr(0b1100101) + '\143' + '\157' + chr(0b110111 + 0o55) + chr(101))(chr(117) + chr(0b1110100) + '\x66' + '\x2d' + chr(2832 - 2776)) + N9zlRy29S1SS(IsYjuAxVXvbk) + roI3spqORKae(ES5oEprVxulp(b'\x01\xef\xffL\xcd\x82\xc0\xe3S\xb8\x9a'), chr(0b1100100) + chr(101) + chr(99) + chr(0b11001 + 0o126) + chr(100) + chr(0b1100011 + 0o2))(chr(3755 - 3638) + '\x74' + '\x66' + chr(45) + '\x38'), end=roI3spqORKae(ES5oEprVxulp(b'\r\xc5'), '\144' + chr(0b1100101) + '\143' + chr(111) + '\x64' + chr(0b1100101))('\x75' + '\x74' + chr(6326 - 6224) + chr(1192 - 1147) + chr(0b10010 + 0o46)))
return [cpStk7cY1TJd]
|
estnltk/estnltk
|
estnltk/examples/split_large_koondkorpus_files.py
|
write_Text_into_file
|
def write_Text_into_file( text, old_file_name, out_dir, suffix='__split', verbose=True ):
''' Based on *old_file_name*, *suffix* and *out_dir*, constructs a new file name and
writes *text* (in the ascii normalised JSON format) into the new file.
'''
name = os.path.basename( old_file_name )
if '.' in name:
new_name = re.sub('\.([^.]+)$', suffix+'.\\1', name)
else:
new_name = name + suffix
new_path = os.path.join( out_dir, new_name )
start = timer()
#write_document( text, new_path ) # <--- this leaves indent=2 - takes too much extra space ...
o_f = codecs.open( new_path, mode='wb', encoding='ascii' )
o_f.write( json.dumps( text ) )
o_f.close()
end = timer()
timestamp = format_time( end-start )
if verbose:
print(' ==> '+new_path+' (file writing time: '+timestamp+')' )
|
python
|
def write_Text_into_file( text, old_file_name, out_dir, suffix='__split', verbose=True ):
''' Based on *old_file_name*, *suffix* and *out_dir*, constructs a new file name and
writes *text* (in the ascii normalised JSON format) into the new file.
'''
name = os.path.basename( old_file_name )
if '.' in name:
new_name = re.sub('\.([^.]+)$', suffix+'.\\1', name)
else:
new_name = name + suffix
new_path = os.path.join( out_dir, new_name )
start = timer()
#write_document( text, new_path ) # <--- this leaves indent=2 - takes too much extra space ...
o_f = codecs.open( new_path, mode='wb', encoding='ascii' )
o_f.write( json.dumps( text ) )
o_f.close()
end = timer()
timestamp = format_time( end-start )
if verbose:
print(' ==> '+new_path+' (file writing time: '+timestamp+')' )
|
[
"def",
"write_Text_into_file",
"(",
"text",
",",
"old_file_name",
",",
"out_dir",
",",
"suffix",
"=",
"'__split'",
",",
"verbose",
"=",
"True",
")",
":",
"name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"old_file_name",
")",
"if",
"'.'",
"in",
"name",
":",
"new_name",
"=",
"re",
".",
"sub",
"(",
"'\\.([^.]+)$'",
",",
"suffix",
"+",
"'.\\\\1'",
",",
"name",
")",
"else",
":",
"new_name",
"=",
"name",
"+",
"suffix",
"new_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"out_dir",
",",
"new_name",
")",
"start",
"=",
"timer",
"(",
")",
"#write_document( text, new_path ) # <--- this leaves indent=2 - takes too much extra space ...",
"o_f",
"=",
"codecs",
".",
"open",
"(",
"new_path",
",",
"mode",
"=",
"'wb'",
",",
"encoding",
"=",
"'ascii'",
")",
"o_f",
".",
"write",
"(",
"json",
".",
"dumps",
"(",
"text",
")",
")",
"o_f",
".",
"close",
"(",
")",
"end",
"=",
"timer",
"(",
")",
"timestamp",
"=",
"format_time",
"(",
"end",
"-",
"start",
")",
"if",
"verbose",
":",
"print",
"(",
"' ==> '",
"+",
"new_path",
"+",
"' (file writing time: '",
"+",
"timestamp",
"+",
"')'",
")"
] |
Based on *old_file_name*, *suffix* and *out_dir*, constructs a new file name and
writes *text* (in the ascii normalised JSON format) into the new file.
|
[
"Based",
"on",
"*",
"old_file_name",
"*",
"*",
"suffix",
"*",
"and",
"*",
"out_dir",
"*",
"constructs",
"a",
"new",
"file",
"name",
"and",
"writes",
"*",
"text",
"*",
"(",
"in",
"the",
"ascii",
"normalised",
"JSON",
"format",
")",
"into",
"the",
"new",
"file",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/examples/split_large_koondkorpus_files.py#L106-L124
|
train
|
Writes text into a new file.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3x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gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\x6f' + chr(579 - 525) + '\x31', 32126 - 32118), nzTpIcepk0o8(chr(0b110000) + chr(2288 - 2177) + chr(49) + chr(939 - 890) + '\064', ord("\x08")), nzTpIcepk0o8('\x30' + chr(4842 - 4731) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b101110 + 0o4) + chr(0b101 + 0o54) + '\x30', 18710 - 18702), nzTpIcepk0o8(chr(0b110000) + chr(0b101011 + 0o104) + '\061' + chr(2325 - 2270) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1044 - 993) + '\064' + chr(0b100001 + 0o22), 0o10), nzTpIcepk0o8(chr(321 - 273) + '\x6f' + chr(0b110100 + 0o1) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b110001) + chr(0b110010) + '\067', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(0b110011) + '\066', 40948 - 40940), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + chr(0b101001 + 0o13) + '\064', 48307 - 48299), nzTpIcepk0o8(chr(1878 - 1830) + '\157' + chr(0b100001 + 0o20) + '\x36' + chr(1617 - 1568), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(49) + '\065' + '\x30', 8921 - 8913), nzTpIcepk0o8('\060' + chr(9248 - 9137) + chr(50) + chr(0b110000) + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + chr(1437 - 1326) + chr(50) + chr(0b110011) + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b100100 + 0o113) + chr(0b110100) + chr(0b111 + 0o57), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + chr(0b110111) + '\x37', 64609 - 64601), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + '\062' + chr(50), 57246 - 57238), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(2368 - 2319), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(50) + chr(0b101111 + 0o4) + chr(51), 8), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(0b110100) + chr(0b1100 + 0o51), ord("\x08")), nzTpIcepk0o8(chr(208 - 160) + '\157' + chr(0b100100 + 0o17) + '\061' + chr(0b11100 + 0o25), ord("\x08")), nzTpIcepk0o8(chr(509 - 461) + chr(0b1011000 + 0o27) + '\x33' + chr(53) + '\x34', 48519 - 48511), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b1000 + 0o51) + chr(51), 43084 - 43076), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + chr(0b1111 + 0o45) + '\x37', 34994 - 34986), nzTpIcepk0o8(chr(0b111 + 0o51) + '\x6f' + chr(309 - 259) + '\x34', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + chr(0b110011) + chr(0b100010 + 0o24) + '\x30', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1293 - 1243) + chr(0b11111 + 0o30) + '\061', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(53) + chr(55), 0b1000), nzTpIcepk0o8(chr(1346 - 1298) + chr(0b111000 + 0o67) + chr(93 - 43) + chr(105 - 56) + '\064', 33960 - 33952), nzTpIcepk0o8(chr(417 - 369) + '\x6f' + chr(49) + chr(0b110100) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(1712 - 1664) + chr(2397 - 2286) + chr(0b10011 + 0o37) + chr(0b11100 + 0o26) + '\063', ord("\x08")), nzTpIcepk0o8('\060' + chr(8668 - 8557) + chr(0b110000 + 0o1) + chr(2374 - 2319) + '\x32', 8), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1000100 + 0o53) + '\x31' + '\x32' + chr(0b110111), 8), nzTpIcepk0o8('\060' + chr(111) + chr(1960 - 1909) + chr(0b100001 + 0o24) + chr(54), 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(0b1101111) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(778 - 730) + '\157' + '\061' + chr(0b10100 + 0o41) + '\x36', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32' + chr(0b1111 + 0o43) + chr(1002 - 950), 41148 - 41140), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b1100 + 0o47) + chr(49) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b110101 + 0o72) + '\061' + chr(0b1010 + 0o55) + chr(1212 - 1159), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(111) + '\x35' + '\060', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x1f'), '\144' + chr(4735 - 4634) + '\x63' + chr(1344 - 1233) + '\x64' + '\x65')('\x75' + '\x74' + chr(0b1100110) + chr(0b101101) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def MEvLvnt6UVM6(cpStk7cY1TJd, ATzL06Dah3Js, laYPU6CrKX6Q, biRCFepsLie5=roI3spqORKae(ES5oEprVxulp(b'n\x13r\xf8\x16\x8a^'), chr(100) + chr(0b1100101) + '\143' + chr(145 - 34) + chr(100) + chr(0b1100101))(chr(10116 - 9999) + chr(3467 - 3351) + chr(0b1100110) + '\055' + chr(56)), TseISVdPlfdM=nzTpIcepk0o8(chr(714 - 666) + '\x6f' + '\x31', 8)):
SLVB2BPA_mIe = aHUqKstZLeS6.path.pLvIyXSV7qW5(ATzL06Dah3Js)
if roI3spqORKae(ES5oEprVxulp(b'\x1f'), chr(100) + chr(1059 - 958) + '\x63' + '\x6f' + chr(0b1100100) + '\x65')('\165' + chr(0b1100100 + 0o20) + chr(102) + chr(45) + chr(0b110111 + 0o1)) in SLVB2BPA_mIe:
cvwbkSTalMQ7 = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'mb)\xd3$\xcdw3~\xfa'), chr(2939 - 2839) + chr(0b110011 + 0o62) + chr(6656 - 6557) + '\x6f' + chr(100) + chr(4687 - 4586))('\x75' + chr(1505 - 1389) + chr(4906 - 4804) + chr(2010 - 1965) + '\070'), biRCFepsLie5 + roI3spqORKae(ES5oEprVxulp(b'\x1f\x100'), chr(4439 - 4339) + chr(0b111 + 0o136) + chr(0b101100 + 0o67) + chr(11852 - 11741) + '\x64' + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b100110 + 0o22)), SLVB2BPA_mIe)
else:
cvwbkSTalMQ7 = SLVB2BPA_mIe + biRCFepsLie5
F6o1qlXVb1rn = aHUqKstZLeS6.path.Y4yM9BcfTCNq(laYPU6CrKX6Q, cvwbkSTalMQ7)
KQbHFTcl_LKy = QpQhPtpeU4jL()
xraWUJ4WVkxL = Hj8X5RtMNBIn.DnU3Rq9N5ala(F6o1qlXVb1rn, mode=roI3spqORKae(ES5oEprVxulp(b'F.'), chr(100) + '\145' + '\x63' + '\157' + chr(8980 - 8880) + '\145')(chr(0b1101111 + 0o6) + chr(0b1110100) + chr(102) + chr(0b101101) + '\x38'), encoding=roI3spqORKae(ES5oEprVxulp(b'P?b\xe1\x13'), chr(5631 - 5531) + chr(995 - 894) + chr(8862 - 8763) + '\x6f' + chr(0b1100100) + chr(0b10011 + 0o122))(chr(0b111101 + 0o70) + chr(0b1110100 + 0o0) + chr(0b100001 + 0o105) + chr(45) + '\070'))
roI3spqORKae(xraWUJ4WVkxL, roI3spqORKae(ES5oEprVxulp(b'\\ 1\xe0\x12\x93\\)\x1b\xaeUC'), chr(7301 - 7201) + chr(2155 - 2054) + chr(0b1010000 + 0o23) + chr(0b1101111) + chr(3240 - 3140) + '\145')(chr(0b1110101) + '\x74' + '\x66' + chr(585 - 540) + chr(0b111000)))(roI3spqORKae(LNUKEwZDIbyb, roI3spqORKae(ES5oEprVxulp(b'k&f\xe4\x17\x8e\x12m2\xb0O2'), chr(0b1010000 + 0o24) + '\145' + '\x63' + chr(236 - 125) + chr(7959 - 7859) + chr(0b1100101))(chr(5163 - 5046) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(56)))(cpStk7cY1TJd))
roI3spqORKae(xraWUJ4WVkxL, roI3spqORKae(ES5oEprVxulp(b'k)p\xbf9\x80L!\x02\xba\x1c\x1b'), chr(0b11011 + 0o111) + chr(101) + chr(7949 - 7850) + chr(0b1101111) + chr(100) + chr(9734 - 9633))('\165' + chr(116) + chr(2831 - 2729) + chr(0b101101) + chr(0b101100 + 0o14)))()
NiWVjAWn0l6T = QpQhPtpeU4jL()
rob7nZM55s6v = xuCOSoprVeqg(NiWVjAWn0l6T - KQbHFTcl_LKy)
if TseISVdPlfdM:
v8jsMqaYV6U2(roI3spqORKae(ES5oEprVxulp(b'\x11l<\xb5D\xc3\n'), chr(1986 - 1886) + chr(101) + chr(0b1100011) + '\x6f' + '\144' + chr(0b110 + 0o137))(chr(0b1011011 + 0o32) + chr(0b1110100) + chr(3398 - 3296) + chr(1671 - 1626) + chr(1067 - 1011)) + F6o1qlXVb1rn + roI3spqORKae(ES5oEprVxulp(b'\x11dg\xe1\x16\x86\no%\xb7P\x18\x06\xe5\xbbR\x16\xff|\xa1\x85'), '\x64' + chr(847 - 746) + '\x63' + chr(0b1010110 + 0o31) + chr(0b1100100) + '\x65')(chr(0b1100110 + 0o17) + chr(0b1110100) + chr(0b1100110) + chr(0b11100 + 0o21) + '\x38') + rob7nZM55s6v + roI3spqORKae(ES5oEprVxulp(b'\x18'), chr(0b1100100) + chr(0b1100101) + '\143' + '\157' + '\144' + chr(101))(chr(0b110 + 0o157) + '\164' + chr(7467 - 7365) + chr(0b101101) + chr(56)))
|
estnltk/estnltk
|
estnltk/teicorpus.py
|
parse_tei_corpora
|
def parse_tei_corpora(root, prefix='', suffix='.xml', target=['artikkel'], encoding=None):
"""Parse documents from TEI style XML files.
Gives each document FILE attribute that denotes the original filename.
Parameters
----------
root: str
The directory path containing the TEI corpora XMl files.
prefix: str
The prefix of filenames to include (default: '')
suffix: str
The suffix of filenames to include (default: '.xml')
target: list of str
List of <div> types, that are considered documents in the XML files (default: ["artikkel"]).
encoding: str
Encoding to be used for decoding the content of the XML file. If not specified (default),
then no separate decoding step is applied.
Returns
-------
list of estnltk.text.Text
Corpus containing parsed documents from all files. The file path
is stored in FILE attribute of the documents.
"""
documents = []
for fnm in get_filenames(root, prefix, suffix):
path = os.path.join(root, fnm)
docs = parse_tei_corpus(path, target, encoding)
for doc in docs:
doc[FILE] = fnm
documents.extend(docs)
return documents
|
python
|
def parse_tei_corpora(root, prefix='', suffix='.xml', target=['artikkel'], encoding=None):
"""Parse documents from TEI style XML files.
Gives each document FILE attribute that denotes the original filename.
Parameters
----------
root: str
The directory path containing the TEI corpora XMl files.
prefix: str
The prefix of filenames to include (default: '')
suffix: str
The suffix of filenames to include (default: '.xml')
target: list of str
List of <div> types, that are considered documents in the XML files (default: ["artikkel"]).
encoding: str
Encoding to be used for decoding the content of the XML file. If not specified (default),
then no separate decoding step is applied.
Returns
-------
list of estnltk.text.Text
Corpus containing parsed documents from all files. The file path
is stored in FILE attribute of the documents.
"""
documents = []
for fnm in get_filenames(root, prefix, suffix):
path = os.path.join(root, fnm)
docs = parse_tei_corpus(path, target, encoding)
for doc in docs:
doc[FILE] = fnm
documents.extend(docs)
return documents
|
[
"def",
"parse_tei_corpora",
"(",
"root",
",",
"prefix",
"=",
"''",
",",
"suffix",
"=",
"'.xml'",
",",
"target",
"=",
"[",
"'artikkel'",
"]",
",",
"encoding",
"=",
"None",
")",
":",
"documents",
"=",
"[",
"]",
"for",
"fnm",
"in",
"get_filenames",
"(",
"root",
",",
"prefix",
",",
"suffix",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"fnm",
")",
"docs",
"=",
"parse_tei_corpus",
"(",
"path",
",",
"target",
",",
"encoding",
")",
"for",
"doc",
"in",
"docs",
":",
"doc",
"[",
"FILE",
"]",
"=",
"fnm",
"documents",
".",
"extend",
"(",
"docs",
")",
"return",
"documents"
] |
Parse documents from TEI style XML files.
Gives each document FILE attribute that denotes the original filename.
Parameters
----------
root: str
The directory path containing the TEI corpora XMl files.
prefix: str
The prefix of filenames to include (default: '')
suffix: str
The suffix of filenames to include (default: '.xml')
target: list of str
List of <div> types, that are considered documents in the XML files (default: ["artikkel"]).
encoding: str
Encoding to be used for decoding the content of the XML file. If not specified (default),
then no separate decoding step is applied.
Returns
-------
list of estnltk.text.Text
Corpus containing parsed documents from all files. The file path
is stored in FILE attribute of the documents.
|
[
"Parse",
"documents",
"from",
"TEI",
"style",
"XML",
"files",
".",
"Gives",
"each",
"document",
"FILE",
"attribute",
"that",
"denotes",
"the",
"original",
"filename",
".",
"Parameters",
"----------",
"root",
":",
"str",
"The",
"directory",
"path",
"containing",
"the",
"TEI",
"corpora",
"XMl",
"files",
".",
"prefix",
":",
"str",
"The",
"prefix",
"of",
"filenames",
"to",
"include",
"(",
"default",
":",
")",
"suffix",
":",
"str",
"The",
"suffix",
"of",
"filenames",
"to",
"include",
"(",
"default",
":",
".",
"xml",
")",
"target",
":",
"list",
"of",
"str",
"List",
"of",
"<div",
">",
"types",
"that",
"are",
"considered",
"documents",
"in",
"the",
"XML",
"files",
"(",
"default",
":",
"[",
"artikkel",
"]",
")",
".",
"encoding",
":",
"str",
"Encoding",
"to",
"be",
"used",
"for",
"decoding",
"the",
"content",
"of",
"the",
"XML",
"file",
".",
"If",
"not",
"specified",
"(",
"default",
")",
"then",
"no",
"separate",
"decoding",
"step",
"is",
"applied",
".",
"Returns",
"-------",
"list",
"of",
"estnltk",
".",
"text",
".",
"Text",
"Corpus",
"containing",
"parsed",
"documents",
"from",
"all",
"files",
".",
"The",
"file",
"path",
"is",
"stored",
"in",
"FILE",
"attribute",
"of",
"the",
"documents",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/teicorpus.py#L27-L59
|
train
|
Parse TEI style XML files and return a list of Text objects.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQ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hqOt5_BbS,WtdkIpFeYozM,MdkNqd1bagO6,QNQS9e6tJqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + '\157' + chr(456 - 403) + chr(0b110010), 0o10), nzTpIcepk0o8('\x30' + chr(8743 - 8632) + chr(0b11011 + 0o26) + chr(48) + chr(893 - 838), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\x35' + chr(2035 - 1985), 8), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(111) + chr(0b110010) + chr(1276 - 1224) + chr(0b11011 + 0o34), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110 + 0o54) + chr(1071 - 1021) + chr(55), 0o10), nzTpIcepk0o8(chr(48) + chr(7142 - 7031) + chr(0b10000 + 0o46), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(723 - 672), 41826 - 41818), nzTpIcepk0o8(chr(48) + chr(111) + '\x34' + chr(0b1100 + 0o51), 3487 - 3479), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + '\x34' + '\066', 29865 - 29857), nzTpIcepk0o8('\060' + chr(5973 - 5862) + '\062' + chr(483 - 429) + chr(48), 58068 - 58060), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(1996 - 1948) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(79 - 31) + chr(0b1011010 + 0o25) + chr(0b110001) + '\x36' + '\x32', 60577 - 60569), nzTpIcepk0o8('\060' + chr(111) + chr(0b1001 + 0o50) + '\x36' + chr(0b110010), 8), nzTpIcepk0o8('\x30' + chr(0b1011011 + 0o24) + chr(51) + '\065' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101100 + 0o3) + chr(0b110001) + chr(64 - 13) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(246 - 198) + chr(111) + '\064' + '\061', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(1415 - 1365) + chr(1505 - 1455), ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + '\157' + chr(1998 - 1947) + '\061' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(614 - 566) + chr(111) + chr(291 - 240) + '\x32' + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(707 - 659) + '\x6f' + chr(0b110010) + '\x33' + '\x30', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + '\x37' + '\x35', 37263 - 37255), nzTpIcepk0o8(chr(1673 - 1625) + chr(0b1101111) + chr(0b10000 + 0o41) + '\x32' + chr(1640 - 1586), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\x37' + chr(0b10101 + 0o33), 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\062' + '\x35' + chr(48), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\x31' + chr(52) + chr(49), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2040 - 1991) + chr(0b110010) + '\x37', 10426 - 10418), nzTpIcepk0o8(chr(2227 - 2179) + chr(7830 - 7719) + chr(0b11101 + 0o25) + chr(0b110010) + '\060', 0o10), nzTpIcepk0o8(chr(1474 - 1426) + '\157' + chr(0b110011) + chr(52) + chr(0b1000 + 0o56), 8), nzTpIcepk0o8(chr(1256 - 1208) + chr(111) + chr(0b110001) + chr(1678 - 1623) + chr(51), 0o10), nzTpIcepk0o8('\060' + chr(0b1011011 + 0o24) + chr(51) + '\x37' + chr(55), 10295 - 10287), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + chr(50) + chr(0b110100) + '\064', 0b1000), nzTpIcepk0o8(chr(2141 - 2093) + chr(111) + chr(1816 - 1765) + '\067' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x36' + chr(1771 - 1718), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(0b11111 + 0o30) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(11664 - 11553) + chr(0b11101 + 0o25) + chr(0b110011) + chr(0b110110), 0b1000), nzTpIcepk0o8('\060' + chr(0b1001011 + 0o44) + chr(51) + chr(0b110001) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + chr(0b110101) + '\065', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(846 - 794) + '\063', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(0b110100) + '\062', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(0b110001) + '\062', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(111) + chr(2404 - 2351) + '\060', 53404 - 53396)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x04'), chr(0b1100100) + '\x65' + '\143' + chr(111) + chr(5293 - 5193) + chr(0b1100101))(chr(0b111100 + 0o71) + chr(0b1100110 + 0o16) + chr(0b1010011 + 0o23) + '\x2d' + chr(2315 - 2259)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def YTH7i1uoNcok(kF9CWBi2ucGu, ZJwZgaHE72Po=roI3spqORKae(ES5oEprVxulp(b''), chr(7633 - 7533) + '\145' + '\x63' + chr(1436 - 1325) + chr(0b1100100) + chr(0b1100101))('\165' + '\164' + chr(102) + chr(45) + '\x38'), biRCFepsLie5=roI3spqORKae(ES5oEprVxulp(b'\x04?G\xcb'), '\x64' + chr(3117 - 3016) + chr(99) + chr(0b1010100 + 0o33) + '\144' + chr(0b1000101 + 0o40))('\x75' + chr(0b1110100) + '\146' + '\x2d' + '\070'), qc_AZrsvdJzx=[roI3spqORKae(ES5oEprVxulp(b'K5^\xce\xfcmvI'), chr(100) + chr(101) + '\x63' + chr(0b1101111) + chr(100) + chr(101))(chr(0b100001 + 0o124) + chr(116) + chr(102) + chr(0b100000 + 0o15) + chr(0b11110 + 0o32))], rt5yMsH2WFRk=None):
Q_ewMe16Waxe = []
for bTRPjBR7GViM in jgAKMlhxg0hQ(kF9CWBi2ucGu, ZJwZgaHE72Po, biRCFepsLie5):
_pSYqrosNb95 = aHUqKstZLeS6.path.Y4yM9BcfTCNq(kF9CWBi2ucGu, bTRPjBR7GViM)
CxOVg8j4LTAA = Ar5VFpXCGzQ2(_pSYqrosNb95, qc_AZrsvdJzx, rt5yMsH2WFRk)
for mPg7tgN9u21K in CxOVg8j4LTAA:
mPg7tgN9u21K[TEh3vmm3furQ] = bTRPjBR7GViM
roI3spqORKae(Q_ewMe16Waxe, roI3spqORKae(ES5oEprVxulp(b'~\x18\x19\xea\xf8b_r\xb9\xf2\xe4\x03'), chr(9532 - 9432) + chr(2758 - 2657) + chr(99) + '\157' + chr(0b1100100) + '\x65')('\165' + '\x74' + chr(102) + chr(45) + chr(56)))(CxOVg8j4LTAA)
return Q_ewMe16Waxe
|
estnltk/estnltk
|
estnltk/teicorpus.py
|
parse_tei_corpus
|
def parse_tei_corpus(path, target=['artikkel'], encoding=None):
"""Parse documents from a TEI style XML file.
Parameters
----------
path: str
The path of the XML file.
target: list of str
List of <div> types, that are considered documents in the XML files (default: ["artikkel"]).
encoding: str
Encoding to be used for decoding the content of the XML file. If not specified (default),
then no separate decoding step is applied.
Returns
-------
list of esnltk.text.Text
"""
with open(path, 'rb') as f:
html_doc = f.read()
if encoding:
html_doc = html_doc.decode( encoding )
soup = BeautifulSoup(html_doc, 'html5lib')
title = soup.find_all('title')[0].string
documents = []
for div1 in soup.find_all('div1'):
documents.extend(parse_div(div1, dict(), target))
return tokenize_documents(documents)
|
python
|
def parse_tei_corpus(path, target=['artikkel'], encoding=None):
"""Parse documents from a TEI style XML file.
Parameters
----------
path: str
The path of the XML file.
target: list of str
List of <div> types, that are considered documents in the XML files (default: ["artikkel"]).
encoding: str
Encoding to be used for decoding the content of the XML file. If not specified (default),
then no separate decoding step is applied.
Returns
-------
list of esnltk.text.Text
"""
with open(path, 'rb') as f:
html_doc = f.read()
if encoding:
html_doc = html_doc.decode( encoding )
soup = BeautifulSoup(html_doc, 'html5lib')
title = soup.find_all('title')[0].string
documents = []
for div1 in soup.find_all('div1'):
documents.extend(parse_div(div1, dict(), target))
return tokenize_documents(documents)
|
[
"def",
"parse_tei_corpus",
"(",
"path",
",",
"target",
"=",
"[",
"'artikkel'",
"]",
",",
"encoding",
"=",
"None",
")",
":",
"with",
"open",
"(",
"path",
",",
"'rb'",
")",
"as",
"f",
":",
"html_doc",
"=",
"f",
".",
"read",
"(",
")",
"if",
"encoding",
":",
"html_doc",
"=",
"html_doc",
".",
"decode",
"(",
"encoding",
")",
"soup",
"=",
"BeautifulSoup",
"(",
"html_doc",
",",
"'html5lib'",
")",
"title",
"=",
"soup",
".",
"find_all",
"(",
"'title'",
")",
"[",
"0",
"]",
".",
"string",
"documents",
"=",
"[",
"]",
"for",
"div1",
"in",
"soup",
".",
"find_all",
"(",
"'div1'",
")",
":",
"documents",
".",
"extend",
"(",
"parse_div",
"(",
"div1",
",",
"dict",
"(",
")",
",",
"target",
")",
")",
"return",
"tokenize_documents",
"(",
"documents",
")"
] |
Parse documents from a TEI style XML file.
Parameters
----------
path: str
The path of the XML file.
target: list of str
List of <div> types, that are considered documents in the XML files (default: ["artikkel"]).
encoding: str
Encoding to be used for decoding the content of the XML file. If not specified (default),
then no separate decoding step is applied.
Returns
-------
list of esnltk.text.Text
|
[
"Parse",
"documents",
"from",
"a",
"TEI",
"style",
"XML",
"file",
".",
"Parameters",
"----------",
"path",
":",
"str",
"The",
"path",
"of",
"the",
"XML",
"file",
".",
"target",
":",
"list",
"of",
"str",
"List",
"of",
"<div",
">",
"types",
"that",
"are",
"considered",
"documents",
"in",
"the",
"XML",
"files",
"(",
"default",
":",
"[",
"artikkel",
"]",
")",
".",
"encoding",
":",
"str",
"Encoding",
"to",
"be",
"used",
"for",
"decoding",
"the",
"content",
"of",
"the",
"XML",
"file",
".",
"If",
"not",
"specified",
"(",
"default",
")",
"then",
"no",
"separate",
"decoding",
"step",
"is",
"applied",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/teicorpus.py#L62-L89
|
train
|
Parse TEI style XML file into a list of text documents.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,Uti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BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1683 - 1635) + '\x6f' + chr(51) + chr(0b110111) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11010 + 0o30) + chr(53) + '\060', 0o10), nzTpIcepk0o8(chr(147 - 99) + '\x6f' + chr(0b110011) + chr(0b10000 + 0o45) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b1000 + 0o50) + '\157' + '\063' + chr(0b110001) + chr(0b1101 + 0o46), 64080 - 64072), nzTpIcepk0o8(chr(0b110000) + chr(0b11010 + 0o125) + '\x33' + '\x35' + chr(2267 - 2219), ord("\x08")), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\x6f' + chr(0b10101 + 0o34) + chr(0b110011 + 0o1) + chr(53), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(49), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(51) + '\x32', 47947 - 47939), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + chr(49) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b101110 + 0o4) + chr(0b100000 + 0o23) + '\x37', 16708 - 16700), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b1011 + 0o47) + chr(53) + '\x37', 0o10), nzTpIcepk0o8(chr(589 - 541) + '\157' + '\x33' + chr(1063 - 1011), 0b1000), nzTpIcepk0o8(chr(360 - 312) + chr(2859 - 2748) + '\x32' + chr(0b110011) + chr(55), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1011 + 0o47) + chr(0b10111 + 0o34) + '\x34', 40551 - 40543), nzTpIcepk0o8('\060' + '\x6f' + chr(0b11000 + 0o33) + chr(50) + '\062', 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b1101111) + '\065' + '\x34', 0o10), nzTpIcepk0o8(chr(80 - 32) + '\157' + chr(0b110000 + 0o2) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b1010 + 0o46) + '\x6f' + '\x35' + '\063', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + chr(50) + chr(165 - 112), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + '\x31' + chr(466 - 417), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b11 + 0o56) + chr(0b110110) + chr(381 - 329), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(99 - 50) + chr(0b110110) + '\061', 17448 - 17440), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(0b1100 + 0o45) + chr(1710 - 1662) + chr(0b110100 + 0o0), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\x32' + chr(208 - 154) + chr(0b100111 + 0o15), 0b1000), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b1101111) + chr(1086 - 1033), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x33' + chr(2071 - 2018) + chr(0b110 + 0o55), 0o10), nzTpIcepk0o8(chr(1732 - 1684) + '\157' + chr(0b110010) + chr(0b110001) + '\x36', 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\157' + '\062' + chr(0b110110) + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + chr(0b110111) + '\x33', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b101 + 0o152) + chr(444 - 393) + '\063' + '\x32', 8), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b1101111) + chr(0b11 + 0o60) + chr(0b110110) + chr(0b100000 + 0o27), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2274 - 2224), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + chr(51) + '\062', 8), nzTpIcepk0o8(chr(0b110000) + chr(11719 - 11608) + chr(0b11111 + 0o22) + chr(0b110101) + '\x36', 0o10), nzTpIcepk0o8(chr(898 - 850) + '\157' + chr(0b110001) + chr(0b101110 + 0o3) + chr(0b100101 + 0o15), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(2086 - 2036) + '\x33' + chr(0b11010 + 0o26), 4830 - 4822), nzTpIcepk0o8(chr(1706 - 1658) + chr(0b1101111) + chr(0b110001), 8), nzTpIcepk0o8('\x30' + chr(0b1100 + 0o143) + chr(0b110101) + chr(2523 - 2469), 15486 - 15478), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101 + 0o142) + chr(0b100010 + 0o20) + '\x34' + chr(2090 - 2040), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + chr(52) + chr(2533 - 2480), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1933 - 1885) + chr(0b1011101 + 0o22) + '\065' + chr(0b11110 + 0o22), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xd5'), '\x64' + '\x65' + chr(1497 - 1398) + '\x6f' + chr(100) + chr(1138 - 1037))(chr(0b10110 + 0o137) + chr(116) + chr(102) + chr(0b100001 + 0o14) + chr(2687 - 2631)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Ar5VFpXCGzQ2(_pSYqrosNb95, qc_AZrsvdJzx=[roI3spqORKae(ES5oEprVxulp(b'\x9a\xda\x9a\xa2\x83\x0ed\xb6'), chr(0b1100100) + chr(0b1001010 + 0o33) + chr(0b1000110 + 0o35) + '\157' + chr(2317 - 2217) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b100100 + 0o11) + chr(56))], rt5yMsH2WFRk=None):
with DnU3Rq9N5ala(_pSYqrosNb95, roI3spqORKae(ES5oEprVxulp(b'\x89\xca'), chr(100) + chr(101) + chr(0b1001110 + 0o25) + '\157' + chr(0b11110 + 0o106) + '\x65')(chr(2840 - 2723) + chr(116) + chr(3492 - 3390) + '\x2d' + '\070')) as _R8IKF5IwAfX:
zneflJJWU0FD = _R8IKF5IwAfX.eoXknH7XUn7m()
if rt5yMsH2WFRk:
zneflJJWU0FD = zneflJJWU0FD.lfbFsdWlT3MB(rt5yMsH2WFRk)
CMOLVR3miM7P = IS2KdOSdwbYN(zneflJJWU0FD, roI3spqORKae(ES5oEprVxulp(b'\x93\xdc\x83\xa7\xdd\th\xb8'), chr(0b1100100) + chr(0b1001100 + 0o31) + chr(0b111100 + 0o47) + '\x6f' + chr(100) + '\145')('\165' + chr(9410 - 9294) + '\x66' + chr(0b111 + 0o46) + chr(0b10011 + 0o45)))
OO0tRW9aj_xh = CMOLVR3miM7P.find_all(roI3spqORKae(ES5oEprVxulp(b'\x8f\xc1\x9a\xa7\x8d'), chr(4910 - 4810) + '\x65' + chr(4640 - 4541) + '\x6f' + chr(952 - 852) + chr(0b1000010 + 0o43))('\x75' + chr(116) + '\146' + chr(0b100001 + 0o14) + chr(0b111000)))[nzTpIcepk0o8(chr(74 - 26) + chr(11070 - 10959) + chr(0b11100 + 0o24), 0o10)].aji3jF4_nqWL
Q_ewMe16Waxe = []
for cG5Pykg_lDtw in roI3spqORKae(CMOLVR3miM7P, roI3spqORKae(ES5oEprVxulp(b'\x9d\xc1\x80\xaf\xb7\x04m\xb6'), '\x64' + '\x65' + chr(4195 - 4096) + '\157' + chr(100) + chr(814 - 713))('\x75' + chr(116) + chr(8670 - 8568) + chr(0b101101) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\x9f\xc1\x98\xfa'), chr(0b101 + 0o137) + chr(0b100001 + 0o104) + chr(6227 - 6128) + chr(0b10 + 0o155) + chr(0b111110 + 0o46) + chr(101))('\165' + chr(0b1001011 + 0o51) + chr(0b1100110) + chr(0b101101) + chr(0b111000))):
roI3spqORKae(Q_ewMe16Waxe, roI3spqORKae(ES5oEprVxulp(b'\xaf\xf7\xdd\x86\x87\x01M\x8d\xd4\xdd\xcdm'), chr(100) + chr(101) + chr(0b1100 + 0o127) + '\x6f' + chr(0b1001111 + 0o25) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(343 - 298) + chr(0b111000)))(R8zikIl4d_h8(cG5Pykg_lDtw, znjnJWK64FDT(), qc_AZrsvdJzx))
return HBLRRKEQybyT(Q_ewMe16Waxe)
|
estnltk/estnltk
|
estnltk/teicorpus.py
|
parse_div
|
def parse_div(soup, metadata, target):
"""Parse a <div> tag from the file.
The sections in XML files are given in <div1>, <div2> and <div3>
tags. Each such tag has a type and name (plus possibly more extra attributes).
If the div type is found in target variable, the div is parsed
into structured paragraphs, sentences and words.
Otherwise, the type and name are added as metadata to subdivs
and stored in.
Parameters
----------
soup: bs4.BeautifulSoup
The parsed XML data.
metdata: dict
The metadata for parent divs.
target: list of str
List of <div> types, that are considered documents in the XML files.
"""
documents = []
div_type = soup.get('type', None)
div_title = list(soup.children)[0].string.strip()
if div_type in target:
div_authors = soup.find_all('author')
document = {
'type': div_type,
'title': div_title,
'paragraphs': parse_paragraphs(soup)
}
# add author, if it exists
if len(div_authors) > 0:
div_author = div_authors[0].text.strip()
document['author'] = div_author
# add collected metadata
for k, v in metadata.items():
document[k] = v
documents.append(document)
else:
metadata[div_type] = div_title
# recurse subdivs
subdiv_name = get_subdiv(soup.name)
subdivs = []
if subdiv_name is not None:
subdivs = soup.find_all(subdiv_name)
if len(subdivs) > 0:
for subdiv in subdivs:
documents.extend(parse_div(subdiv, deepcopy(metadata), target))
return documents
|
python
|
def parse_div(soup, metadata, target):
"""Parse a <div> tag from the file.
The sections in XML files are given in <div1>, <div2> and <div3>
tags. Each such tag has a type and name (plus possibly more extra attributes).
If the div type is found in target variable, the div is parsed
into structured paragraphs, sentences and words.
Otherwise, the type and name are added as metadata to subdivs
and stored in.
Parameters
----------
soup: bs4.BeautifulSoup
The parsed XML data.
metdata: dict
The metadata for parent divs.
target: list of str
List of <div> types, that are considered documents in the XML files.
"""
documents = []
div_type = soup.get('type', None)
div_title = list(soup.children)[0].string.strip()
if div_type in target:
div_authors = soup.find_all('author')
document = {
'type': div_type,
'title': div_title,
'paragraphs': parse_paragraphs(soup)
}
# add author, if it exists
if len(div_authors) > 0:
div_author = div_authors[0].text.strip()
document['author'] = div_author
# add collected metadata
for k, v in metadata.items():
document[k] = v
documents.append(document)
else:
metadata[div_type] = div_title
# recurse subdivs
subdiv_name = get_subdiv(soup.name)
subdivs = []
if subdiv_name is not None:
subdivs = soup.find_all(subdiv_name)
if len(subdivs) > 0:
for subdiv in subdivs:
documents.extend(parse_div(subdiv, deepcopy(metadata), target))
return documents
|
[
"def",
"parse_div",
"(",
"soup",
",",
"metadata",
",",
"target",
")",
":",
"documents",
"=",
"[",
"]",
"div_type",
"=",
"soup",
".",
"get",
"(",
"'type'",
",",
"None",
")",
"div_title",
"=",
"list",
"(",
"soup",
".",
"children",
")",
"[",
"0",
"]",
".",
"string",
".",
"strip",
"(",
")",
"if",
"div_type",
"in",
"target",
":",
"div_authors",
"=",
"soup",
".",
"find_all",
"(",
"'author'",
")",
"document",
"=",
"{",
"'type'",
":",
"div_type",
",",
"'title'",
":",
"div_title",
",",
"'paragraphs'",
":",
"parse_paragraphs",
"(",
"soup",
")",
"}",
"# add author, if it exists",
"if",
"len",
"(",
"div_authors",
")",
">",
"0",
":",
"div_author",
"=",
"div_authors",
"[",
"0",
"]",
".",
"text",
".",
"strip",
"(",
")",
"document",
"[",
"'author'",
"]",
"=",
"div_author",
"# add collected metadata",
"for",
"k",
",",
"v",
"in",
"metadata",
".",
"items",
"(",
")",
":",
"document",
"[",
"k",
"]",
"=",
"v",
"documents",
".",
"append",
"(",
"document",
")",
"else",
":",
"metadata",
"[",
"div_type",
"]",
"=",
"div_title",
"# recurse subdivs",
"subdiv_name",
"=",
"get_subdiv",
"(",
"soup",
".",
"name",
")",
"subdivs",
"=",
"[",
"]",
"if",
"subdiv_name",
"is",
"not",
"None",
":",
"subdivs",
"=",
"soup",
".",
"find_all",
"(",
"subdiv_name",
")",
"if",
"len",
"(",
"subdivs",
")",
">",
"0",
":",
"for",
"subdiv",
"in",
"subdivs",
":",
"documents",
".",
"extend",
"(",
"parse_div",
"(",
"subdiv",
",",
"deepcopy",
"(",
"metadata",
")",
",",
"target",
")",
")",
"return",
"documents"
] |
Parse a <div> tag from the file.
The sections in XML files are given in <div1>, <div2> and <div3>
tags. Each such tag has a type and name (plus possibly more extra attributes).
If the div type is found in target variable, the div is parsed
into structured paragraphs, sentences and words.
Otherwise, the type and name are added as metadata to subdivs
and stored in.
Parameters
----------
soup: bs4.BeautifulSoup
The parsed XML data.
metdata: dict
The metadata for parent divs.
target: list of str
List of <div> types, that are considered documents in the XML files.
|
[
"Parse",
"a",
"<div",
">",
"tag",
"from",
"the",
"file",
".",
"The",
"sections",
"in",
"XML",
"files",
"are",
"given",
"in",
"<div1",
">",
"<div2",
">",
"and",
"<div3",
">",
"tags",
".",
"Each",
"such",
"tag",
"has",
"a",
"type",
"and",
"name",
"(",
"plus",
"possibly",
"more",
"extra",
"attributes",
")",
".",
"If",
"the",
"div",
"type",
"is",
"found",
"in",
"target",
"variable",
"the",
"div",
"is",
"parsed",
"into",
"structured",
"paragraphs",
"sentences",
"and",
"words",
".",
"Otherwise",
"the",
"type",
"and",
"name",
"are",
"added",
"as",
"metadata",
"to",
"subdivs",
"and",
"stored",
"in",
".",
"Parameters",
"----------",
"soup",
":",
"bs4",
".",
"BeautifulSoup",
"The",
"parsed",
"XML",
"data",
".",
"metdata",
":",
"dict",
"The",
"metadata",
"for",
"parent",
"divs",
".",
"target",
":",
"list",
"of",
"str",
"List",
"of",
"<div",
">",
"types",
"that",
"are",
"considered",
"documents",
"in",
"the",
"XML",
"files",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/teicorpus.py#L97-L149
|
train
|
Parses a div from the XML file and returns a list of dicts.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,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gTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(111) + chr(0b11010 + 0o31) + chr(49) + chr(0b100100 + 0o23), 0o10), nzTpIcepk0o8(chr(48) + chr(0b10110 + 0o131) + chr(1838 - 1789) + '\x32' + '\x32', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + '\x35' + chr(55), 51496 - 51488), nzTpIcepk0o8(chr(2039 - 1991) + '\x6f' + chr(49) + chr(0b110001) + chr(2839 - 2785), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(955 - 844) + chr(0b101101 + 0o4) + '\x31' + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\x6f' + '\x31' + chr(53) + chr(0b110011), 52087 - 52079), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b100011 + 0o20) + '\063', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(48) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(111) + chr(0b111 + 0o54) + chr(0b110 + 0o60), 0b1000), nzTpIcepk0o8(chr(0b101110 + 0o2) + '\x6f' + '\062' + '\x32' + '\x35', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b111 + 0o150) + '\x31' + chr(1433 - 1382) + chr(0b1 + 0o64), 0o10), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b1101111) + chr(0b110011) + '\x37' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(1325 - 1277) + chr(0b1101111) + chr(0b110011) + chr(2293 - 2239) + chr(53), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + chr(2024 - 1971) + chr(52 - 1), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(53) + '\067', 46491 - 46483), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31', 20556 - 20548), nzTpIcepk0o8('\x30' + chr(0b10001 + 0o136) + chr(1131 - 1076) + chr(55), 21217 - 21209), nzTpIcepk0o8(chr(1149 - 1101) + '\157' + chr(0b110100) + '\060', 0b1000), nzTpIcepk0o8(chr(1963 - 1915) + '\157' + '\x31' + chr(2562 - 2510) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(0b1101111) + '\x35' + chr(50), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101011 + 0o4) + chr(0b110010) + chr(51) + '\060', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + chr(0b100011 + 0o16), 0b1000), nzTpIcepk0o8('\x30' + chr(0b101001 + 0o106) + chr(1657 - 1606) + '\x35' + chr(54), 52238 - 52230), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110010) + chr(766 - 712) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\x6f' + chr(51) + chr(48) + '\x33', 5799 - 5791), nzTpIcepk0o8('\060' + chr(0b110001 + 0o76) + '\x32' + chr(0b11110 + 0o23) + '\062', 0o10), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(0b1101111) + chr(0b110011) + chr(0b110110 + 0o1) + chr(0b101010 + 0o12), 0o10), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(50) + chr(0b110 + 0o54), 14610 - 14602), nzTpIcepk0o8(chr(495 - 447) + chr(0b1100001 + 0o16) + chr(1600 - 1551) + chr(54), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + chr(48) + chr(51), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\063' + chr(50) + chr(0b110011 + 0o0), 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1010101 + 0o32) + chr(51) + chr(1219 - 1164) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(0b100100 + 0o16) + '\064' + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100111 + 0o14) + chr(0b101100 + 0o12) + '\065', 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1598 - 1547) + chr(51) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\x6f' + chr(0b110001 + 0o2) + chr(49) + '\063', 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\065' + '\x32', 8), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\157' + chr(0b110010) + '\x36' + chr(0b11010 + 0o31), 0b1000), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(111) + '\063' + chr(744 - 689) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(111) + chr(1127 - 1076) + '\062' + chr(882 - 828), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x35' + '\x30', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe1'), chr(0b1100100) + '\145' + '\143' + chr(111) + chr(7508 - 7408) + '\145')(chr(0b1110101) + chr(116) + chr(102) + chr(431 - 386) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def R8zikIl4d_h8(CMOLVR3miM7P, nmf2TsIJJ3IK, qc_AZrsvdJzx):
Q_ewMe16Waxe = []
n_t4zK4tJtgd = CMOLVR3miM7P.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\xbb+\x1f+'), chr(0b11110 + 0o106) + chr(0b101001 + 0o74) + '\x63' + '\157' + chr(100) + '\x65')(chr(0b101010 + 0o113) + chr(116) + '\146' + chr(239 - 194) + chr(2402 - 2346)), None)
C1mQwWu9cUp4 = H4NoA26ON7iG(CMOLVR3miM7P.children)[nzTpIcepk0o8('\060' + chr(111) + chr(48), 0o10)].string.kdIDrcwZTCs5()
if n_t4zK4tJtgd in qc_AZrsvdJzx:
GHG2JhPm8gE7 = CMOLVR3miM7P.find_all(roI3spqORKae(ES5oEprVxulp(b"\xae'\x1b&#\x19"), chr(0b1100100) + chr(101) + chr(9320 - 9221) + chr(0b1100101 + 0o12) + chr(0b10100 + 0o120) + chr(101))(chr(0b1110101) + chr(116) + chr(102) + chr(1285 - 1240) + '\070'))
K6an18Ylsl3S = {roI3spqORKae(ES5oEprVxulp(b'\xbb+\x1f+'), chr(0b111100 + 0o50) + chr(0b1100101) + chr(0b1000010 + 0o41) + chr(8086 - 7975) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(5300 - 5184) + '\x66' + chr(0b101101) + chr(0b111000)): n_t4zK4tJtgd, roI3spqORKae(ES5oEprVxulp(b'\xbb;\x1b")'), chr(9089 - 8989) + '\145' + chr(99) + chr(0b1101111) + chr(0b0 + 0o144) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(1670 - 1625) + chr(0b1101 + 0o53)): C1mQwWu9cUp4, roI3spqORKae(ES5oEprVxulp(b'\xbf3\x1d/+\x19z6v\xe6'), '\x64' + chr(2702 - 2601) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(116) + chr(0b1000101 + 0o41) + '\055' + chr(0b111000)): slZ9XC_qirHF(CMOLVR3miM7P)}
if ftfygxgFas5X(GHG2JhPm8gE7) > nzTpIcepk0o8('\x30' + chr(5150 - 5039) + '\060', 8):
Gh7tQUqkXZJ_ = GHG2JhPm8gE7[nzTpIcepk0o8('\x30' + chr(0b101110 + 0o101) + '\x30', 8)].text.kdIDrcwZTCs5()
K6an18Ylsl3S[roI3spqORKae(ES5oEprVxulp(b"\xae'\x1b&#\x19"), chr(100) + '\145' + '\x63' + chr(11300 - 11189) + chr(9033 - 8933) + chr(9215 - 9114))('\165' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(56))] = Gh7tQUqkXZJ_
for (B6UAF1zReOyJ, r7AA1pbLjb44) in roI3spqORKae(nmf2TsIJJ3IK, roI3spqORKae(ES5oEprVxulp(b'\x96\r\x01\x00\t\x11Sr-\xe3\x05\x97'), '\144' + chr(3046 - 2945) + '\143' + chr(111) + '\x64' + chr(0b1111 + 0o126))(chr(0b1110101) + chr(116) + '\146' + chr(1323 - 1278) + chr(56)))():
K6an18Ylsl3S[B6UAF1zReOyJ] = r7AA1pbLjb44
roI3spqORKae(Q_ewMe16Waxe, roI3spqORKae(ES5oEprVxulp(b'\x87\x06<z4\x0c\\)t\xfa\x08\xcb'), chr(100) + chr(101) + chr(3183 - 3084) + '\157' + chr(0b1100100) + chr(4311 - 4210))(chr(117) + chr(0b10111 + 0o135) + chr(0b101000 + 0o76) + '\055' + '\x38'))(K6an18Ylsl3S)
else:
nmf2TsIJJ3IK[n_t4zK4tJtgd] = C1mQwWu9cUp4
P3SW8AOAuR1O = CgeTS8FylgvJ(CMOLVR3miM7P.SLVB2BPA_mIe)
TMQ3tewLZY7W = []
if P3SW8AOAuR1O is not None:
TMQ3tewLZY7W = CMOLVR3miM7P.find_all(P3SW8AOAuR1O)
if ftfygxgFas5X(TMQ3tewLZY7W) > nzTpIcepk0o8(chr(48) + '\157' + chr(0b110000), 8):
for TQgWygGu7v37 in TMQ3tewLZY7W:
roI3spqORKae(Q_ewMe16Waxe, roI3spqORKae(ES5oEprVxulp(b'\x9b\r\\\x03#\x0fW\x11A\xd7?\x8f'), '\x64' + '\x65' + chr(0b111110 + 0o45) + '\x6f' + chr(100) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\x66' + '\x2d' + '\x38'))(R8zikIl4d_h8(TQgWygGu7v37, Ysjl1k89Gm2v(nmf2TsIJJ3IK), qc_AZrsvdJzx))
return Q_ewMe16Waxe
|
estnltk/estnltk
|
estnltk/teicorpus.py
|
parse_paragraphs
|
def parse_paragraphs(soup):
"""Parse sentences and paragraphs in the section.
Parameters
----------
soup: bs4.BeautifulSoup
The parsed XML data.
Returns
-------
list of (list of str)
List of paragraphs given as list of sentences.
"""
paragraphs = []
for para in soup.find_all('p'):
sentences = []
for sent in para.find_all('s'):
sentence = sent.text.strip()
if len(sentence) > 0:
sentences.append(sentence)
if len(sentences) > 0:
paragraphs.append({'sentences': sentences})
return paragraphs
|
python
|
def parse_paragraphs(soup):
"""Parse sentences and paragraphs in the section.
Parameters
----------
soup: bs4.BeautifulSoup
The parsed XML data.
Returns
-------
list of (list of str)
List of paragraphs given as list of sentences.
"""
paragraphs = []
for para in soup.find_all('p'):
sentences = []
for sent in para.find_all('s'):
sentence = sent.text.strip()
if len(sentence) > 0:
sentences.append(sentence)
if len(sentences) > 0:
paragraphs.append({'sentences': sentences})
return paragraphs
|
[
"def",
"parse_paragraphs",
"(",
"soup",
")",
":",
"paragraphs",
"=",
"[",
"]",
"for",
"para",
"in",
"soup",
".",
"find_all",
"(",
"'p'",
")",
":",
"sentences",
"=",
"[",
"]",
"for",
"sent",
"in",
"para",
".",
"find_all",
"(",
"'s'",
")",
":",
"sentence",
"=",
"sent",
".",
"text",
".",
"strip",
"(",
")",
"if",
"len",
"(",
"sentence",
")",
">",
"0",
":",
"sentences",
".",
"append",
"(",
"sentence",
")",
"if",
"len",
"(",
"sentences",
")",
">",
"0",
":",
"paragraphs",
".",
"append",
"(",
"{",
"'sentences'",
":",
"sentences",
"}",
")",
"return",
"paragraphs"
] |
Parse sentences and paragraphs in the section.
Parameters
----------
soup: bs4.BeautifulSoup
The parsed XML data.
Returns
-------
list of (list of str)
List of paragraphs given as list of sentences.
|
[
"Parse",
"sentences",
"and",
"paragraphs",
"in",
"the",
"section",
".",
"Parameters",
"----------",
"soup",
":",
"bs4",
".",
"BeautifulSoup",
"The",
"parsed",
"XML",
"data",
".",
"Returns",
"-------",
"list",
"of",
"(",
"list",
"of",
"str",
")",
"List",
"of",
"paragraphs",
"given",
"as",
"list",
"of",
"sentences",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/teicorpus.py#L152-L174
|
train
|
Parse sentences and paragraphs in the section.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT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06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(2800 - 2689) + chr(0b110001) + '\063' + chr(1823 - 1773), 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(4441 - 4330) + chr(0b110011) + '\065' + chr(55), 48354 - 48346), nzTpIcepk0o8(chr(48) + chr(0b1001011 + 0o44) + '\x31' + '\064' + chr(0b110000), 64135 - 64127), nzTpIcepk0o8(chr(48) + chr(3902 - 3791) + '\x32' + '\060' + '\061', 20577 - 20569), nzTpIcepk0o8('\060' + chr(111) + '\x32' + chr(77 - 25) + chr(0b110010 + 0o2), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31' + '\060' + chr(0b11011 + 0o26), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1000110 + 0o51) + '\064' + '\x31', ord("\x08")), nzTpIcepk0o8('\x30' + chr(3037 - 2926) + chr(51) + '\060' + chr(1464 - 1415), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + '\x33' + chr(0b110110 + 0o1), 0o10), nzTpIcepk0o8(chr(1861 - 1813) + chr(111) + chr(0b101011 + 0o6) + chr(0b110110) + chr(2480 - 2430), 25097 - 25089), nzTpIcepk0o8(chr(1164 - 1116) + chr(0b1101111 + 0o0) + '\x33' + chr(2486 - 2433) + '\066', 0o10), nzTpIcepk0o8(chr(1589 - 1541) + '\x6f' + '\x32' + '\x35' + chr(1155 - 1100), 37093 - 37085), nzTpIcepk0o8(chr(1265 - 1217) + '\157' + '\063' + '\063' + chr(2181 - 2129), 0b1000), nzTpIcepk0o8(chr(429 - 381) + chr(0b1101111) + chr(0b11010 + 0o27) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(61 - 13) + '\x6f' + chr(0b101011 + 0o6) + '\x30' + chr(0b10110 + 0o32), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(1155 - 1105) + chr(53) + chr(0b11110 + 0o25), ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + '\157' + chr(0b110001) + '\062' + chr(49), 30255 - 30247), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\x32' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(50) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x36' + chr(51), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(49) + chr(0b100001 + 0o25) + '\x31', 0b1000), nzTpIcepk0o8(chr(2250 - 2202) + '\157' + chr(0b110011) + '\x32' + '\062', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b1001 + 0o50) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(728 - 680) + chr(0b1101111) + '\x34' + chr(0b101111 + 0o7), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b11100 + 0o26) + chr(55) + chr(0b101111 + 0o7), ord("\x08")), nzTpIcepk0o8(chr(1105 - 1057) + chr(0b1101111) + chr(51) + chr(0b110110) + '\x30', 0o10), nzTpIcepk0o8(chr(49 - 1) + chr(111) + chr(0b110011) + '\060' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b1000110 + 0o51) + chr(49) + '\060' + chr(0b11 + 0o60), 11789 - 11781), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1049 - 1000) + chr(0b110011) + '\064', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + '\067' + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(1236 - 1184) + '\067', 21251 - 21243), nzTpIcepk0o8(chr(775 - 727) + chr(0b10 + 0o155) + chr(0b110101) + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1001000 + 0o47) + '\063' + chr(0b1 + 0o61) + chr(49), 20566 - 20558), nzTpIcepk0o8(chr(504 - 456) + '\x6f' + '\x32' + chr(0b110 + 0o61) + chr(221 - 167), 8), nzTpIcepk0o8(chr(48) + '\157' + '\067' + '\065', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + chr(53) + '\x31', 0b1000), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b101000 + 0o107) + chr(51) + '\x36' + chr(0b101000 + 0o15), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + chr(51) + chr(0b110010), 28727 - 28719), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(0b101000 + 0o17) + chr(0b110110), 8), nzTpIcepk0o8('\060' + chr(0b1011000 + 0o27) + '\x32' + chr(2602 - 2548), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(2199 - 2151) + '\157' + '\x35' + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b't'), chr(100) + '\145' + chr(8220 - 8121) + chr(0b100111 + 0o110) + '\x64' + '\145')(chr(6616 - 6499) + '\164' + chr(0b1100110) + '\055' + chr(0b1010 + 0o56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def slZ9XC_qirHF(CMOLVR3miM7P):
EubwBdJ99UuA = []
for ZRtHvwvzTbCE in roI3spqORKae(CMOLVR3miM7P, roI3spqORKae(ES5oEprVxulp(b'<\x86\x0e\xe5\xfb M\xad'), chr(0b1100100) + '\x65' + '\143' + chr(683 - 572) + chr(0b1011111 + 0o5) + '\x65')(chr(6220 - 6103) + chr(0b1110100) + chr(0b1010101 + 0o21) + '\055' + chr(2765 - 2709)))(roI3spqORKae(ES5oEprVxulp(b'*'), chr(0b110000 + 0o64) + '\145' + chr(6022 - 5923) + chr(111) + chr(100) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1100110) + '\x2d' + '\070')):
k4Vme3Q1HRO8 = []
for KCSwZZoid0kT in roI3spqORKae(ZRtHvwvzTbCE, roI3spqORKae(ES5oEprVxulp(b'<\x86\x0e\xe5\xfb M\xad'), chr(100) + chr(0b1100101) + chr(7361 - 7262) + chr(8106 - 7995) + chr(0b1001110 + 0o26) + '\145')(chr(0b1110101) + chr(0b1101010 + 0o12) + '\146' + chr(367 - 322) + chr(2617 - 2561)))(roI3spqORKae(ES5oEprVxulp(b')'), '\x64' + chr(0b1100101) + '\x63' + chr(111) + chr(0b101100 + 0o70) + '\x65')(chr(0b110100 + 0o101) + '\164' + '\x66' + chr(1245 - 1200) + chr(1862 - 1806))):
v3YfwzoUholR = KCSwZZoid0kT.text.kdIDrcwZTCs5()
if ftfygxgFas5X(v3YfwzoUholR) > nzTpIcepk0o8('\060' + '\x6f' + chr(1814 - 1766), ord("\x08")):
roI3spqORKae(k4Vme3Q1HRO8, roI3spqORKae(ES5oEprVxulp(b'\x12\xbb3\xb5\xdc&f\xae\xb5\x1d\xbb\x9a'), '\x64' + '\x65' + chr(0b1001001 + 0o32) + '\x6f' + '\144' + chr(0b1000001 + 0o44))(chr(0b1001111 + 0o46) + chr(0b1110100) + chr(0b1100110) + chr(0b101101 + 0o0) + '\x38'))(v3YfwzoUholR)
if ftfygxgFas5X(k4Vme3Q1HRO8) > nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1101111) + '\060', 8):
roI3spqORKae(EubwBdJ99UuA, roI3spqORKae(ES5oEprVxulp(b'\x12\xbb3\xb5\xdc&f\xae\xb5\x1d\xbb\x9a'), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')(chr(1377 - 1260) + chr(0b1101000 + 0o14) + chr(0b100011 + 0o103) + chr(0b100101 + 0o10) + chr(0b111000)))({roI3spqORKae(ES5oEprVxulp(b')\x8a\x0e\xf5\xc1/B\xa4\xac'), chr(100) + chr(7391 - 7290) + chr(99) + chr(0b1101111) + chr(100) + chr(0b10011 + 0o122))(chr(4097 - 3980) + chr(116) + '\146' + chr(0b101101) + chr(0b101101 + 0o13)): k4Vme3Q1HRO8})
return EubwBdJ99UuA
|
estnltk/estnltk
|
estnltk/teicorpus.py
|
tokenize_documents
|
def tokenize_documents(docs):
"""Convert the imported documents to :py:class:'~estnltk.text.Text' instances."""
sep = '\n\n'
texts = []
for doc in docs:
text = '\n\n'.join(['\n'.join(para[SENTENCES]) for para in doc[PARAGRAPHS]])
doc[TEXT] = text
del doc[PARAGRAPHS]
texts.append(Text(doc))
return texts
|
python
|
def tokenize_documents(docs):
"""Convert the imported documents to :py:class:'~estnltk.text.Text' instances."""
sep = '\n\n'
texts = []
for doc in docs:
text = '\n\n'.join(['\n'.join(para[SENTENCES]) for para in doc[PARAGRAPHS]])
doc[TEXT] = text
del doc[PARAGRAPHS]
texts.append(Text(doc))
return texts
|
[
"def",
"tokenize_documents",
"(",
"docs",
")",
":",
"sep",
"=",
"'\\n\\n'",
"texts",
"=",
"[",
"]",
"for",
"doc",
"in",
"docs",
":",
"text",
"=",
"'\\n\\n'",
".",
"join",
"(",
"[",
"'\\n'",
".",
"join",
"(",
"para",
"[",
"SENTENCES",
"]",
")",
"for",
"para",
"in",
"doc",
"[",
"PARAGRAPHS",
"]",
"]",
")",
"doc",
"[",
"TEXT",
"]",
"=",
"text",
"del",
"doc",
"[",
"PARAGRAPHS",
"]",
"texts",
".",
"append",
"(",
"Text",
"(",
"doc",
")",
")",
"return",
"texts"
] |
Convert the imported documents to :py:class:'~estnltk.text.Text' instances.
|
[
"Convert",
"the",
"imported",
"documents",
"to",
":",
"py",
":",
"class",
":",
"~estnltk",
".",
"text",
".",
"Text",
"instances",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/teicorpus.py#L186-L195
|
train
|
Convert the imported documents to Text instances.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw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b,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1166 - 1118) + chr(0b110000 + 0o77) + chr(0b110111) + '\064', 36697 - 36689), nzTpIcepk0o8(chr(0b110000) + chr(5321 - 5210) + chr(50) + '\x34' + '\x35', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + chr(0b110010 + 0o3) + chr(49), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + chr(2263 - 2214) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(8518 - 8407) + chr(49) + '\067' + chr(0b10101 + 0o40), 0b1000), nzTpIcepk0o8(chr(48) + chr(5004 - 4893) + chr(0b110010) + '\x30' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1952 - 1903) + chr(51) + '\x34', 0o10), nzTpIcepk0o8('\x30' + chr(9845 - 9734) + chr(0b110001) + chr(53) + chr(51), 57238 - 57230), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b100000 + 0o21) + '\060' + chr(1647 - 1599), 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\x6f' + chr(54) + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(3331 - 3220) + chr(0b110101) + '\x34', 14888 - 14880), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + '\060', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(48) + chr(0b101001 + 0o16), 53143 - 53135), nzTpIcepk0o8(chr(0b110000) + chr(0b10111 + 0o130) + '\065', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\x32' + chr(49) + chr(0b110 + 0o52), ord("\x08")), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(3166 - 3055) + chr(0b110001) + chr(0b100011 + 0o17) + '\x34', 15715 - 15707), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(8595 - 8484) + '\063' + chr(1590 - 1537) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + chr(53) + chr(1333 - 1281), ord("\x08")), nzTpIcepk0o8(chr(0b10 + 0o56) + '\x6f' + chr(1293 - 1243) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(2274 - 2226) + chr(0b1101111) + chr(2429 - 2379) + chr(0b101100 + 0o12) + '\061', 63832 - 63824), nzTpIcepk0o8(chr(1750 - 1702) + '\157' + chr(0b110001) + '\x32' + chr(0b101011 + 0o10), 0o10), nzTpIcepk0o8('\060' + chr(2892 - 2781) + chr(0b10 + 0o61) + '\061' + '\x30', 0o10), nzTpIcepk0o8(chr(1957 - 1909) + chr(111) + chr(0b110001) + chr(0b10001 + 0o46) + '\x31', 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(111) + chr(0b10010 + 0o40) + chr(317 - 266), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2161 - 2110) + chr(1463 - 1412) + chr(0b11010 + 0o27), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(0b10011 + 0o41) + chr(0b1001 + 0o47), 0o10), nzTpIcepk0o8('\x30' + chr(6416 - 6305) + '\x32' + chr(0b10001 + 0o42), 8), nzTpIcepk0o8('\x30' + '\157' + chr(0b110010) + '\067' + '\x33', 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(111) + chr(0b110010) + chr(2586 - 2532) + chr(52), ord("\x08")), nzTpIcepk0o8('\060' + chr(11386 - 11275) + chr(53) + chr(0b101 + 0o54), 12655 - 12647), nzTpIcepk0o8(chr(0b110000) + chr(0b10111 + 0o130) + chr(169 - 119) + chr(53) + chr(0b110101), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b100000 + 0o20) + chr(0b10 + 0o62), ord("\x08")), nzTpIcepk0o8(chr(1766 - 1718) + '\x6f' + chr(1279 - 1228) + '\064' + chr(2629 - 2577), ord("\x08")), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(0b1101111) + chr(0b10 + 0o60) + '\x32' + chr(52), 0o10), nzTpIcepk0o8(chr(48) + chr(5938 - 5827) + chr(1020 - 971) + chr(52) + chr(1369 - 1318), 0b1000), nzTpIcepk0o8('\060' + chr(0b111111 + 0o60) + '\067' + chr(100 - 48), 8), nzTpIcepk0o8(chr(1673 - 1625) + chr(0b1101111) + chr(0b1011 + 0o50) + '\x37' + chr(2433 - 2381), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(1580 - 1532) + '\061', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b10011 + 0o36) + chr(0b110010) + chr(0b110101), 0b1000), nzTpIcepk0o8('\060' + chr(0b10101 + 0o132) + '\x31' + '\x35' + chr(50), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\x6f' + '\x35' + chr(0b110000), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x12'), chr(0b101100 + 0o70) + '\x65' + chr(99) + chr(0b100111 + 0o110) + '\x64' + chr(6309 - 6208))(chr(117) + '\x74' + chr(102) + chr(1875 - 1830) + chr(504 - 448)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def HBLRRKEQybyT(CxOVg8j4LTAA):
EAvVzGIvS3lY = roI3spqORKae(ES5oEprVxulp(b'6\xaf'), chr(100) + chr(4463 - 4362) + '\x63' + chr(2520 - 2409) + chr(0b1100100) + '\x65')(chr(117) + '\x74' + chr(10280 - 10178) + chr(45) + chr(56))
p5gYIeSVE6xX = []
for mPg7tgN9u21K in CxOVg8j4LTAA:
cpStk7cY1TJd = roI3spqORKae(ES5oEprVxulp(b'6\xaf'), chr(9601 - 9501) + chr(0b11000 + 0o115) + chr(0b10111 + 0o114) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\x75' + '\x74' + chr(6236 - 6134) + '\055' + '\x38').Y4yM9BcfTCNq([roI3spqORKae(ES5oEprVxulp(b'6'), chr(100) + chr(0b1100101) + '\x63' + chr(5888 - 5777) + chr(0b10110 + 0o116) + chr(0b1100101))(chr(0b110000 + 0o105) + chr(116) + chr(0b1100110) + chr(1222 - 1177) + '\x38').Y4yM9BcfTCNq(ZRtHvwvzTbCE[DUoBUczr5TtH]) for ZRtHvwvzTbCE in mPg7tgN9u21K[Ij2uE1UcrtNN]])
mPg7tgN9u21K[JPzDaf6_RoFd] = cpStk7cY1TJd
del mPg7tgN9u21K[Ij2uE1UcrtNN]
roI3spqORKae(p5gYIeSVE6xX, roI3spqORKae(ES5oEprVxulp(b't\xf1:\xbd\x05\xe1\x1b\x04*]y%'), chr(5650 - 5550) + chr(1473 - 1372) + chr(99) + '\157' + '\x64' + chr(101))(chr(3317 - 3200) + chr(116) + chr(0b1001001 + 0o35) + '\055' + chr(687 - 631)))(Yunp_Kt7vLoC(mPg7tgN9u21K))
return p5gYIeSVE6xX
|
estnltk/estnltk
|
estnltk/tools/train_default_ner_model.py
|
train_default_model
|
def train_default_model():
"""Function for training the default NER model.
NB! It overwrites the default model, so do not use it unless
you know what are you doing.
The training data is in file estnltk/corpora/estner.json.bz2 .
The resulting model will be saved to estnltk/estner/models/default.bin
"""
docs = read_json_corpus(DEFAULT_NER_DATASET)
trainer = NerTrainer(default_nersettings)
trainer.train(docs, DEFAULT_NER_MODEL_DIR)
|
python
|
def train_default_model():
"""Function for training the default NER model.
NB! It overwrites the default model, so do not use it unless
you know what are you doing.
The training data is in file estnltk/corpora/estner.json.bz2 .
The resulting model will be saved to estnltk/estner/models/default.bin
"""
docs = read_json_corpus(DEFAULT_NER_DATASET)
trainer = NerTrainer(default_nersettings)
trainer.train(docs, DEFAULT_NER_MODEL_DIR)
|
[
"def",
"train_default_model",
"(",
")",
":",
"docs",
"=",
"read_json_corpus",
"(",
"DEFAULT_NER_DATASET",
")",
"trainer",
"=",
"NerTrainer",
"(",
"default_nersettings",
")",
"trainer",
".",
"train",
"(",
"docs",
",",
"DEFAULT_NER_MODEL_DIR",
")"
] |
Function for training the default NER model.
NB! It overwrites the default model, so do not use it unless
you know what are you doing.
The training data is in file estnltk/corpora/estner.json.bz2 .
The resulting model will be saved to estnltk/estner/models/default.bin
|
[
"Function",
"for",
"training",
"the",
"default",
"NER",
"model",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/tools/train_default_ner_model.py#L10-L21
|
train
|
Function for training the default NER model.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdk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aZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b100110 + 0o12) + '\157' + '\x32' + chr(2005 - 1957) + '\060', 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(111) + '\x32' + chr(55) + '\x37', 61270 - 61262), nzTpIcepk0o8('\060' + chr(111) + '\067' + '\063', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(50) + chr(0b11001 + 0o27) + chr(774 - 721), 0b1000), nzTpIcepk0o8(chr(1994 - 1946) + '\157' + '\061' + chr(53) + chr(0b110101), 0o10), nzTpIcepk0o8('\x30' + chr(993 - 882) + '\063' + chr(52) + chr(0b101110 + 0o10), 55081 - 55073), nzTpIcepk0o8('\060' + chr(1578 - 1467) + '\061' + chr(0b101100 + 0o10) + chr(1362 - 1314), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + '\062' + '\062', 0o10), nzTpIcepk0o8(chr(48) + chr(3103 - 2992) + '\061' + chr(1866 - 1812) + chr(0b11 + 0o62), 0o10), nzTpIcepk0o8('\060' + chr(0b110000 + 0o77) + '\064' + '\064', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b11101 + 0o32), 0b1000), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(0b1101111) + '\x32' + chr(52), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + '\x33' + '\x33', 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + '\157' + chr(1876 - 1827) + '\x30' + '\067', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + '\x31' + chr(2871 - 2817), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10 + 0o61) + chr(0b110011) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(0b1101111) + chr(0b110011) + chr(0b10110 + 0o37) + '\065', 51304 - 51296), nzTpIcepk0o8(chr(48) + chr(11036 - 10925) + chr(0b110010) + chr(0b11100 + 0o26) + chr(1420 - 1366), 33553 - 33545), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b10101 + 0o33) + chr(0b100100 + 0o17), 24268 - 24260), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(530 - 481) + chr(1248 - 1195) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\157' + chr(51) + '\x32' + chr(0b10110 + 0o37), ord("\x08")), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(111) + chr(0b110011) + chr(0b110010) + chr(2052 - 2000), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\061' + chr(0b11010 + 0o31) + chr(0b110100), 29215 - 29207), nzTpIcepk0o8(chr(0b110000) + chr(0b110001 + 0o76) + chr(0b100001 + 0o24) + '\x34', 0b1000), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(111) + '\x31' + '\063' + chr(48), 41095 - 41087), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2194 - 2144) + chr(0b10110 + 0o41) + chr(2962 - 2907), 8), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\x6f' + chr(50) + chr(0b1000 + 0o55) + chr(754 - 704), 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b1101111) + chr(1144 - 1093) + chr(2461 - 2408) + '\062', 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101011 + 0o4) + '\061' + '\067', 0b1000), nzTpIcepk0o8('\x30' + chr(0b111011 + 0o64) + chr(564 - 515) + chr(50) + chr(2642 - 2590), 0o10), nzTpIcepk0o8('\060' + chr(8294 - 8183) + '\x32' + chr(50) + '\062', 8), nzTpIcepk0o8(chr(170 - 122) + chr(0b1010100 + 0o33) + chr(2229 - 2179) + '\x35' + chr(0b100111 + 0o17), ord("\x08")), nzTpIcepk0o8(chr(1496 - 1448) + chr(0b1101111) + chr(0b110100) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(1995 - 1947) + chr(111) + '\x32' + chr(50) + '\060', 0o10), nzTpIcepk0o8(chr(1948 - 1900) + chr(111) + chr(51) + '\064' + chr(0b110010 + 0o0), 11379 - 11371), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\x6f' + '\x32' + chr(0b11101 + 0o24) + chr(0b100010 + 0o20), 0o10), nzTpIcepk0o8('\x30' + chr(0b11001 + 0o126) + '\061' + chr(49) + chr(55), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b101100 + 0o103) + chr(0b110110) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b1011 + 0o47) + chr(50) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b101101 + 0o3) + chr(48), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(111) + '\x35' + chr(0b110000), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xae'), chr(0b1100100) + '\x65' + chr(0b10010 + 0o121) + chr(7838 - 7727) + chr(0b1100100) + '\145')(chr(7497 - 7380) + '\x74' + '\146' + '\x2d' + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def sOUs9vPzsy81():
CxOVg8j4LTAA = IroR776eItjV(Y2NpmGpFLmq8)
ClXnp8F8DXWB = aq5G797nr5uE(j8BVfRebt0ah)
roI3spqORKae(ClXnp8F8DXWB, roI3spqORKae(ES5oEprVxulp(b'\xf4\xcdZ\xec\x03'), '\144' + chr(0b1100100 + 0o1) + chr(0b1010001 + 0o22) + chr(0b1101000 + 0o7) + chr(100) + chr(101))(chr(0b1110101) + chr(6543 - 6427) + chr(5491 - 5389) + chr(269 - 224) + chr(0b111000)))(CxOVg8j4LTAA, sASOyidHhVR1)
|
estnltk/estnltk
|
estnltk/javaprocess.py
|
JavaProcess.process_line
|
def process_line(self, line):
"""Process a line of data.
Sends the data through the pipe to the process and flush it. Reads a resulting line
and returns it.
Parameters
----------
line: str
The data sent to process. Make sure it does not contain any newline characters.
Returns
-------
str: The line returned by the Java process
Raises
------
Exception
In case of EOF is encountered.
IoError
In case it was impossible to read or write from the subprocess standard input / output.
"""
assert isinstance(line, str)
try:
self._process.stdin.write(as_binary(line))
self._process.stdin.write(as_binary('\n'))
self._process.stdin.flush()
result = as_unicode(self._process.stdout.readline())
if result == '':
stderr = as_unicode(self._process.stderr.read())
raise Exception('EOF encountered while reading stream. Stderr is {0}.'.format(stderr))
return result
except Exception:
self._process.terminate()
raise
|
python
|
def process_line(self, line):
"""Process a line of data.
Sends the data through the pipe to the process and flush it. Reads a resulting line
and returns it.
Parameters
----------
line: str
The data sent to process. Make sure it does not contain any newline characters.
Returns
-------
str: The line returned by the Java process
Raises
------
Exception
In case of EOF is encountered.
IoError
In case it was impossible to read or write from the subprocess standard input / output.
"""
assert isinstance(line, str)
try:
self._process.stdin.write(as_binary(line))
self._process.stdin.write(as_binary('\n'))
self._process.stdin.flush()
result = as_unicode(self._process.stdout.readline())
if result == '':
stderr = as_unicode(self._process.stderr.read())
raise Exception('EOF encountered while reading stream. Stderr is {0}.'.format(stderr))
return result
except Exception:
self._process.terminate()
raise
|
[
"def",
"process_line",
"(",
"self",
",",
"line",
")",
":",
"assert",
"isinstance",
"(",
"line",
",",
"str",
")",
"try",
":",
"self",
".",
"_process",
".",
"stdin",
".",
"write",
"(",
"as_binary",
"(",
"line",
")",
")",
"self",
".",
"_process",
".",
"stdin",
".",
"write",
"(",
"as_binary",
"(",
"'\\n'",
")",
")",
"self",
".",
"_process",
".",
"stdin",
".",
"flush",
"(",
")",
"result",
"=",
"as_unicode",
"(",
"self",
".",
"_process",
".",
"stdout",
".",
"readline",
"(",
")",
")",
"if",
"result",
"==",
"''",
":",
"stderr",
"=",
"as_unicode",
"(",
"self",
".",
"_process",
".",
"stderr",
".",
"read",
"(",
")",
")",
"raise",
"Exception",
"(",
"'EOF encountered while reading stream. Stderr is {0}.'",
".",
"format",
"(",
"stderr",
")",
")",
"return",
"result",
"except",
"Exception",
":",
"self",
".",
"_process",
".",
"terminate",
"(",
")",
"raise"
] |
Process a line of data.
Sends the data through the pipe to the process and flush it. Reads a resulting line
and returns it.
Parameters
----------
line: str
The data sent to process. Make sure it does not contain any newline characters.
Returns
-------
str: The line returned by the Java process
Raises
------
Exception
In case of EOF is encountered.
IoError
In case it was impossible to read or write from the subprocess standard input / output.
|
[
"Process",
"a",
"line",
"of",
"data",
".",
"Sends",
"the",
"data",
"through",
"the",
"pipe",
"to",
"the",
"process",
"and",
"flush",
"it",
".",
"Reads",
"a",
"resulting",
"line",
"and",
"returns",
"it",
".",
"Parameters",
"----------",
"line",
":",
"str",
"The",
"data",
"sent",
"to",
"process",
".",
"Make",
"sure",
"it",
"does",
"not",
"contain",
"any",
"newline",
"characters",
".",
"Returns",
"-------",
"str",
":",
"The",
"line",
"returned",
"by",
"the",
"Java",
"process",
"Raises",
"------",
"Exception",
"In",
"case",
"of",
"EOF",
"is",
"encountered",
".",
"IoError",
"In",
"case",
"it",
"was",
"impossible",
"to",
"read",
"or",
"write",
"from",
"the",
"subprocess",
"standard",
"input",
"/",
"output",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/javaprocess.py#L52-L87
|
train
|
Process a line of data and return the line.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_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WcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(808 - 760) + '\x6f' + chr(0b110001) + '\060' + '\061', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(11794 - 11683) + chr(0b110010) + '\060', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x36', 2731 - 2723), nzTpIcepk0o8(chr(1988 - 1940) + chr(5514 - 5403) + chr(49) + chr(2235 - 2180) + '\x32', 0o10), nzTpIcepk0o8(chr(48) + chr(3001 - 2890) + '\x32' + chr(0b100100 + 0o22) + chr(0b110110), 0b1000), nzTpIcepk0o8('\060' + chr(7479 - 7368) + '\061' + chr(0b100 + 0o54) + chr(0b101001 + 0o11), 19682 - 19674), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(0b101010 + 0o13) + chr(103 - 54), 0b1000), nzTpIcepk0o8(chr(0b111 + 0o51) + '\157' + '\062' + chr(1275 - 1224) + chr(0b110010 + 0o0), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1001001 + 0o46) + chr(0b110011) + chr(0b101110 + 0o3) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(989 - 878) + chr(0b110011) + chr(1465 - 1412) + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + chr(1992 - 1943) + chr(55), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(4182 - 4071) + chr(0b10001 + 0o40) + chr(48) + '\x31', 8), nzTpIcepk0o8('\060' + chr(0b10101 + 0o132) + chr(53) + chr(53), 0o10), nzTpIcepk0o8(chr(783 - 735) + '\157' + '\x31' + chr(0b10011 + 0o42) + '\060', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + chr(0b111 + 0o57) + '\x33', 51991 - 51983), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + chr(0b1111 + 0o45) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + chr(2212 - 2161) + chr(0b1000 + 0o51), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111 + 0o0) + '\067' + chr(2186 - 2136), 13678 - 13670), nzTpIcepk0o8(chr(48) + chr(0b1011100 + 0o23) + chr(51) + chr(0b11011 + 0o25) + '\x35', 0b1000), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\157' + '\x32' + chr(0b110000) + chr(49), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x33' + '\x36' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(223 - 175) + '\157' + chr(0b110011) + chr(0b110010) + chr(0b101101 + 0o5), 43180 - 43172), nzTpIcepk0o8('\x30' + chr(0b110011 + 0o74) + '\x31' + '\x32' + '\061', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(52) + '\066', 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(111) + chr(0b110011) + chr(1286 - 1233) + '\x35', 0b1000), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(5688 - 5577) + chr(233 - 182) + chr(50) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(750 - 702) + chr(0b1101111) + '\061' + chr(48) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b1101111) + chr(0b11110 + 0o23) + chr(0b110000) + '\063', 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + '\062' + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2155 - 2104) + chr(268 - 218) + chr(53), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + '\x34' + chr(49), 13499 - 13491), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10000 + 0o42) + chr(48) + chr(930 - 882), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011), 35745 - 35737), nzTpIcepk0o8('\060' + chr(3252 - 3141) + '\x31' + chr(0b110100) + '\065', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(52), 49902 - 49894), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110 + 0o53) + '\061' + chr(0b10100 + 0o43), 8), nzTpIcepk0o8(chr(48) + chr(2439 - 2328) + chr(2089 - 2039) + chr(2302 - 2247) + chr(1021 - 967), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(53) + chr(0b110001), 8), nzTpIcepk0o8('\x30' + '\157' + chr(2072 - 2019) + '\x34', 0b1000), nzTpIcepk0o8(chr(751 - 703) + chr(339 - 228) + chr(2122 - 2071) + chr(0b110011) + chr(0b110001), 47892 - 47884)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1811 - 1763) + chr(0b100 + 0o153) + chr(0b110101) + '\x30', 61360 - 61352)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'o'), '\x64' + chr(492 - 391) + '\143' + chr(111) + '\144' + chr(0b1100101))(chr(117) + '\x74' + chr(0b100000 + 0o106) + chr(0b101101) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def fK_Zv0__o8Ww(hXMPsSrOQzbh, ffiOpFBWGmZU):
assert suIjIS24Zkqw(ffiOpFBWGmZU, N9zlRy29S1SS)
try:
roI3spqORKae(hXMPsSrOQzbh._process.stdin, roI3spqORKae(ES5oEprVxulp(b',|6\x12\xde2\xdf\xab\x85\x99>s'), '\x64' + '\x65' + chr(0b1100 + 0o127) + chr(0b1101111) + chr(100) + chr(7781 - 7680))(chr(117) + '\x74' + chr(0b1100110) + chr(0b101101 + 0o0) + chr(371 - 315)))(WixofJXhfY1S(ffiOpFBWGmZU))
roI3spqORKae(hXMPsSrOQzbh._process.stdin, roI3spqORKae(ES5oEprVxulp(b',|6\x12\xde2\xdf\xab\x85\x99>s'), chr(5617 - 5517) + '\x65' + chr(0b110 + 0o135) + '\x6f' + chr(0b1100100) + chr(9557 - 9456))(chr(2318 - 2201) + chr(0b101010 + 0o112) + chr(3708 - 3606) + chr(0b10001 + 0o34) + '\070'))(WixofJXhfY1S(roI3spqORKae(ES5oEprVxulp(b'K'), '\x64' + '\145' + chr(4465 - 4366) + chr(0b10100 + 0o133) + chr(0b1100100) + '\145')(chr(117) + '\x74' + chr(102) + chr(0b1100 + 0o41) + '\x38')))
roI3spqORKae(hXMPsSrOQzbh._process.stdin, roI3spqORKae(ES5oEprVxulp(b'*Gv\x03\xf40\xff\xcd\x8b\x99<\x04'), chr(0b1100100) + chr(0b1000100 + 0o41) + chr(2601 - 2502) + chr(0b1101111) + chr(100) + '\145')(chr(0b1110101) + chr(12538 - 12422) + chr(9069 - 8967) + chr(0b100101 + 0o10) + chr(0b111000)))()
POx95m7SPOVy = u0ecHgOJkfe8(hXMPsSrOQzbh._process.stdout.OCLst2IuJR_K())
if POx95m7SPOVy == roI3spqORKae(ES5oEprVxulp(b''), chr(4810 - 4710) + '\x65' + chr(0b1100011) + chr(1860 - 1749) + '\x64' + chr(0b1100101))(chr(6125 - 6008) + chr(5211 - 5095) + '\146' + '\055' + '\x38'):
oR3tAsnOApmF = u0ecHgOJkfe8(hXMPsSrOQzbh._process.stderr.eoXknH7XUn7m())
raise zfo2Sgkz3IVJ(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\x04_@Z\xd3,\xca\xf5\xbc\x87;$_\r\x17\x83nR\xac\xed\x90\xf2#C\x8c\xb7*-5\xf5\xd2\xf4q\x00e"\x90\x89\x7f\xad%ut\x08\x96+\xda\xba\xb2\xd92o'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(7798 - 7687) + '\144' + chr(0b1100101))(chr(9605 - 9488) + chr(116) + chr(0b1100110) + '\x2d' + '\x38'), roI3spqORKae(ES5oEprVxulp(b'0#51\xf1q\xcf\xf5\x98\xb6\x0c\x0b'), chr(9947 - 9847) + chr(3456 - 3355) + chr(99) + chr(111) + '\144' + '\x65')(chr(0b100000 + 0o125) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(0b111000)))(oR3tAsnOApmF))
return POx95m7SPOVy
except zfo2Sgkz3IVJ:
roI3spqORKae(hXMPsSrOQzbh._process, roI3spqORKae(ES5oEprVxulp(b'5ut\x17\xdf,\xc8\xee\xac'), chr(100) + chr(0b1010111 + 0o16) + '\143' + '\157' + chr(8476 - 8376) + '\x65')(chr(0b1110101) + '\164' + chr(102) + '\055' + '\x38'))()
raise
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
_get_synset_offsets
|
def _get_synset_offsets(synset_idxes):
"""Returs pointer offset in the WordNet file for every synset index.
Notes
-----
Internal function. Do not call directly.
Preserves order -- for [x,y,z] returns [offset(x),offset(y),offset(z)].
Parameters
----------
synset_idxes : list of ints
Lists synset IDs, which need offset.
Returns
-------
list of ints
Lists pointer offsets in Wordnet file.
"""
offsets = {}
current_seeked_offset_idx = 0
ordered_synset_idxes = sorted(synset_idxes)
with codecs.open(_SOI,'rb', 'utf-8') as fin:
for line in fin:
split_line = line.split(':')
while current_seeked_offset_idx < len(ordered_synset_idxes) and split_line[0] == str(ordered_synset_idxes[current_seeked_offset_idx]):
# Looping on single line entries in case synset_indexes contains duplicates.
offsets[synset_idxes[current_seeked_offset_idx]] = int(split_line[1])
current_seeked_offset_idx += 1
if current_seeked_offset_idx >= len(synset_idxes):
break
return [offsets[synset_idx] for synset_idx in synset_idxes]
|
python
|
def _get_synset_offsets(synset_idxes):
"""Returs pointer offset in the WordNet file for every synset index.
Notes
-----
Internal function. Do not call directly.
Preserves order -- for [x,y,z] returns [offset(x),offset(y),offset(z)].
Parameters
----------
synset_idxes : list of ints
Lists synset IDs, which need offset.
Returns
-------
list of ints
Lists pointer offsets in Wordnet file.
"""
offsets = {}
current_seeked_offset_idx = 0
ordered_synset_idxes = sorted(synset_idxes)
with codecs.open(_SOI,'rb', 'utf-8') as fin:
for line in fin:
split_line = line.split(':')
while current_seeked_offset_idx < len(ordered_synset_idxes) and split_line[0] == str(ordered_synset_idxes[current_seeked_offset_idx]):
# Looping on single line entries in case synset_indexes contains duplicates.
offsets[synset_idxes[current_seeked_offset_idx]] = int(split_line[1])
current_seeked_offset_idx += 1
if current_seeked_offset_idx >= len(synset_idxes):
break
return [offsets[synset_idx] for synset_idx in synset_idxes]
|
[
"def",
"_get_synset_offsets",
"(",
"synset_idxes",
")",
":",
"offsets",
"=",
"{",
"}",
"current_seeked_offset_idx",
"=",
"0",
"ordered_synset_idxes",
"=",
"sorted",
"(",
"synset_idxes",
")",
"with",
"codecs",
".",
"open",
"(",
"_SOI",
",",
"'rb'",
",",
"'utf-8'",
")",
"as",
"fin",
":",
"for",
"line",
"in",
"fin",
":",
"split_line",
"=",
"line",
".",
"split",
"(",
"':'",
")",
"while",
"current_seeked_offset_idx",
"<",
"len",
"(",
"ordered_synset_idxes",
")",
"and",
"split_line",
"[",
"0",
"]",
"==",
"str",
"(",
"ordered_synset_idxes",
"[",
"current_seeked_offset_idx",
"]",
")",
":",
"# Looping on single line entries in case synset_indexes contains duplicates.",
"offsets",
"[",
"synset_idxes",
"[",
"current_seeked_offset_idx",
"]",
"]",
"=",
"int",
"(",
"split_line",
"[",
"1",
"]",
")",
"current_seeked_offset_idx",
"+=",
"1",
"if",
"current_seeked_offset_idx",
">=",
"len",
"(",
"synset_idxes",
")",
":",
"break",
"return",
"[",
"offsets",
"[",
"synset_idx",
"]",
"for",
"synset_idx",
"in",
"synset_idxes",
"]"
] |
Returs pointer offset in the WordNet file for every synset index.
Notes
-----
Internal function. Do not call directly.
Preserves order -- for [x,y,z] returns [offset(x),offset(y),offset(z)].
Parameters
----------
synset_idxes : list of ints
Lists synset IDs, which need offset.
Returns
-------
list of ints
Lists pointer offsets in Wordnet file.
|
[
"Returs",
"pointer",
"offset",
"in",
"the",
"WordNet",
"file",
"for",
"every",
"synset",
"index",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L53-L88
|
train
|
Returns the offsets in the WordNet file for every synset index.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6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lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\x6f' + chr(0b101111 + 0o3) + chr(0b110100) + chr(0b101111 + 0o7), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110110) + chr(0b10001 + 0o43), 33176 - 33168), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111) + '\x33' + chr(0b110010) + chr(0b11111 + 0o24), 0b1000), nzTpIcepk0o8('\060' + chr(4975 - 4864) + chr(50) + chr(0b110101) + chr(0b101 + 0o55), 7346 - 7338), nzTpIcepk0o8(chr(0b110000) + chr(11599 - 11488) + '\062' + '\x32' + '\x32', 50816 - 50808), nzTpIcepk0o8(chr(0b110000) + chr(0b101110 + 0o101) + chr(49) + '\062' + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(2298 - 2250) + chr(0b1101111) + chr(49) + chr(0b110110) + '\063', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + chr(1401 - 1352) + '\062', 0o10), nzTpIcepk0o8('\x30' + chr(0b1011111 + 0o20) + chr(51) + chr(0b100001 + 0o24) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101101 + 0o4) + chr(0b11110 + 0o25) + chr(0b1100 + 0o52), 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(111) + '\x33' + chr(2455 - 2405) + chr(1340 - 1290), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1010101 + 0o32) + chr(1951 - 1900) + chr(51) + chr(787 - 733), ord("\x08")), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b10000 + 0o137) + chr(49) + chr(50) + chr(0b11101 + 0o32), 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b10001 + 0o136) + chr(0b110001) + chr(0b110011) + '\064', 0o10), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(0b1101111) + '\063' + '\x35' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(404 - 350) + '\064', 8), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(3186 - 3075) + chr(1567 - 1513) + chr(0b100001 + 0o21), 25443 - 25435), nzTpIcepk0o8('\060' + chr(9156 - 9045) + chr(0b10011 + 0o40) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1857 - 1808) + '\x31' + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + chr(48) + chr(0b10100 + 0o40), 53123 - 53115), nzTpIcepk0o8('\x30' + chr(866 - 755) + '\062' + chr(1441 - 1389) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(11952 - 11841) + chr(49) + chr(48) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(111) + '\064' + chr(0b101000 + 0o17), 0o10), nzTpIcepk0o8(chr(2032 - 1984) + '\x6f' + '\x31', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(0b11101 + 0o32) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(9024 - 8913) + '\x32' + chr(54) + chr(0b11001 + 0o36), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1508 - 1456) + chr(225 - 175), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x35' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(455 - 407) + chr(9387 - 9276) + '\063' + chr(2065 - 2016) + chr(51), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(2268 - 2217) + chr(49) + chr(1718 - 1664), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + '\x36' + '\065', 0o10), nzTpIcepk0o8(chr(48) + chr(0b10000 + 0o137) + '\063' + '\x35', 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\063', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(0b110101) + chr(477 - 425), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + '\061' + chr(0b11111 + 0o24), 24590 - 24582), nzTpIcepk0o8(chr(1881 - 1833) + '\x6f' + chr(0b110 + 0o57) + chr(2327 - 2278), ord("\x08")), nzTpIcepk0o8(chr(1478 - 1430) + '\157' + '\061' + chr(0b110001) + chr(49), 8), nzTpIcepk0o8('\x30' + chr(6910 - 6799) + chr(50) + '\061' + chr(0b1111 + 0o45), 3325 - 3317), nzTpIcepk0o8(chr(231 - 183) + '\x6f' + chr(555 - 504) + chr(0b110010) + '\062', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(6661 - 6550) + chr(0b110101) + '\x30', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x88'), '\144' + chr(845 - 744) + chr(0b1100011) + '\x6f' + '\144' + '\x65')('\165' + chr(2810 - 2694) + chr(0b100000 + 0o106) + chr(0b101101) + chr(298 - 242)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def ozXqxlnptchw(D1oeKM_CDI_d):
HQzjzS6A_S7y = {}
GqzeJtpVdHFZ = nzTpIcepk0o8(chr(48) + chr(3915 - 3804) + '\x30', 2598 - 2590)
Pw0QH2oCgU4W = V3OlOVg98A85(D1oeKM_CDI_d)
with roI3spqORKae(Hj8X5RtMNBIn, roI3spqORKae(ES5oEprVxulp(b'\xe2Z\x86\x99\xc0"J\x84\xdd?\xbe\xbf'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1101111) + '\x64' + '\145')(chr(117) + chr(116) + '\x66' + chr(45) + '\070'))(Mg6jnirMos0f, roI3spqORKae(ES5oEprVxulp(b'\xd4V'), chr(0b101011 + 0o71) + '\145' + '\x63' + '\157' + '\x64' + chr(0b1100 + 0o131))('\x75' + '\x74' + '\x66' + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xd3@\xb5\x87\xaa'), chr(3176 - 3076) + chr(101) + '\143' + chr(0b1100000 + 0o17) + chr(0b1100100) + '\145')(chr(0b1011111 + 0o26) + '\164' + chr(234 - 132) + chr(1417 - 1372) + '\x38')) as E8Pmqk8kxnzp:
for ffiOpFBWGmZU in E8Pmqk8kxnzp:
PAXWBYcIZQxU = ffiOpFBWGmZU.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'\x9c'), chr(245 - 145) + '\x65' + '\x63' + chr(0b1101111) + chr(0b1100100) + '\145')('\x75' + chr(0b10111 + 0o135) + '\146' + chr(0b101101) + chr(0b111000)))
while GqzeJtpVdHFZ < ftfygxgFas5X(Pw0QH2oCgU4W) and PAXWBYcIZQxU[nzTpIcepk0o8('\x30' + chr(0b1001000 + 0o47) + chr(0b10010 + 0o36), 8)] == N9zlRy29S1SS(Pw0QH2oCgU4W[GqzeJtpVdHFZ]):
HQzjzS6A_S7y[D1oeKM_CDI_d[GqzeJtpVdHFZ]] = nzTpIcepk0o8(PAXWBYcIZQxU[nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111) + chr(234 - 185), 8)])
GqzeJtpVdHFZ += nzTpIcepk0o8(chr(1752 - 1704) + chr(111) + chr(0b1001 + 0o50), 8)
if GqzeJtpVdHFZ >= ftfygxgFas5X(D1oeKM_CDI_d):
break
return [HQzjzS6A_S7y[uifrrAlEn5Lr] for uifrrAlEn5Lr in D1oeKM_CDI_d]
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
_get_synsets
|
def _get_synsets(synset_offsets):
"""Given synset offsets in the WordNet file, parses synset object for every offset.
Notes
-----
Internal function. Do not call directly.
Stores every parsed synset into global synset dictionary under two keys:
synset's name lemma.pos.sense_no and synset's id (unique integer).
Parameters
----------
synset_offsets : list of ints
Lists pointer offsets from which synset objects will be parsed.
Returns
-------
list of Synsets
Lists synset objects which synset_offsets point to.
"""
global parser
if parser is None:
parser = Parser(_WN_FILE)
synsets = []
for offset in synset_offsets:
raw_synset = parser.parse_synset(offset)
synset = Synset(raw_synset)
SYNSETS_DICT[_get_key_from_raw_synset(raw_synset)] = synset
SYNSETS_DICT[synset.id] = synset
synsets.append(synset)
return synsets
|
python
|
def _get_synsets(synset_offsets):
"""Given synset offsets in the WordNet file, parses synset object for every offset.
Notes
-----
Internal function. Do not call directly.
Stores every parsed synset into global synset dictionary under two keys:
synset's name lemma.pos.sense_no and synset's id (unique integer).
Parameters
----------
synset_offsets : list of ints
Lists pointer offsets from which synset objects will be parsed.
Returns
-------
list of Synsets
Lists synset objects which synset_offsets point to.
"""
global parser
if parser is None:
parser = Parser(_WN_FILE)
synsets = []
for offset in synset_offsets:
raw_synset = parser.parse_synset(offset)
synset = Synset(raw_synset)
SYNSETS_DICT[_get_key_from_raw_synset(raw_synset)] = synset
SYNSETS_DICT[synset.id] = synset
synsets.append(synset)
return synsets
|
[
"def",
"_get_synsets",
"(",
"synset_offsets",
")",
":",
"global",
"parser",
"if",
"parser",
"is",
"None",
":",
"parser",
"=",
"Parser",
"(",
"_WN_FILE",
")",
"synsets",
"=",
"[",
"]",
"for",
"offset",
"in",
"synset_offsets",
":",
"raw_synset",
"=",
"parser",
".",
"parse_synset",
"(",
"offset",
")",
"synset",
"=",
"Synset",
"(",
"raw_synset",
")",
"SYNSETS_DICT",
"[",
"_get_key_from_raw_synset",
"(",
"raw_synset",
")",
"]",
"=",
"synset",
"SYNSETS_DICT",
"[",
"synset",
".",
"id",
"]",
"=",
"synset",
"synsets",
".",
"append",
"(",
"synset",
")",
"return",
"synsets"
] |
Given synset offsets in the WordNet file, parses synset object for every offset.
Notes
-----
Internal function. Do not call directly.
Stores every parsed synset into global synset dictionary under two keys:
synset's name lemma.pos.sense_no and synset's id (unique integer).
Parameters
----------
synset_offsets : list of ints
Lists pointer offsets from which synset objects will be parsed.
Returns
-------
list of Synsets
Lists synset objects which synset_offsets point to.
|
[
"Given",
"synset",
"offsets",
"in",
"the",
"WordNet",
"file",
"parses",
"synset",
"object",
"for",
"every",
"offset",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L90-L124
|
train
|
Given a list of offsets in the WordNet file parses each synset object for every offset and stores it in the global dictionary.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,K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Rngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b1001 + 0o146) + chr(0b110011) + chr(0b110001) + chr(578 - 528), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10011 + 0o37) + '\067' + chr(0b110101), 29175 - 29167), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + chr(0b100000 + 0o20) + '\064', ord("\x08")), nzTpIcepk0o8(chr(1686 - 1638) + '\x6f' + '\x32' + chr(53) + '\x33', 0o10), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(111) + chr(0b110010) + '\061' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b101010 + 0o6) + '\157' + '\061' + '\x34' + chr(305 - 256), 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\x6f' + chr(2383 - 2333) + '\x35' + chr(0b10000 + 0o44), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\061' + '\063' + '\062', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b11101 + 0o24) + chr(0b101 + 0o56) + '\061', ord("\x08")), nzTpIcepk0o8('\x30' + chr(11704 - 11593) + '\061' + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1965 - 1914) + chr(0b110101) + '\061', 8356 - 8348), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x33' + chr(55) + chr(51), 21012 - 21004), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(3697 - 3586) + '\062' + '\062' + '\061', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(1889 - 1839) + '\061', ord("\x08")), nzTpIcepk0o8(chr(1520 - 1472) + chr(0b1010111 + 0o30) + chr(0b110010) + chr(2123 - 2068), 62914 - 62906), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + '\067' + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + chr(1323 - 1268) + chr(0b11010 + 0o26), 31692 - 31684), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(55) + chr(1291 - 1243), 8), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1101111) + chr(0b110110) + '\x34', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b10000 + 0o42) + chr(0b110101) + chr(0b100001 + 0o24), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(51) + '\x32' + chr(0b11010 + 0o27), 8), nzTpIcepk0o8(chr(48) + chr(9637 - 9526) + '\x33' + chr(0b110100) + '\066', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\061' + chr(0b1100 + 0o51) + chr(0b101 + 0o54), 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1010011 + 0o34) + chr(51) + chr(0b110101) + chr(55), 0o10), nzTpIcepk0o8('\x30' + chr(2138 - 2027) + chr(58 - 9) + chr(52) + chr(0b10100 + 0o35), 8), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + chr(0b11000 + 0o35) + chr(55), 55232 - 55224), nzTpIcepk0o8('\060' + chr(111) + '\062' + '\x36' + chr(49), 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\157' + chr(0b1100 + 0o51) + chr(54), 0o10), nzTpIcepk0o8(chr(856 - 808) + chr(111) + chr(1222 - 1170) + '\x34', 30857 - 30849), nzTpIcepk0o8('\x30' + '\x6f' + chr(1113 - 1063) + chr(903 - 848) + chr(51), 0b1000), nzTpIcepk0o8('\x30' + chr(0b111011 + 0o64) + chr(0b110101) + chr(54), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x33' + chr(0b11 + 0o64) + chr(0b110001 + 0o5), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(733 - 682) + chr(1887 - 1832) + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1030 - 980) + '\065' + '\064', 8), nzTpIcepk0o8(chr(1369 - 1321) + chr(0b1101111) + '\x33' + chr(0b1 + 0o62) + chr(0b1011 + 0o53), 38241 - 38233), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\157' + chr(51) + '\062' + chr(50), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1001 + 0o52) + chr(51) + '\x30', 38029 - 38021), nzTpIcepk0o8('\060' + chr(2760 - 2649) + '\x31' + '\x30' + chr(0b110110), 16106 - 16098), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + chr(49) + chr(783 - 731), 23513 - 23505)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + '\065' + chr(0b10 + 0o56), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe4'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(12285 - 12174) + chr(100) + '\x65')(chr(117) + chr(9455 - 9339) + chr(0b1100110) + chr(0b0 + 0o55) + chr(1956 - 1900)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Ahh8lhmTsQQL(WlRV4D6EkSOO):
global ELQLGvoVr2Z_
if ELQLGvoVr2Z_ is None:
ELQLGvoVr2Z_ = Jny8t9tNuyse(JXb6Pm121vHe)
aasVOJCZfJgh = []
for GuX46MBAOnaQ in WlRV4D6EkSOO:
bWGMercXo95v = ELQLGvoVr2Z_.parse_synset(GuX46MBAOnaQ)
J7DVXYlVh6vo = C2KP3A3adZzY(bWGMercXo95v)
vrjEypvW__W4[VD1zkizP4nvh(bWGMercXo95v)] = J7DVXYlVh6vo
vrjEypvW__W4[J7DVXYlVh6vo.maLnLg8O5zPT] = J7DVXYlVh6vo
roI3spqORKae(aasVOJCZfJgh, roI3spqORKae(ES5oEprVxulp(b'\x82\xe9\xd7\x9f\xf6e&\xc306\\\xdc'), chr(5641 - 5541) + chr(6167 - 6066) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(4765 - 4664))(chr(117) + chr(0b10001 + 0o143) + '\x66' + '\055' + '\x38'))(J7DVXYlVh6vo)
return aasVOJCZfJgh
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
_get_key_from_raw_synset
|
def _get_key_from_raw_synset(raw_synset):
"""Derives synset key in the form of `lemma.pos.sense_no` from the provided eurown.py Synset class,
Notes
-----
Internal function. Do not call directly.
Parameters
----------
raw_synset : eurown.Synset
Synset representation from which lemma, part-of-speech and sense is derived.
Returns
-------
string
Key of the synset in the form of `lemma.pos.sense_no`.
"""
pos = raw_synset.pos
literal = raw_synset.variants[0].literal
sense = "%02d"%raw_synset.variants[0].sense
return '.'.join([literal,pos,sense])
|
python
|
def _get_key_from_raw_synset(raw_synset):
"""Derives synset key in the form of `lemma.pos.sense_no` from the provided eurown.py Synset class,
Notes
-----
Internal function. Do not call directly.
Parameters
----------
raw_synset : eurown.Synset
Synset representation from which lemma, part-of-speech and sense is derived.
Returns
-------
string
Key of the synset in the form of `lemma.pos.sense_no`.
"""
pos = raw_synset.pos
literal = raw_synset.variants[0].literal
sense = "%02d"%raw_synset.variants[0].sense
return '.'.join([literal,pos,sense])
|
[
"def",
"_get_key_from_raw_synset",
"(",
"raw_synset",
")",
":",
"pos",
"=",
"raw_synset",
".",
"pos",
"literal",
"=",
"raw_synset",
".",
"variants",
"[",
"0",
"]",
".",
"literal",
"sense",
"=",
"\"%02d\"",
"%",
"raw_synset",
".",
"variants",
"[",
"0",
"]",
".",
"sense",
"return",
"'.'",
".",
"join",
"(",
"[",
"literal",
",",
"pos",
",",
"sense",
"]",
")"
] |
Derives synset key in the form of `lemma.pos.sense_no` from the provided eurown.py Synset class,
Notes
-----
Internal function. Do not call directly.
Parameters
----------
raw_synset : eurown.Synset
Synset representation from which lemma, part-of-speech and sense is derived.
Returns
-------
string
Key of the synset in the form of `lemma.pos.sense_no`.
|
[
"Derives",
"synset",
"key",
"in",
"the",
"form",
"of",
"lemma",
".",
"pos",
".",
"sense_no",
"from",
"the",
"provided",
"eurown",
".",
"py",
"Synset",
"class"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L126-L148
|
train
|
Derives synset key from the provided eurown. py Synset object.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,T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IptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b1001 + 0o47) + '\157' + chr(0b10000 + 0o41) + '\063' + chr(0b11001 + 0o32), 0o10), nzTpIcepk0o8('\060' + chr(11079 - 10968) + chr(2279 - 2230) + '\x35' + chr(364 - 314), 0o10), nzTpIcepk0o8('\060' + chr(2454 - 2343) + '\x31' + chr(55) + chr(109 - 61), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(6627 - 6516) + chr(317 - 267) + '\064' + '\065', 49439 - 49431), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(111) + chr(0b110001) + '\060' + chr(2088 - 2036), 0o10), nzTpIcepk0o8(chr(48) + chr(10432 - 10321) + chr(1473 - 1424) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b100110 + 0o15) + '\x35' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b110001 + 0o1) + chr(0b10011 + 0o40) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(48) + chr(7859 - 7748) + chr(50) + '\065' + chr(0b110101), 13322 - 13314), nzTpIcepk0o8('\x30' + chr(1433 - 1322) + '\x31' + chr(50) + '\067', 0o10), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1000111 + 0o50) + '\063' + chr(54), 11928 - 11920), nzTpIcepk0o8('\x30' + chr(0b11001 + 0o126) + chr(0b110001) + chr(0b100 + 0o61) + chr(48), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(194 - 139) + chr(282 - 234), 0o10), nzTpIcepk0o8(chr(447 - 399) + chr(111) + '\061' + chr(0b110001 + 0o4) + chr(433 - 378), 0b1000), nzTpIcepk0o8(chr(861 - 813) + chr(3722 - 3611) + chr(0b11110 + 0o24) + chr(0b110010) + '\x31', 0o10), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b101011 + 0o104) + chr(1680 - 1630) + '\065' + '\067', 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\x6f' + '\061' + chr(52) + chr(0b101100 + 0o12), 0b1000), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(1887 - 1776) + '\x35' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b10110 + 0o131) + chr(919 - 869) + chr(0b1011 + 0o53) + '\067', ord("\x08")), nzTpIcepk0o8(chr(1012 - 964) + chr(8311 - 8200) + chr(0b100110 + 0o13) + '\062' + chr(0b11100 + 0o31), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(11940 - 11829) + '\x32' + chr(2961 - 2906) + chr(0b10011 + 0o43), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b10010 + 0o135) + chr(818 - 766) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(1313 - 1265) + chr(111) + chr(997 - 946) + '\062' + '\063', 0b1000), nzTpIcepk0o8(chr(2281 - 2233) + chr(111) + chr(51) + '\x35' + chr(54), 0o10), nzTpIcepk0o8('\060' + chr(3907 - 3796) + '\062' + chr(0b1000 + 0o53) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b111111 + 0o60) + chr(505 - 455) + chr(0b1001 + 0o56) + chr(1493 - 1443), 0b1000), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(111) + chr(0b1110 + 0o45) + chr(2504 - 2451), 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b100000 + 0o117) + chr(0b100111 + 0o13) + chr(0b110010) + '\061', 8), nzTpIcepk0o8('\060' + '\157' + chr(834 - 783) + '\063' + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1000 + 0o147) + chr(49) + '\061' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101110 + 0o1) + '\x33' + '\x31' + chr(50), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + '\x36' + '\063', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + '\x34' + '\x30', 0o10), nzTpIcepk0o8(chr(1014 - 966) + '\157' + chr(1603 - 1552) + chr(48) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101110 + 0o1) + chr(49) + '\x33' + chr(128 - 73), 37133 - 37125), nzTpIcepk0o8(chr(2298 - 2250) + chr(7820 - 7709) + '\x37' + chr(53), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1001011 + 0o44) + chr(900 - 849) + '\066' + chr(0b110001), 0b1000), nzTpIcepk0o8('\x30' + chr(6736 - 6625) + chr(853 - 801) + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b111100 + 0o63) + chr(0b101001 + 0o12) + '\063' + chr(1351 - 1298), 50043 - 50035), nzTpIcepk0o8(chr(48) + '\157' + '\062' + chr(0b10010 + 0o42) + '\061', 53295 - 53287)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(2081 - 2033) + '\x6f' + chr(53) + chr(76 - 28), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'u'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(111) + '\144' + chr(0b1101 + 0o130))('\165' + '\164' + '\146' + chr(0b101101) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def VD1zkizP4nvh(bWGMercXo95v):
IGIA_fu6MbaO = bWGMercXo95v.IGIA_fu6MbaO
X3P1ldd3u8Bq = bWGMercXo95v.variants[nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b11111 + 0o120) + chr(0b110000), ord("\x08"))].X3P1ldd3u8Bq
RuooByRLpjag = roI3spqORKae(ES5oEprVxulp(b'~ZJ\xc1'), chr(9283 - 9183) + chr(0b1100101) + '\143' + chr(0b1100110 + 0o11) + chr(0b10110 + 0o116) + chr(0b1011000 + 0o15))(chr(11378 - 11261) + '\x74' + chr(2556 - 2454) + chr(0b100010 + 0o13) + chr(0b111000)) % bWGMercXo95v.variants[nzTpIcepk0o8('\060' + chr(0b1011010 + 0o25) + chr(0b110000), 8)].sense
return roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'u'), chr(0b1100100) + chr(9192 - 9091) + '\x63' + '\x6f' + chr(0b1100100 + 0o0) + '\x65')('\x75' + chr(0b1001 + 0o153) + '\146' + '\055' + chr(532 - 476)), roI3spqORKae(ES5oEprVxulp(b'\x02^\x01\xe8}I\x8c\xfd\xf9\x14P\x19'), '\x64' + chr(0b1100101) + '\143' + '\x6f' + chr(0b1010010 + 0o22) + chr(0b1011001 + 0o14))(chr(10931 - 10814) + chr(0b11100 + 0o130) + chr(0b1100110) + '\x2d' + chr(3077 - 3021)))([X3P1ldd3u8Bq, IGIA_fu6MbaO, RuooByRLpjag])
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
synset
|
def synset(synset_key):
"""Returns synset object with the provided key.
Notes
-----
Uses lazy initialization - synsets will be fetched from a dictionary after the first request.
Parameters
----------
synset_key : string
Unique synset identifier in the form of `lemma.pos.sense_no`.
Returns
-------
Synset
Synset with key `synset_key`.
None, if no match was found.
"""
if synset_key in SYNSETS_DICT:
return SYNSETS_DICT[synset_key]
def _get_synset_idx(synset_key):
"""Returns synset index for the provided key.
Note
----
Internal function. Do not call directly.
"""
with codecs.open(_SENSE_FILE,'rb', 'utf-8') as fin:
for line in fin:
split_line = line.split(':')
if split_line[0] == synset_key:
return int(split_line[1].strip())
return None
synset_idx = _get_synset_idx(synset_key)
if synset_idx == None:
return None
synset_offset = _get_synset_offsets([synset_idx])
synset = _get_synsets(synset_offset)
return synset[0]
|
python
|
def synset(synset_key):
"""Returns synset object with the provided key.
Notes
-----
Uses lazy initialization - synsets will be fetched from a dictionary after the first request.
Parameters
----------
synset_key : string
Unique synset identifier in the form of `lemma.pos.sense_no`.
Returns
-------
Synset
Synset with key `synset_key`.
None, if no match was found.
"""
if synset_key in SYNSETS_DICT:
return SYNSETS_DICT[synset_key]
def _get_synset_idx(synset_key):
"""Returns synset index for the provided key.
Note
----
Internal function. Do not call directly.
"""
with codecs.open(_SENSE_FILE,'rb', 'utf-8') as fin:
for line in fin:
split_line = line.split(':')
if split_line[0] == synset_key:
return int(split_line[1].strip())
return None
synset_idx = _get_synset_idx(synset_key)
if synset_idx == None:
return None
synset_offset = _get_synset_offsets([synset_idx])
synset = _get_synsets(synset_offset)
return synset[0]
|
[
"def",
"synset",
"(",
"synset_key",
")",
":",
"if",
"synset_key",
"in",
"SYNSETS_DICT",
":",
"return",
"SYNSETS_DICT",
"[",
"synset_key",
"]",
"def",
"_get_synset_idx",
"(",
"synset_key",
")",
":",
"\"\"\"Returns synset index for the provided key.\n\n Note\n ----\n Internal function. Do not call directly.\n\n \"\"\"",
"with",
"codecs",
".",
"open",
"(",
"_SENSE_FILE",
",",
"'rb'",
",",
"'utf-8'",
")",
"as",
"fin",
":",
"for",
"line",
"in",
"fin",
":",
"split_line",
"=",
"line",
".",
"split",
"(",
"':'",
")",
"if",
"split_line",
"[",
"0",
"]",
"==",
"synset_key",
":",
"return",
"int",
"(",
"split_line",
"[",
"1",
"]",
".",
"strip",
"(",
")",
")",
"return",
"None",
"synset_idx",
"=",
"_get_synset_idx",
"(",
"synset_key",
")",
"if",
"synset_idx",
"==",
"None",
":",
"return",
"None",
"synset_offset",
"=",
"_get_synset_offsets",
"(",
"[",
"synset_idx",
"]",
")",
"synset",
"=",
"_get_synsets",
"(",
"synset_offset",
")",
"return",
"synset",
"[",
"0",
"]"
] |
Returns synset object with the provided key.
Notes
-----
Uses lazy initialization - synsets will be fetched from a dictionary after the first request.
Parameters
----------
synset_key : string
Unique synset identifier in the form of `lemma.pos.sense_no`.
Returns
-------
Synset
Synset with key `synset_key`.
None, if no match was found.
|
[
"Returns",
"synset",
"object",
"with",
"the",
"provided",
"key",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L150-L196
|
train
|
Returns a synset object with the provided key.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,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x8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(111) + '\x33' + '\x37', 23982 - 23974), nzTpIcepk0o8('\x30' + chr(2407 - 2296) + chr(631 - 581) + chr(0b110011) + chr(817 - 764), 38133 - 38125), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\157' + chr(50) + chr(54) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(51) + '\065', 0o10), nzTpIcepk0o8(chr(1080 - 1032) + chr(111) + chr(0b11000 + 0o32) + '\063' + '\063', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110000 + 0o3) + chr(0b110100) + chr(48), 61492 - 61484), nzTpIcepk0o8(chr(48) + chr(11821 - 11710) + '\x32' + chr(0b110001) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(111) + chr(51) + chr(2980 - 2925) + chr(0b110100), 21945 - 21937), nzTpIcepk0o8(chr(1604 - 1556) + chr(0b1000010 + 0o55) + chr(49) + chr(0b101 + 0o55) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(2059 - 2011) + chr(0b1101111) + chr(381 - 326) + chr(0b100001 + 0o20), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(50) + chr(256 - 207), 48281 - 48273), nzTpIcepk0o8(chr(48) + '\157' + chr(0b10111 + 0o33) + '\x37', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b1001 + 0o51) + '\067' + chr(48), 0o10), nzTpIcepk0o8(chr(1797 - 1749) + chr(0b1011111 + 0o20) + chr(0b110011) + chr(0b100111 + 0o11) + chr(0b10100 + 0o42), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(808 - 758) + chr(50), 28301 - 28293), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(0b1010010 + 0o35) + chr(0b110010) + chr(2100 - 2045) + chr(0b110110), 0b1000), nzTpIcepk0o8('\x30' + chr(5470 - 5359) + '\x32' + chr(49) + '\062', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b10011 + 0o40) + '\062' + chr(48), 0b1000), nzTpIcepk0o8(chr(916 - 868) + '\x6f' + chr(51) + chr(0b100 + 0o63) + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + chr(9177 - 9066) + chr(329 - 274) + chr(0b110011), 0b1000), nzTpIcepk0o8('\x30' + chr(0b101110 + 0o101) + '\x32' + chr(0b100001 + 0o20) + chr(50), 8), nzTpIcepk0o8(chr(0b110000) + chr(7408 - 7297) + chr(0b101001 + 0o12) + chr(55) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110110) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(701 - 653) + '\157' + chr(1323 - 1272) + '\x34' + chr(0b1101 + 0o52), 0b1000), nzTpIcepk0o8(chr(571 - 523) + chr(0b1101111) + chr(50) + chr(0b10101 + 0o35) + chr(2079 - 2030), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b101100 + 0o6) + chr(53) + '\061', ord("\x08")), nzTpIcepk0o8('\060' + chr(2790 - 2679) + chr(222 - 171) + chr(84 - 29) + chr(0b11011 + 0o31), 8), nzTpIcepk0o8(chr(0b11111 + 0o21) + '\x6f' + chr(0b110010) + chr(0b11100 + 0o25) + chr(0b110000), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + chr(1323 - 1274) + chr(0b110000), 47727 - 47719), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b1101111) + '\x32' + '\x32', 8), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(939 - 890) + chr(48) + '\x32', ord("\x08")), nzTpIcepk0o8('\x30' + chr(5521 - 5410) + '\x33' + chr(1126 - 1078) + chr(0b100 + 0o55), 0o10), nzTpIcepk0o8('\x30' + chr(5043 - 4932) + chr(50) + chr(0b110100) + chr(0b1011 + 0o46), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1010010 + 0o35) + chr(0b110111) + '\067', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(8046 - 7935) + chr(49) + '\x31' + '\067', 0o10), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(111) + chr(49) + chr(0b11 + 0o61) + chr(0b101011 + 0o5), 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + '\157' + '\x32' + chr(0b110001) + chr(0b110010), 8), nzTpIcepk0o8('\x30' + chr(1083 - 972) + chr(0b110011) + chr(52) + chr(2036 - 1984), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\063' + '\060' + chr(180 - 130), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + chr(0b101000 + 0o10) + chr(50), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1111 + 0o46) + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'1'), '\144' + chr(101) + chr(7918 - 7819) + chr(0b1001011 + 0o44) + chr(100) + '\145')(chr(8611 - 8494) + chr(385 - 269) + chr(102) + chr(0b101101) + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def J7DVXYlVh6vo(d9gWGDfFIt43):
if d9gWGDfFIt43 in vrjEypvW__W4:
return vrjEypvW__W4[d9gWGDfFIt43]
def HWFRkDKKQ7LY(d9gWGDfFIt43):
with roI3spqORKae(Hj8X5RtMNBIn, roI3spqORKae(ES5oEprVxulp(b'[\xf3\xe3n\xc9\x91\xb4\xb2fX\xbdv'), chr(0b1100100) + chr(3529 - 3428) + chr(0b1100011) + '\157' + chr(100) + chr(566 - 465))('\165' + '\164' + chr(0b1100110) + chr(0b101101 + 0o0) + chr(56)))(JYz1euZp_5GL, roI3spqORKae(ES5oEprVxulp(b'm\xff'), chr(8570 - 8470) + chr(101) + chr(763 - 664) + chr(2637 - 2526) + chr(8222 - 8122) + '\x65')(chr(0b1110101) + '\164' + chr(0b1100110) + chr(0b10100 + 0o31) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'j\xe9\xd0p\xa3'), chr(0b1100100) + '\145' + chr(1900 - 1801) + '\x6f' + chr(0b1100100) + chr(6684 - 6583))(chr(117) + chr(116) + chr(6667 - 6565) + chr(0b101101) + chr(1510 - 1454))) as E8Pmqk8kxnzp:
for ffiOpFBWGmZU in E8Pmqk8kxnzp:
PAXWBYcIZQxU = ffiOpFBWGmZU.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'%'), '\144' + '\x65' + '\143' + chr(0b1101111) + chr(0b1001010 + 0o32) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(102) + chr(0b101101) + chr(56)))
if PAXWBYcIZQxU[nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1011 + 0o45), ord("\x08"))] == d9gWGDfFIt43:
return nzTpIcepk0o8(roI3spqORKae(PAXWBYcIZQxU[nzTpIcepk0o8('\x30' + '\157' + chr(0b110001), ord("\x08"))], roI3spqORKae(ES5oEprVxulp(b't\xf9\xff\x19\xe9\x83\xfa\xa6\x07z\xa2"'), chr(0b1100100) + chr(101) + chr(5131 - 5032) + chr(111) + chr(0b1100100) + chr(0b110110 + 0o57))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b1110 + 0o37) + chr(0b111000)))())
return None
uifrrAlEn5Lr = HWFRkDKKQ7LY(d9gWGDfFIt43)
if uifrrAlEn5Lr is None:
return None
yDIeQS7LXbGo = ozXqxlnptchw([uifrrAlEn5Lr])
J7DVXYlVh6vo = Ahh8lhmTsQQL(yDIeQS7LXbGo)
return J7DVXYlVh6vo[nzTpIcepk0o8('\060' + chr(0b101101 + 0o102) + chr(656 - 608), 8)]
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
synsets
|
def synsets(lemma,pos=None):
"""Returns all synset objects which have lemma as one of the variant literals and fixed pos, if provided.
Notes
-----
Uses lazy initialization - parses only those synsets which are not yet initialized, others are fetched from a dictionary.
Parameters
----------
lemma : str
Lemma of the synset.
pos : str, optional
Part-of-speech specification of the searched synsets, defaults to None.
Returns
-------
list of Synsets
Synsets which contain `lemma` and of which part-of-speech is `pos`, if specified.
Empty list, if no match was found.
"""
def _get_synset_idxes(lemma,pos):
line_prefix_regexp = "%s:%s:(.*)"%(lemma,pos if pos else "\w+")
line_prefix = re.compile(line_prefix_regexp)
idxes = []
with codecs.open(_LIT_POS_FILE,'rb', 'utf-8') as fin:
for line in fin:
result = line_prefix.match(line)
if result:
res_indices = [int(x) for x in result.group(1).split(' ')]
idxes.extend(res_indices)
LEM_POS_2_SS_IDX[lemma][pos].extend(idxes)
return sorted(idxes)
synset_idxes = None
if lemma in LEM_POS_2_SS_IDX:
if pos in LEM_POS_2_SS_IDX[lemma]:
synset_idxes = LEM_POS_2_SS_IDX[lemma][pos]
else:
synset_idxes = [idx for pos in LEM_POS_2_SS_IDX[lemma] for idx in LEM_POS_2_SS_IDX[lemma][pos]]
if not synset_idxes:
synset_idxes = _get_synset_idxes(lemma,pos)
if len(synset_idxes) == 0:
return []
stored_synsets = [SYNSETS_DICT[synset_idxes[i]] for i in range(len(synset_idxes)) if synset_idxes[i] in SYNSETS_DICT]
unstored_synset_idxes = [synset_idxes[i] for i in range(len(synset_idxes)) if synset_idxes[i] not in SYNSETS_DICT]
synset_offsets = _get_synset_offsets(unstored_synset_idxes)
synsets = _get_synsets(synset_offsets)
return stored_synsets + synsets
|
python
|
def synsets(lemma,pos=None):
"""Returns all synset objects which have lemma as one of the variant literals and fixed pos, if provided.
Notes
-----
Uses lazy initialization - parses only those synsets which are not yet initialized, others are fetched from a dictionary.
Parameters
----------
lemma : str
Lemma of the synset.
pos : str, optional
Part-of-speech specification of the searched synsets, defaults to None.
Returns
-------
list of Synsets
Synsets which contain `lemma` and of which part-of-speech is `pos`, if specified.
Empty list, if no match was found.
"""
def _get_synset_idxes(lemma,pos):
line_prefix_regexp = "%s:%s:(.*)"%(lemma,pos if pos else "\w+")
line_prefix = re.compile(line_prefix_regexp)
idxes = []
with codecs.open(_LIT_POS_FILE,'rb', 'utf-8') as fin:
for line in fin:
result = line_prefix.match(line)
if result:
res_indices = [int(x) for x in result.group(1).split(' ')]
idxes.extend(res_indices)
LEM_POS_2_SS_IDX[lemma][pos].extend(idxes)
return sorted(idxes)
synset_idxes = None
if lemma in LEM_POS_2_SS_IDX:
if pos in LEM_POS_2_SS_IDX[lemma]:
synset_idxes = LEM_POS_2_SS_IDX[lemma][pos]
else:
synset_idxes = [idx for pos in LEM_POS_2_SS_IDX[lemma] for idx in LEM_POS_2_SS_IDX[lemma][pos]]
if not synset_idxes:
synset_idxes = _get_synset_idxes(lemma,pos)
if len(synset_idxes) == 0:
return []
stored_synsets = [SYNSETS_DICT[synset_idxes[i]] for i in range(len(synset_idxes)) if synset_idxes[i] in SYNSETS_DICT]
unstored_synset_idxes = [synset_idxes[i] for i in range(len(synset_idxes)) if synset_idxes[i] not in SYNSETS_DICT]
synset_offsets = _get_synset_offsets(unstored_synset_idxes)
synsets = _get_synsets(synset_offsets)
return stored_synsets + synsets
|
[
"def",
"synsets",
"(",
"lemma",
",",
"pos",
"=",
"None",
")",
":",
"def",
"_get_synset_idxes",
"(",
"lemma",
",",
"pos",
")",
":",
"line_prefix_regexp",
"=",
"\"%s:%s:(.*)\"",
"%",
"(",
"lemma",
",",
"pos",
"if",
"pos",
"else",
"\"\\w+\"",
")",
"line_prefix",
"=",
"re",
".",
"compile",
"(",
"line_prefix_regexp",
")",
"idxes",
"=",
"[",
"]",
"with",
"codecs",
".",
"open",
"(",
"_LIT_POS_FILE",
",",
"'rb'",
",",
"'utf-8'",
")",
"as",
"fin",
":",
"for",
"line",
"in",
"fin",
":",
"result",
"=",
"line_prefix",
".",
"match",
"(",
"line",
")",
"if",
"result",
":",
"res_indices",
"=",
"[",
"int",
"(",
"x",
")",
"for",
"x",
"in",
"result",
".",
"group",
"(",
"1",
")",
".",
"split",
"(",
"' '",
")",
"]",
"idxes",
".",
"extend",
"(",
"res_indices",
")",
"LEM_POS_2_SS_IDX",
"[",
"lemma",
"]",
"[",
"pos",
"]",
".",
"extend",
"(",
"idxes",
")",
"return",
"sorted",
"(",
"idxes",
")",
"synset_idxes",
"=",
"None",
"if",
"lemma",
"in",
"LEM_POS_2_SS_IDX",
":",
"if",
"pos",
"in",
"LEM_POS_2_SS_IDX",
"[",
"lemma",
"]",
":",
"synset_idxes",
"=",
"LEM_POS_2_SS_IDX",
"[",
"lemma",
"]",
"[",
"pos",
"]",
"else",
":",
"synset_idxes",
"=",
"[",
"idx",
"for",
"pos",
"in",
"LEM_POS_2_SS_IDX",
"[",
"lemma",
"]",
"for",
"idx",
"in",
"LEM_POS_2_SS_IDX",
"[",
"lemma",
"]",
"[",
"pos",
"]",
"]",
"if",
"not",
"synset_idxes",
":",
"synset_idxes",
"=",
"_get_synset_idxes",
"(",
"lemma",
",",
"pos",
")",
"if",
"len",
"(",
"synset_idxes",
")",
"==",
"0",
":",
"return",
"[",
"]",
"stored_synsets",
"=",
"[",
"SYNSETS_DICT",
"[",
"synset_idxes",
"[",
"i",
"]",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"synset_idxes",
")",
")",
"if",
"synset_idxes",
"[",
"i",
"]",
"in",
"SYNSETS_DICT",
"]",
"unstored_synset_idxes",
"=",
"[",
"synset_idxes",
"[",
"i",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"synset_idxes",
")",
")",
"if",
"synset_idxes",
"[",
"i",
"]",
"not",
"in",
"SYNSETS_DICT",
"]",
"synset_offsets",
"=",
"_get_synset_offsets",
"(",
"unstored_synset_idxes",
")",
"synsets",
"=",
"_get_synsets",
"(",
"synset_offsets",
")",
"return",
"stored_synsets",
"+",
"synsets"
] |
Returns all synset objects which have lemma as one of the variant literals and fixed pos, if provided.
Notes
-----
Uses lazy initialization - parses only those synsets which are not yet initialized, others are fetched from a dictionary.
Parameters
----------
lemma : str
Lemma of the synset.
pos : str, optional
Part-of-speech specification of the searched synsets, defaults to None.
Returns
-------
list of Synsets
Synsets which contain `lemma` and of which part-of-speech is `pos`, if specified.
Empty list, if no match was found.
|
[
"Returns",
"all",
"synset",
"objects",
"which",
"have",
"lemma",
"as",
"one",
"of",
"the",
"variant",
"literals",
"and",
"fixed",
"pos",
"if",
"provided",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L199-L256
|
train
|
Returns all synsets which have the given lemma and fixed pos.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhl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ertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(836 - 785) + chr(0b110011) + '\x32', 45801 - 45793), nzTpIcepk0o8('\060' + '\157' + chr(0b1010 + 0o55) + chr(0b101 + 0o57), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(62 - 13) + '\061' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + chr(0b101101 + 0o3) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x37' + chr(54), 0b1000), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b1010001 + 0o36) + '\x35' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101 + 0o142) + chr(0b10111 + 0o32) + '\066' + '\x34', 0o10), nzTpIcepk0o8(chr(48) + chr(3255 - 3144) + chr(0b10001 + 0o42) + chr(484 - 430) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(558 - 507) + chr(55) + chr(0b110101), 63685 - 63677), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + chr(0b110010) + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(5480 - 5369) + chr(1464 - 1414) + chr(0b110101) + '\x37', 23939 - 23931), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b110110) + '\063', 62796 - 62788), nzTpIcepk0o8(chr(0b110000) + chr(11818 - 11707) + chr(0b110100) + chr(0b100011 + 0o20), 40953 - 40945), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(50), 17741 - 17733), nzTpIcepk0o8(chr(0b11001 + 0o27) + '\x6f' + chr(0b110011) + '\067' + '\065', 8), nzTpIcepk0o8('\x30' + chr(5235 - 5124) + chr(1857 - 1806) + chr(0b110100) + chr(0b110101), 3831 - 3823), nzTpIcepk0o8('\060' + '\157' + '\062' + chr(0b10000 + 0o42), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b0 + 0o157) + chr(49) + chr(0b110000) + '\066', 0o10), nzTpIcepk0o8(chr(1554 - 1506) + chr(111) + chr(1144 - 1095) + '\x30' + chr(982 - 931), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + '\067', 0b1000), nzTpIcepk0o8(chr(2005 - 1957) + chr(0b1101111) + chr(907 - 856) + chr(1096 - 1048) + '\067', 63542 - 63534), nzTpIcepk0o8(chr(48) + '\x6f' + chr(54) + chr(2374 - 2320), 64472 - 64464), nzTpIcepk0o8(chr(347 - 299) + '\x6f' + chr(0b101110 + 0o5) + '\x36' + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b110001 + 0o76) + '\x34' + chr(0b11001 + 0o36), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(8314 - 8203) + chr(50) + chr(0b110111) + chr(1119 - 1064), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\062' + chr(1826 - 1777) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + chr(0b101111 + 0o4) + '\062', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\064' + '\x32', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b101100 + 0o103) + chr(0b110001) + '\066' + chr(2532 - 2478), 0b1000), nzTpIcepk0o8(chr(509 - 461) + chr(3626 - 3515) + chr(0b110010) + '\061' + chr(831 - 783), 18917 - 18909), nzTpIcepk0o8('\x30' + '\157' + '\x32' + chr(2006 - 1954) + '\064', 12326 - 12318), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b10 + 0o63) + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2190 - 2140), 15150 - 15142), nzTpIcepk0o8(chr(925 - 877) + chr(0b1101111) + chr(0b101001 + 0o11) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100110 + 0o14) + chr(968 - 917) + chr(1338 - 1287), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + '\x32' + '\064', 0o10), nzTpIcepk0o8('\060' + chr(5422 - 5311) + '\x34', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b11010 + 0o125) + chr(1281 - 1227), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + chr(0b101011 + 0o10) + chr(2085 - 2037), ord("\x08")), nzTpIcepk0o8(chr(0b100100 + 0o14) + '\x6f' + chr(0b110100) + chr(0b1000 + 0o57), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110101) + chr(0b110000), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xf4'), chr(0b1100100) + chr(0b1100101) + chr(6656 - 6557) + '\157' + '\x64' + chr(0b100 + 0o141))(chr(117) + '\164' + chr(0b10101 + 0o121) + chr(0b101101) + chr(607 - 551)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def aasVOJCZfJgh(W6axg8J0N9kP, IGIA_fu6MbaO=None):
def O3YAXQzE4iAe(W6axg8J0N9kP, IGIA_fu6MbaO):
CoWHQWa6_VHl = roI3spqORKae(ES5oEprVxulp(b'\xffOw\xa7M\x12\\\xde\xd7\xf8'), chr(7189 - 7089) + chr(0b1001100 + 0o31) + '\x63' + chr(0b110001 + 0o76) + '\144' + chr(101))(chr(0b111111 + 0o66) + '\x74' + '\x66' + chr(1421 - 1376) + chr(0b110000 + 0o10)) % (W6axg8J0N9kP, IGIA_fu6MbaO if IGIA_fu6MbaO else roI3spqORKae(ES5oEprVxulp(b'\x86Kf'), chr(0b1100100) + chr(5507 - 5406) + chr(6114 - 6015) + '\157' + '\x64' + chr(0b100010 + 0o103))(chr(10818 - 10701) + '\x74' + chr(0b1100110) + '\055' + '\070'))
antKG30suToo = aoTc4YA2bs2R.compile(CoWHQWa6_VHl)
wSfK9oNRckg4 = []
with roI3spqORKae(Hj8X5RtMNBIn, roI3spqORKae(ES5oEprVxulp(b'\x9eR\x18\xb1lYM\xbe\xc8\xb0\xc3\xd2'), '\144' + chr(101) + chr(0b1100011) + chr(111) + '\144' + chr(0b1100101))('\x75' + '\x74' + chr(0b1001 + 0o135) + chr(0b101010 + 0o3) + chr(0b101010 + 0o16)))(q1G8d8bZm3V5, roI3spqORKae(ES5oEprVxulp(b'\xa8^'), '\x64' + chr(101) + chr(0b1100011) + '\157' + '\144' + chr(2024 - 1923))(chr(1133 - 1016) + '\164' + chr(1504 - 1402) + chr(1164 - 1119) + chr(0b10110 + 0o42)), roI3spqORKae(ES5oEprVxulp(b'\xafH+\xaf\x06'), chr(0b1010010 + 0o22) + '\145' + chr(99) + chr(0b1101111) + chr(0b1000001 + 0o43) + chr(0b1011101 + 0o10))('\x75' + chr(0b101010 + 0o112) + chr(5886 - 5784) + '\x2d' + chr(56))) as E8Pmqk8kxnzp:
for ffiOpFBWGmZU in E8Pmqk8kxnzp:
POx95m7SPOVy = antKG30suToo.hk9OijmiC_zA(ffiOpFBWGmZU)
if POx95m7SPOVy:
qQeESnpYZEgK = [nzTpIcepk0o8(bI5jsQ9OkQtj) for bI5jsQ9OkQtj in POx95m7SPOVy.group(nzTpIcepk0o8('\060' + '\x6f' + chr(49), 0o10)).LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'\xfa'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1011010 + 0o25) + '\144' + '\x65')('\165' + chr(0b1110100) + chr(0b11000 + 0o116) + chr(0b101001 + 0o4) + chr(56)))]
roI3spqORKae(wSfK9oNRckg4, roI3spqORKae(ES5oEprVxulp(b'\x8ec~\xcfQL8\xa7\xa2\x93\xcd\xc2'), '\144' + chr(8273 - 8172) + '\143' + chr(111) + '\x64' + '\x65')(chr(5283 - 5166) + chr(0b111011 + 0o71) + chr(0b1100110) + chr(45) + chr(0b1110 + 0o52)))(qQeESnpYZEgK)
roI3spqORKae(f4hOxSVh9O5T[W6axg8J0N9kP][IGIA_fu6MbaO], roI3spqORKae(ES5oEprVxulp(b'\x8ec~\xcfQL8\xa7\xa2\x93\xcd\xc2'), chr(868 - 768) + chr(0b1100101) + chr(371 - 272) + '\157' + chr(0b1100100) + '\x65')(chr(117) + '\164' + '\x66' + '\x2d' + chr(0b111000)))(wSfK9oNRckg4)
return V3OlOVg98A85(wSfK9oNRckg4)
D1oeKM_CDI_d = None
if W6axg8J0N9kP in f4hOxSVh9O5T:
if IGIA_fu6MbaO in f4hOxSVh9O5T[W6axg8J0N9kP]:
D1oeKM_CDI_d = f4hOxSVh9O5T[W6axg8J0N9kP][IGIA_fu6MbaO]
else:
D1oeKM_CDI_d = [At3kbMoXzzmV for IGIA_fu6MbaO in f4hOxSVh9O5T[W6axg8J0N9kP] for At3kbMoXzzmV in f4hOxSVh9O5T[W6axg8J0N9kP][IGIA_fu6MbaO]]
if not D1oeKM_CDI_d:
D1oeKM_CDI_d = O3YAXQzE4iAe(W6axg8J0N9kP, IGIA_fu6MbaO)
if ftfygxgFas5X(D1oeKM_CDI_d) == nzTpIcepk0o8(chr(0b10000 + 0o40) + '\157' + chr(48), 41676 - 41668):
return []
h1nPtDPyUZ8Z = [vrjEypvW__W4[D1oeKM_CDI_d[ZlbFMSG8gCoF]] for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(D1oeKM_CDI_d)) if D1oeKM_CDI_d[ZlbFMSG8gCoF] in vrjEypvW__W4]
vsI64m6tQVPW = [D1oeKM_CDI_d[ZlbFMSG8gCoF] for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(D1oeKM_CDI_d)) if D1oeKM_CDI_d[ZlbFMSG8gCoF] not in vrjEypvW__W4]
WlRV4D6EkSOO = ozXqxlnptchw(vsI64m6tQVPW)
aasVOJCZfJgh = Ahh8lhmTsQQL(WlRV4D6EkSOO)
return h1nPtDPyUZ8Z + aasVOJCZfJgh
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
all_synsets
|
def all_synsets(pos=None):
"""Return all the synsets which have the provided pos.
Notes
-----
Returns thousands or tens of thousands of synsets - first time will take significant time.
Useful for initializing synsets as each returned synset is also stored in a global dictionary for fast retrieval the next time.
Parameters
----------
pos : str
Part-of-speech of the sought synsets. Sensible alternatives are wn.ADJ, wn.ADV, wn.VERB, wn.NOUN and `*`.
If pos == `*`, all the synsets are retrieved and initialized for fast retrieval the next time.
Returns
-------
list of Synsets
Lists the Synsets which have `pos` as part-of-speech.
Empty list, if `pos` not in [wn.ADJ, wn.ADV, wn.VERB, wn.NOUN, `*`].
"""
def _get_unique_synset_idxes(pos):
idxes = []
with codecs.open(_LIT_POS_FILE,'rb', 'utf-8') as fin:
if pos == None:
for line in fin:
split_line = line.strip().split(':')
idxes.extend([int(x) for x in split_line[2].split()])
else:
for line in fin:
split_line = line.strip().split(':')
if split_line[1] == pos:
idxes.extend([int(x) for x in split_line[2].split()])
idxes = list(set(idxes))
idxes.sort()
return idxes
if pos in LOADED_POS:
return [SYNSETS_DICT[idx] for lemma in LEM_POS_2_SS_IDX for idx in LEM_POS_2_SS_IDX[lemma][pos]]
else:
synset_idxes = _get_unique_synset_idxes(pos)
if len(synset_idxes) == 0:
return []
stored_synsets = [SYNSETS_DICT[synset_idxes[i]] for i in range(len(synset_idxes)) if synset_idxes[i] in SYNSETS_DICT]
unstored_synset_idxes = [synset_idxes[i] for i in range(len(synset_idxes)) if synset_idxes[i] not in SYNSETS_DICT]
synset_offsets = _get_synset_offsets(unstored_synset_idxes)
synsets = _get_synsets(synset_offsets)
for synset in synsets:
for variant in synset.get_variants():
LEM_POS_2_SS_IDX[variant.literal][synset.pos].append(synset.id)
LOADED_POS.add(pos)
return stored_synsets + synsets
|
python
|
def all_synsets(pos=None):
"""Return all the synsets which have the provided pos.
Notes
-----
Returns thousands or tens of thousands of synsets - first time will take significant time.
Useful for initializing synsets as each returned synset is also stored in a global dictionary for fast retrieval the next time.
Parameters
----------
pos : str
Part-of-speech of the sought synsets. Sensible alternatives are wn.ADJ, wn.ADV, wn.VERB, wn.NOUN and `*`.
If pos == `*`, all the synsets are retrieved and initialized for fast retrieval the next time.
Returns
-------
list of Synsets
Lists the Synsets which have `pos` as part-of-speech.
Empty list, if `pos` not in [wn.ADJ, wn.ADV, wn.VERB, wn.NOUN, `*`].
"""
def _get_unique_synset_idxes(pos):
idxes = []
with codecs.open(_LIT_POS_FILE,'rb', 'utf-8') as fin:
if pos == None:
for line in fin:
split_line = line.strip().split(':')
idxes.extend([int(x) for x in split_line[2].split()])
else:
for line in fin:
split_line = line.strip().split(':')
if split_line[1] == pos:
idxes.extend([int(x) for x in split_line[2].split()])
idxes = list(set(idxes))
idxes.sort()
return idxes
if pos in LOADED_POS:
return [SYNSETS_DICT[idx] for lemma in LEM_POS_2_SS_IDX for idx in LEM_POS_2_SS_IDX[lemma][pos]]
else:
synset_idxes = _get_unique_synset_idxes(pos)
if len(synset_idxes) == 0:
return []
stored_synsets = [SYNSETS_DICT[synset_idxes[i]] for i in range(len(synset_idxes)) if synset_idxes[i] in SYNSETS_DICT]
unstored_synset_idxes = [synset_idxes[i] for i in range(len(synset_idxes)) if synset_idxes[i] not in SYNSETS_DICT]
synset_offsets = _get_synset_offsets(unstored_synset_idxes)
synsets = _get_synsets(synset_offsets)
for synset in synsets:
for variant in synset.get_variants():
LEM_POS_2_SS_IDX[variant.literal][synset.pos].append(synset.id)
LOADED_POS.add(pos)
return stored_synsets + synsets
|
[
"def",
"all_synsets",
"(",
"pos",
"=",
"None",
")",
":",
"def",
"_get_unique_synset_idxes",
"(",
"pos",
")",
":",
"idxes",
"=",
"[",
"]",
"with",
"codecs",
".",
"open",
"(",
"_LIT_POS_FILE",
",",
"'rb'",
",",
"'utf-8'",
")",
"as",
"fin",
":",
"if",
"pos",
"==",
"None",
":",
"for",
"line",
"in",
"fin",
":",
"split_line",
"=",
"line",
".",
"strip",
"(",
")",
".",
"split",
"(",
"':'",
")",
"idxes",
".",
"extend",
"(",
"[",
"int",
"(",
"x",
")",
"for",
"x",
"in",
"split_line",
"[",
"2",
"]",
".",
"split",
"(",
")",
"]",
")",
"else",
":",
"for",
"line",
"in",
"fin",
":",
"split_line",
"=",
"line",
".",
"strip",
"(",
")",
".",
"split",
"(",
"':'",
")",
"if",
"split_line",
"[",
"1",
"]",
"==",
"pos",
":",
"idxes",
".",
"extend",
"(",
"[",
"int",
"(",
"x",
")",
"for",
"x",
"in",
"split_line",
"[",
"2",
"]",
".",
"split",
"(",
")",
"]",
")",
"idxes",
"=",
"list",
"(",
"set",
"(",
"idxes",
")",
")",
"idxes",
".",
"sort",
"(",
")",
"return",
"idxes",
"if",
"pos",
"in",
"LOADED_POS",
":",
"return",
"[",
"SYNSETS_DICT",
"[",
"idx",
"]",
"for",
"lemma",
"in",
"LEM_POS_2_SS_IDX",
"for",
"idx",
"in",
"LEM_POS_2_SS_IDX",
"[",
"lemma",
"]",
"[",
"pos",
"]",
"]",
"else",
":",
"synset_idxes",
"=",
"_get_unique_synset_idxes",
"(",
"pos",
")",
"if",
"len",
"(",
"synset_idxes",
")",
"==",
"0",
":",
"return",
"[",
"]",
"stored_synsets",
"=",
"[",
"SYNSETS_DICT",
"[",
"synset_idxes",
"[",
"i",
"]",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"synset_idxes",
")",
")",
"if",
"synset_idxes",
"[",
"i",
"]",
"in",
"SYNSETS_DICT",
"]",
"unstored_synset_idxes",
"=",
"[",
"synset_idxes",
"[",
"i",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"synset_idxes",
")",
")",
"if",
"synset_idxes",
"[",
"i",
"]",
"not",
"in",
"SYNSETS_DICT",
"]",
"synset_offsets",
"=",
"_get_synset_offsets",
"(",
"unstored_synset_idxes",
")",
"synsets",
"=",
"_get_synsets",
"(",
"synset_offsets",
")",
"for",
"synset",
"in",
"synsets",
":",
"for",
"variant",
"in",
"synset",
".",
"get_variants",
"(",
")",
":",
"LEM_POS_2_SS_IDX",
"[",
"variant",
".",
"literal",
"]",
"[",
"synset",
".",
"pos",
"]",
".",
"append",
"(",
"synset",
".",
"id",
")",
"LOADED_POS",
".",
"add",
"(",
"pos",
")",
"return",
"stored_synsets",
"+",
"synsets"
] |
Return all the synsets which have the provided pos.
Notes
-----
Returns thousands or tens of thousands of synsets - first time will take significant time.
Useful for initializing synsets as each returned synset is also stored in a global dictionary for fast retrieval the next time.
Parameters
----------
pos : str
Part-of-speech of the sought synsets. Sensible alternatives are wn.ADJ, wn.ADV, wn.VERB, wn.NOUN and `*`.
If pos == `*`, all the synsets are retrieved and initialized for fast retrieval the next time.
Returns
-------
list of Synsets
Lists the Synsets which have `pos` as part-of-speech.
Empty list, if `pos` not in [wn.ADJ, wn.ADV, wn.VERB, wn.NOUN, `*`].
|
[
"Return",
"all",
"the",
"synsets",
"which",
"have",
"the",
"provided",
"pos",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L258-L316
|
train
|
Returns all the synsets which have the provided pos.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFG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4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(1614 - 1566) + chr(111) + '\x34', 0b1000), nzTpIcepk0o8(chr(275 - 227) + '\157' + '\x31' + '\061' + '\067', ord("\x08")), nzTpIcepk0o8('\x30' + chr(7641 - 7530) + '\062' + '\x37' + '\067', 0b1000), nzTpIcepk0o8(chr(809 - 761) + chr(0b1101111) + chr(1133 - 1083) + '\x32' + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1597 - 1548) + chr(0b11101 + 0o30) + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\x6f' + chr(0b110001) + chr(0b11011 + 0o27) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(1940 - 1892) + chr(0b1101111) + chr(1405 - 1355) + chr(0b110001) + chr(1598 - 1548), 36237 - 36229), nzTpIcepk0o8(chr(1853 - 1805) + chr(0b1101111) + '\x33' + '\065' + '\066', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1100101 + 0o12) + '\061' + chr(0b101 + 0o60) + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(4150 - 4039) + '\x31' + '\x36' + chr(0b100 + 0o60), 48435 - 48427), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(0b110101) + chr(48), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b101110 + 0o10) + chr(0b110010), 24625 - 24617), nzTpIcepk0o8('\060' + chr(111) + chr(1021 - 969), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2263 - 2213) + chr(0b11000 + 0o37), ord("\x08")), nzTpIcepk0o8('\x30' + chr(11693 - 11582) + chr(51) + chr(0b110100) + chr(0b11000 + 0o37), ord("\x08")), nzTpIcepk0o8(chr(2247 - 2199) + chr(0b1101111) + chr(0b110010 + 0o0) + '\x30' + chr(0b1100 + 0o50), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\064' + '\065', 2337 - 2329), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b101000 + 0o12) + chr(53) + chr(2324 - 2273), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\x33' + '\x33' + chr(48), 0b1000), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b110010) + '\x37' + '\067', 8), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + '\x37' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(1643 - 1595) + chr(1999 - 1888) + chr(54) + chr(2343 - 2293), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(1286 - 1237) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1010000 + 0o37) + chr(409 - 358) + chr(0b110110) + chr(2612 - 2560), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(147 - 36) + chr(51) + '\x36' + chr(52), 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(540 - 489) + '\060' + chr(53), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1101 + 0o45) + chr(1899 - 1845) + chr(0b10000 + 0o41), 29861 - 29853), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\063' + chr(428 - 377), 0b1000), nzTpIcepk0o8(chr(2200 - 2152) + chr(0b1101111) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\157' + chr(0b110010) + '\062' + '\065', 48430 - 48422), nzTpIcepk0o8('\x30' + chr(111) + '\061' + '\066' + '\062', 8), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(111) + '\x33' + chr(1883 - 1832) + chr(52), 0b1000), nzTpIcepk0o8(chr(100 - 52) + '\x6f' + chr(49) + chr(2258 - 2207) + chr(0b110011 + 0o2), ord("\x08")), nzTpIcepk0o8(chr(847 - 799) + '\x6f' + chr(0b110011) + chr(0b110011) + chr(0b101111 + 0o1), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110011) + chr(702 - 654) + '\066', ord("\x08")), nzTpIcepk0o8(chr(1329 - 1281) + chr(8245 - 8134) + chr(2432 - 2381) + '\066' + '\062', 50175 - 50167), nzTpIcepk0o8(chr(143 - 95) + '\157' + chr(0b11011 + 0o27) + '\x32' + '\x35', 8), nzTpIcepk0o8(chr(0b110000) + chr(1387 - 1276) + chr(50) + chr(54) + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + chr(10706 - 10595) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2014 - 1960) + '\x32', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b10 + 0o155) + chr(0b110101) + '\060', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'*'), chr(0b1100100) + chr(0b1100101) + chr(0b11000 + 0o113) + chr(0b1101111) + chr(0b100101 + 0o77) + '\145')(chr(0b100111 + 0o116) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(1413 - 1357)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def RMLi_t3UREla(IGIA_fu6MbaO=None):
def UoTf9zYxaiRq(IGIA_fu6MbaO):
wSfK9oNRckg4 = []
with roI3spqORKae(Hj8X5RtMNBIn, roI3spqORKae(ES5oEprVxulp(b'@!\xea\xa1;%\xb3\xa0]\x15\x04\x13'), '\144' + chr(4748 - 4647) + chr(0b1100000 + 0o3) + chr(9223 - 9112) + chr(0b110 + 0o136) + '\145')(chr(9472 - 9355) + chr(0b1000010 + 0o62) + chr(0b1100101 + 0o1) + chr(0b101101) + chr(0b111000)))(q1G8d8bZm3V5, roI3spqORKae(ES5oEprVxulp(b'v-'), chr(0b1100100) + '\145' + chr(99) + chr(9734 - 9623) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + '\x38'), roI3spqORKae(ES5oEprVxulp(b'q;\xd9\xbfQ'), '\144' + '\145' + chr(99) + chr(9141 - 9030) + '\144' + chr(6426 - 6325))(chr(12698 - 12581) + chr(6360 - 6244) + '\x66' + chr(45) + chr(1800 - 1744))) as E8Pmqk8kxnzp:
if IGIA_fu6MbaO is None:
for ffiOpFBWGmZU in E8Pmqk8kxnzp:
PAXWBYcIZQxU = ffiOpFBWGmZU.strip().LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'>'), chr(0b1100100) + chr(6539 - 6438) + chr(3295 - 3196) + '\157' + chr(0b111010 + 0o52) + chr(101))(chr(117) + '\164' + chr(0b1010001 + 0o25) + chr(995 - 950) + '\070'))
roI3spqORKae(wSfK9oNRckg4, roI3spqORKae(ES5oEprVxulp(b'P\x10\x8c\xdf\x060\xc6\xb976\n\x03'), chr(5900 - 5800) + '\145' + chr(99) + chr(0b11000 + 0o127) + chr(100) + '\145')('\x75' + '\164' + chr(0b1100110) + chr(0b100111 + 0o6) + chr(0b111000)))([nzTpIcepk0o8(bI5jsQ9OkQtj) for bI5jsQ9OkQtj in roI3spqORKae(PAXWBYcIZQxU[nzTpIcepk0o8(chr(48) + chr(111) + chr(2397 - 2347), ord("\x08"))], roI3spqORKae(ES5oEprVxulp(b'H)\xed\xe08\x1b\xf2\x9b,\x02\x061'), chr(100) + chr(0b1100101) + '\143' + '\157' + chr(0b1010101 + 0o17) + chr(0b100010 + 0o103))(chr(0b1110101) + chr(0b111011 + 0o71) + chr(0b1100110) + chr(45) + '\x38'))()])
else:
for ffiOpFBWGmZU in E8Pmqk8kxnzp:
PAXWBYcIZQxU = ffiOpFBWGmZU.strip().LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'>'), '\x64' + chr(2314 - 2213) + chr(0b110010 + 0o61) + '\157' + chr(0b1100010 + 0o2) + chr(0b1000010 + 0o43))(chr(117) + '\x74' + '\146' + chr(45) + chr(56)))
if PAXWBYcIZQxU[nzTpIcepk0o8('\060' + '\x6f' + '\061', 8)] == IGIA_fu6MbaO:
roI3spqORKae(wSfK9oNRckg4, roI3spqORKae(ES5oEprVxulp(b'P\x10\x8c\xdf\x060\xc6\xb976\n\x03'), chr(2402 - 2302) + chr(1185 - 1084) + chr(8368 - 8269) + '\157' + '\x64' + chr(0b1110 + 0o127))(chr(0b1011000 + 0o35) + chr(116) + chr(0b1100011 + 0o3) + '\x2d' + chr(0b11011 + 0o35)))([nzTpIcepk0o8(bI5jsQ9OkQtj) for bI5jsQ9OkQtj in roI3spqORKae(PAXWBYcIZQxU[nzTpIcepk0o8(chr(0b110000) + chr(9367 - 9256) + chr(50), 8)], roI3spqORKae(ES5oEprVxulp(b'H)\xed\xe08\x1b\xf2\x9b,\x02\x061'), '\144' + chr(101) + chr(0b1100011) + '\x6f' + chr(0b1100100) + '\145')(chr(0b10000 + 0o145) + chr(116) + chr(726 - 624) + '\x2d' + chr(2448 - 2392)))()])
wSfK9oNRckg4 = V3OlOVg98A85(Bvi71nNyvlqO(wSfK9oNRckg4))
return wSfK9oNRckg4
if IGIA_fu6MbaO in XjsHtMCP2Lbn:
return [vrjEypvW__W4[At3kbMoXzzmV] for W6axg8J0N9kP in f4hOxSVh9O5T for At3kbMoXzzmV in f4hOxSVh9O5T[W6axg8J0N9kP][IGIA_fu6MbaO]]
else:
D1oeKM_CDI_d = UoTf9zYxaiRq(IGIA_fu6MbaO)
if ftfygxgFas5X(D1oeKM_CDI_d) == nzTpIcepk0o8('\060' + chr(0b1101100 + 0o3) + chr(0b111 + 0o51), 0o10):
return []
h1nPtDPyUZ8Z = [vrjEypvW__W4[D1oeKM_CDI_d[ZlbFMSG8gCoF]] for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(D1oeKM_CDI_d)) if D1oeKM_CDI_d[ZlbFMSG8gCoF] in vrjEypvW__W4]
vsI64m6tQVPW = [D1oeKM_CDI_d[ZlbFMSG8gCoF] for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(D1oeKM_CDI_d)) if D1oeKM_CDI_d[ZlbFMSG8gCoF] not in vrjEypvW__W4]
WlRV4D6EkSOO = ozXqxlnptchw(vsI64m6tQVPW)
aasVOJCZfJgh = Ahh8lhmTsQQL(WlRV4D6EkSOO)
for J7DVXYlVh6vo in aasVOJCZfJgh:
for ZXJSPKxkIyZK in roI3spqORKae(J7DVXYlVh6vo, roI3spqORKae(ES5oEprVxulp(b'c*\xcb\xcd\x1f5\xf8\x87\t\x1a\x1c\x01'), chr(1020 - 920) + chr(0b1100101) + '\143' + chr(9084 - 8973) + chr(100) + '\145')('\x75' + '\164' + '\146' + chr(45) + chr(0b111000)))():
roI3spqORKae(f4hOxSVh9O5T[ZXJSPKxkIyZK.literal][J7DVXYlVh6vo.pos], roI3spqORKae(ES5oEprVxulp(b'L\x1b\xec\xa6\x113\xcd\x81\x02\x1b=G'), chr(5506 - 5406) + '\x65' + chr(99) + chr(0b1101111) + chr(9642 - 9542) + '\145')(chr(10975 - 10858) + chr(116) + '\x66' + chr(0b101100 + 0o1) + chr(3025 - 2969)))(roI3spqORKae(J7DVXYlVh6vo, roI3spqORKae(ES5oEprVxulp(b'i.\xf3\xfc%3\xb2\xa1]\x0e8&'), '\144' + chr(4836 - 4735) + chr(451 - 352) + '\x6f' + '\144' + chr(4348 - 4247))(chr(0b101000 + 0o115) + chr(0b101 + 0o157) + chr(8183 - 8081) + chr(1019 - 974) + chr(1104 - 1048))))
roI3spqORKae(XjsHtMCP2Lbn, roI3spqORKae(ES5oEprVxulp(b"q|\xee\xf6\x00'\xc3\x9f,\x12+\x16"), '\144' + chr(0b110110 + 0o57) + chr(8603 - 8504) + chr(5699 - 5588) + chr(100) + chr(101))(chr(12232 - 12115) + chr(12048 - 11932) + chr(102) + chr(313 - 268) + '\x38'))(IGIA_fu6MbaO)
return h1nPtDPyUZ8Z + aasVOJCZfJgh
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
lemma
|
def lemma(lemma_key):
"""Returns the Lemma object with the given key.
Parameters
----------
lemma_key : str
Key of the returned lemma.
Returns
-------
Lemma
Lemma matching the `lemma_key`.
"""
if lemma_key in LEMMAS_DICT:
return LEMMAS_DICT[lemma_key]
split_lemma_key = lemma_key.split('.')
synset_key = '.'.join(split_lemma_key[:3])
lemma_literal = split_lemma_key[3]
lemma_obj = Lemma(synset_key,lemma_literal)
LEMMAS_DICT[lemma_key] = lemma_obj
return lemma_obj
|
python
|
def lemma(lemma_key):
"""Returns the Lemma object with the given key.
Parameters
----------
lemma_key : str
Key of the returned lemma.
Returns
-------
Lemma
Lemma matching the `lemma_key`.
"""
if lemma_key in LEMMAS_DICT:
return LEMMAS_DICT[lemma_key]
split_lemma_key = lemma_key.split('.')
synset_key = '.'.join(split_lemma_key[:3])
lemma_literal = split_lemma_key[3]
lemma_obj = Lemma(synset_key,lemma_literal)
LEMMAS_DICT[lemma_key] = lemma_obj
return lemma_obj
|
[
"def",
"lemma",
"(",
"lemma_key",
")",
":",
"if",
"lemma_key",
"in",
"LEMMAS_DICT",
":",
"return",
"LEMMAS_DICT",
"[",
"lemma_key",
"]",
"split_lemma_key",
"=",
"lemma_key",
".",
"split",
"(",
"'.'",
")",
"synset_key",
"=",
"'.'",
".",
"join",
"(",
"split_lemma_key",
"[",
":",
"3",
"]",
")",
"lemma_literal",
"=",
"split_lemma_key",
"[",
"3",
"]",
"lemma_obj",
"=",
"Lemma",
"(",
"synset_key",
",",
"lemma_literal",
")",
"LEMMAS_DICT",
"[",
"lemma_key",
"]",
"=",
"lemma_obj",
"return",
"lemma_obj"
] |
Returns the Lemma object with the given key.
Parameters
----------
lemma_key : str
Key of the returned lemma.
Returns
-------
Lemma
Lemma matching the `lemma_key`.
|
[
"Returns",
"the",
"Lemma",
"object",
"with",
"the",
"given",
"key",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L318-L341
|
train
|
Returns the Lemma object with the given key.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8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Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(10574 - 10463) + chr(0b10001 + 0o40) + chr(0b1000 + 0o56) + '\x37', 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(11446 - 11335) + '\063' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + chr(6419 - 6308) + chr(0b110111) + '\x33', 0b1000), nzTpIcepk0o8(chr(57 - 9) + '\157' + '\062', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + chr(0b101111 + 0o6) + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + chr(0b11101 + 0o32) + chr(50), 53414 - 53406), nzTpIcepk0o8(chr(0b110000) + chr(8295 - 8184) + chr(0b11110 + 0o25) + chr(0b10011 + 0o35) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b11110 + 0o121) + '\x32' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(48) + chr(2779 - 2668) + chr(54), 24060 - 24052), nzTpIcepk0o8(chr(48) + chr(8496 - 8385) + '\061' + chr(54) + '\063', 0o10), nzTpIcepk0o8('\060' + chr(12302 - 12191) + '\065' + chr(52), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(1703 - 1651) + chr(879 - 824), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x37' + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(0b1101111) + '\061' + chr(48) + chr(2098 - 2048), 0b1000), nzTpIcepk0o8('\x30' + chr(3233 - 3122) + chr(0b110011) + '\x33', 51441 - 51433), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + chr(0b110100) + chr(0b11 + 0o55), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110000 + 0o2) + chr(2068 - 2015), 0b1000), nzTpIcepk0o8(chr(592 - 544) + chr(0b1101010 + 0o5) + chr(0b1000 + 0o57) + chr(0b110101), 62733 - 62725), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(869 - 820) + chr(50), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010) + chr(50) + chr(49), 0o10), nzTpIcepk0o8('\x30' + chr(0b10111 + 0o130) + '\061' + chr(0b111 + 0o60) + chr(0b11000 + 0o34), 0b1000), nzTpIcepk0o8(chr(793 - 745) + chr(0b110101 + 0o72) + chr(0b110011) + chr(49) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(5207 - 5096) + chr(49) + chr(0b110101) + chr(55), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\067' + chr(124 - 75), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b100111 + 0o14) + '\065' + chr(1694 - 1643), 0b1000), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\x6f' + chr(1694 - 1643) + chr(50), 0o10), nzTpIcepk0o8(chr(377 - 329) + '\157' + chr(0b11100 + 0o27) + chr(51) + '\061', 0b1000), nzTpIcepk0o8(chr(1719 - 1671) + chr(6226 - 6115) + '\x32' + chr(0b110001) + chr(0b1110 + 0o47), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1011000 + 0o27) + chr(51) + chr(50) + '\061', 0b1000), nzTpIcepk0o8(chr(0b1011 + 0o45) + '\x6f' + chr(50) + '\x35' + chr(0b110111), 8628 - 8620), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + chr(48), 0o10), nzTpIcepk0o8(chr(511 - 463) + '\157' + '\x34' + '\065', 0b1000), nzTpIcepk0o8(chr(2103 - 2055) + chr(0b1101111) + chr(51) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b110110) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + chr(2025 - 1975) + chr(0b11001 + 0o31), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + '\064' + '\x35', 9323 - 9315), nzTpIcepk0o8('\060' + chr(0b101011 + 0o104) + '\x32' + chr(0b111 + 0o55), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b10000 + 0o137) + chr(49) + '\065' + chr(0b11001 + 0o27), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1989 - 1939) + chr(52) + chr(48), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1111 + 0o42) + chr(52), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\157' + chr(53) + chr(0b101011 + 0o5), 15189 - 15181)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'Y'), '\x64' + '\x65' + '\x63' + chr(0b11100 + 0o123) + '\x64' + chr(0b11000 + 0o115))('\165' + chr(5603 - 5487) + chr(9035 - 8933) + '\x2d' + chr(168 - 112)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def W6axg8J0N9kP(QsOaDmXlaIxZ):
if QsOaDmXlaIxZ in sSGtvt7k_qV1:
return sSGtvt7k_qV1[QsOaDmXlaIxZ]
aq1hZ7caPTrG = QsOaDmXlaIxZ.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'Y'), chr(8628 - 8528) + chr(0b11110 + 0o107) + '\x63' + '\x6f' + chr(100) + chr(0b1100101))('\x75' + chr(116) + chr(10049 - 9947) + chr(1354 - 1309) + chr(0b111000)))
d9gWGDfFIt43 = roI3spqORKae(ES5oEprVxulp(b'Y'), chr(0b1000 + 0o134) + '\x65' + chr(99) + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(0b1100 + 0o150) + '\146' + '\x2d' + chr(2190 - 2134)).Y4yM9BcfTCNq(aq1hZ7caPTrG[:nzTpIcepk0o8(chr(0b110000) + chr(8051 - 7940) + chr(0b110011), 0o10)])
NmNJLWUI8tqd = aq1hZ7caPTrG[nzTpIcepk0o8(chr(0b1101 + 0o43) + '\x6f' + chr(51), 8)]
ikg_cqiv7B4I = uBaBygsuqCAv(d9gWGDfFIt43, NmNJLWUI8tqd)
sSGtvt7k_qV1[QsOaDmXlaIxZ] = ikg_cqiv7B4I
return ikg_cqiv7B4I
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
lemmas
|
def lemmas(lemma,pos=None):
"""Returns all the Lemma objects of which name is `lemma` and which have `pos` as part
of speech.
Parameters
----------
lemma : str
Literal of the sought Lemma objects.
pos : str, optional
Part of speech of the sought Lemma objects. If None, matches any part of speech.
Defaults to None
Returns
-------
list of Lemmas
Lists all the matched Lemmas.
"""
lemma = lemma.lower()
return [lemma_obj
for synset in synsets(lemma,pos)
for lemma_obj in synset.lemmas()
if lemma_obj.name.lower() == lemma]
|
python
|
def lemmas(lemma,pos=None):
"""Returns all the Lemma objects of which name is `lemma` and which have `pos` as part
of speech.
Parameters
----------
lemma : str
Literal of the sought Lemma objects.
pos : str, optional
Part of speech of the sought Lemma objects. If None, matches any part of speech.
Defaults to None
Returns
-------
list of Lemmas
Lists all the matched Lemmas.
"""
lemma = lemma.lower()
return [lemma_obj
for synset in synsets(lemma,pos)
for lemma_obj in synset.lemmas()
if lemma_obj.name.lower() == lemma]
|
[
"def",
"lemmas",
"(",
"lemma",
",",
"pos",
"=",
"None",
")",
":",
"lemma",
"=",
"lemma",
".",
"lower",
"(",
")",
"return",
"[",
"lemma_obj",
"for",
"synset",
"in",
"synsets",
"(",
"lemma",
",",
"pos",
")",
"for",
"lemma_obj",
"in",
"synset",
".",
"lemmas",
"(",
")",
"if",
"lemma_obj",
".",
"name",
".",
"lower",
"(",
")",
"==",
"lemma",
"]"
] |
Returns all the Lemma objects of which name is `lemma` and which have `pos` as part
of speech.
Parameters
----------
lemma : str
Literal of the sought Lemma objects.
pos : str, optional
Part of speech of the sought Lemma objects. If None, matches any part of speech.
Defaults to None
Returns
-------
list of Lemmas
Lists all the matched Lemmas.
|
[
"Returns",
"all",
"the",
"Lemma",
"objects",
"of",
"which",
"name",
"is",
"lemma",
"and",
"which",
"have",
"pos",
"as",
"part",
"of",
"speech",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L348-L369
|
train
|
Returns all the Lemmas of which name is lemma and which have pos as part
of speech.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedr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0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(111) + '\x32' + chr(0b110110) + '\x34', 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + '\062' + '\x36', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + '\066' + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(1563 - 1515) + chr(0b1101111) + chr(263 - 214) + chr(0b100 + 0o61) + '\061', 1501 - 1493), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(0b1101 + 0o50) + chr(2398 - 2349), 8), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(0b11101 + 0o32) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(6841 - 6730) + chr(1969 - 1918) + chr(0b1000 + 0o55), 0o10), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b1101111) + '\061' + chr(722 - 672), 13733 - 13725), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + chr(2382 - 2332) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(660 - 612) + '\157' + '\061' + chr(0b110100 + 0o3) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + '\x6f' + chr(810 - 760) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001) + chr(51) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001) + '\067' + chr(0b11011 + 0o34), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + '\063' + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\157' + '\061' + '\065' + chr(0b110001), 8), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110010) + chr(0b10111 + 0o31), 19386 - 19378), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\x6f' + chr(54) + chr(1067 - 1019), ord("\x08")), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b111100 + 0o63) + chr(0b110011) + chr(1442 - 1389) + chr(0b110000 + 0o2), 6837 - 6829), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(143 - 90) + chr(648 - 600), 2074 - 2066), nzTpIcepk0o8('\x30' + '\157' + chr(55) + chr(0b110111), 9686 - 9678), nzTpIcepk0o8('\x30' + chr(111) + chr(0b0 + 0o61) + chr(51) + '\062', 50127 - 50119), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(111) + chr(50) + chr(0b10001 + 0o37) + '\065', 3977 - 3969), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\066' + chr(52), 0o10), nzTpIcepk0o8('\x30' + chr(6962 - 6851) + chr(50) + chr(0b100001 + 0o20) + '\060', 0o10), nzTpIcepk0o8(chr(0b1010 + 0o46) + '\157' + '\061' + '\062' + chr(308 - 254), 32756 - 32748), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + '\060' + '\x30', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010) + '\060' + chr(830 - 781), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(2131 - 2082) + '\x30' + chr(0b10001 + 0o41), 9802 - 9794), nzTpIcepk0o8(chr(0b110000) + chr(413 - 302) + chr(0b110101) + chr(0b100 + 0o55), 0o10), nzTpIcepk0o8('\060' + chr(7438 - 7327) + chr(0b101110 + 0o3) + '\x35' + chr(0b110000 + 0o6), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(1183 - 1134), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110110) + '\x37', 22348 - 22340), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010) + chr(557 - 503) + chr(153 - 102), 35286 - 35278), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(111) + chr(908 - 858) + chr(55) + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1010110 + 0o31) + chr(504 - 455) + '\x32' + chr(0b110011 + 0o0), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b11100 + 0o26) + '\x33' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x33' + chr(0b110101) + '\x32', 8), nzTpIcepk0o8(chr(1043 - 995) + '\157' + '\061' + chr(0b10001 + 0o40) + chr(0b10010 + 0o44), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1234 - 1183), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + '\065' + chr(48), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9a'), '\144' + chr(101) + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def a5VtTAxz8uDl(W6axg8J0N9kP, IGIA_fu6MbaO=None):
W6axg8J0N9kP = W6axg8J0N9kP.Xn8ENWMZdIRt()
return [ikg_cqiv7B4I for J7DVXYlVh6vo in aasVOJCZfJgh(W6axg8J0N9kP, IGIA_fu6MbaO) for ikg_cqiv7B4I in roI3spqORKae(J7DVXYlVh6vo, roI3spqORKae(ES5oEprVxulp(b'\xd8\xb3\x99\x04\x08\x88'), '\x64' + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + '\x65')(chr(0b1010000 + 0o45) + '\x74' + '\146' + '\x2d' + chr(0b101110 + 0o12)))() if roI3spqORKae(ikg_cqiv7B4I.name, roI3spqORKae(ES5oEprVxulp(b"\xec\xb8\xcc,'\xacPP\xb06C-"), chr(100) + '\x65' + chr(7861 - 7762) + chr(0b110100 + 0o73) + '\x64' + chr(5718 - 5617))('\165' + chr(0b1110100) + chr(2390 - 2288) + chr(1367 - 1322) + chr(56)))() == W6axg8J0N9kP]
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset._recursive_hypernyms
|
def _recursive_hypernyms(self, hypernyms):
"""Finds all the hypernyms of the synset transitively.
Notes
-----
Internal method. Do not call directly.
Parameters
----------
hypernyms : set of Synsets
An set of hypernyms met so far.
Returns
-------
set of Synsets
Returns the input set.
"""
hypernyms |= set(self.hypernyms())
for synset in self.hypernyms():
hypernyms |= synset._recursive_hypernyms(hypernyms)
return hypernyms
|
python
|
def _recursive_hypernyms(self, hypernyms):
"""Finds all the hypernyms of the synset transitively.
Notes
-----
Internal method. Do not call directly.
Parameters
----------
hypernyms : set of Synsets
An set of hypernyms met so far.
Returns
-------
set of Synsets
Returns the input set.
"""
hypernyms |= set(self.hypernyms())
for synset in self.hypernyms():
hypernyms |= synset._recursive_hypernyms(hypernyms)
return hypernyms
|
[
"def",
"_recursive_hypernyms",
"(",
"self",
",",
"hypernyms",
")",
":",
"hypernyms",
"|=",
"set",
"(",
"self",
".",
"hypernyms",
"(",
")",
")",
"for",
"synset",
"in",
"self",
".",
"hypernyms",
"(",
")",
":",
"hypernyms",
"|=",
"synset",
".",
"_recursive_hypernyms",
"(",
"hypernyms",
")",
"return",
"hypernyms"
] |
Finds all the hypernyms of the synset transitively.
Notes
-----
Internal method. Do not call directly.
Parameters
----------
hypernyms : set of Synsets
An set of hypernyms met so far.
Returns
-------
set of Synsets
Returns the input set.
|
[
"Finds",
"all",
"the",
"hypernyms",
"of",
"the",
"synset",
"transitively",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L427-L449
|
train
|
Recursively finds all the hypernyms of the synset transitively.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5M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fuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1011011 + 0o24) + '\x31' + '\x35' + chr(53), 0o10), nzTpIcepk0o8('\060' + '\157' + '\x31' + chr(0b1 + 0o66) + chr(0b1011 + 0o46), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(5151 - 5040) + '\063' + chr(0b101111 + 0o10), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(1629 - 1518) + chr(0b10101 + 0o35) + '\x31' + chr(1450 - 1400), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(11479 - 11368) + chr(1779 - 1725) + chr(0b100011 + 0o24), 0b1000), nzTpIcepk0o8(chr(1628 - 1580) + chr(111) + chr(0b101111 + 0o4) + chr(0b10100 + 0o35) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(111) + chr(49), 8), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + '\x30' + chr(50), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b100100 + 0o113) + '\067' + chr(55), 0o10), nzTpIcepk0o8(chr(1978 - 1930) + chr(8470 - 8359) + chr(0b10 + 0o61) + chr(0b101 + 0o54) + '\x37', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1000010 + 0o55) + chr(0b11001 + 0o31) + chr(0b110111) + chr(1360 - 1307), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b11010 + 0o30) + chr(0b110111) + chr(0b110011), 19577 - 19569), nzTpIcepk0o8(chr(0b110000) + chr(5054 - 4943) + chr(50) + '\x33' + chr(312 - 263), 24004 - 23996), nzTpIcepk0o8(chr(0b110000) + chr(0b111 + 0o150) + chr(0b110010) + chr(0b11101 + 0o25), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\062' + chr(0b110110) + '\x34', 37665 - 37657), nzTpIcepk0o8('\x30' + '\157' + '\066' + chr(49), 0b1000), nzTpIcepk0o8('\x30' + chr(0b111011 + 0o64) + '\061' + chr(0b110111), 5575 - 5567), nzTpIcepk0o8(chr(368 - 320) + chr(0b1101111) + '\061' + chr(1110 - 1056) + '\x37', ord("\x08")), nzTpIcepk0o8('\x30' + chr(11857 - 11746) + chr(0b110001) + chr(1921 - 1867) + chr(0b110111), 8), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1011 + 0o144) + chr(0b11110 + 0o25) + '\065' + '\061', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(746 - 696) + chr(0b100011 + 0o24) + '\x30', 27799 - 27791), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + '\x34' + chr(55), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(49) + '\062', ord("\x08")), nzTpIcepk0o8('\060' + chr(9052 - 8941) + chr(0b110001) + chr(0b10010 + 0o44) + '\x32', 2653 - 2645), nzTpIcepk0o8(chr(48) + chr(0b1001111 + 0o40) + chr(49) + '\066' + chr(0b110 + 0o56), 0o10), nzTpIcepk0o8('\060' + '\157' + '\067' + '\x33', 0o10), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b1100110 + 0o11) + '\x31' + chr(179 - 124) + chr(597 - 544), ord("\x08")), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1010110 + 0o31) + chr(0b110101) + chr(51), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10001 + 0o45) + chr(2018 - 1964), ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(0b1101111) + '\061' + chr(0b110100) + '\x33', 61881 - 61873), nzTpIcepk0o8(chr(48) + chr(0b1001101 + 0o42) + chr(0b100110 + 0o13) + '\x34' + chr(2259 - 2206), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(1380 - 1330) + chr(1028 - 976) + chr(0b11001 + 0o33), 770 - 762), nzTpIcepk0o8(chr(0b11011 + 0o25) + '\157' + '\x33' + chr(0b110000) + chr(50), 10772 - 10764), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(7392 - 7281) + '\x34' + chr(55), 3636 - 3628), nzTpIcepk0o8('\x30' + '\157' + chr(1790 - 1741) + chr(137 - 82) + chr(800 - 746), 2053 - 2045), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(1665 - 1617) + chr(0b10011 + 0o42), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x35' + chr(0b1001 + 0o52), 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(555 - 506) + chr(584 - 535), ord("\x08")), nzTpIcepk0o8('\x30' + chr(4122 - 4011) + chr(49) + chr(0b110101), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(599 - 546) + chr(1252 - 1204), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'/'), '\x64' + chr(0b1100101) + chr(6665 - 6566) + chr(111) + '\144' + chr(0b110111 + 0o56))('\165' + chr(0b1101110 + 0o6) + chr(0b10110 + 0o120) + chr(0b100001 + 0o14) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def S011PMLiTXew(hXMPsSrOQzbh, DOVKLWKP2aLY):
DOVKLWKP2aLY |= Bvi71nNyvlqO(hXMPsSrOQzbh.hypernyms())
for J7DVXYlVh6vo in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'i\x14\tz\xf8Y\xb5l\xf1'), chr(0b1100100) + chr(101) + chr(99) + '\157' + chr(100) + '\x65')(chr(0b1110010 + 0o3) + chr(4502 - 4386) + '\x66' + chr(45) + chr(0b111000)))():
DOVKLWKP2aLY |= J7DVXYlVh6vo._recursive_hypernyms(DOVKLWKP2aLY)
return DOVKLWKP2aLY
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset._min_depth
|
def _min_depth(self):
"""Finds minimum path length from the root.
Notes
-----
Internal method. Do not call directly.
Returns
-------
int
Minimum path length from the root.
"""
if "min_depth" in self.__dict__:
return self.__dict__["min_depth"]
min_depth = 0
hypernyms = self.hypernyms()
if hypernyms:
min_depth = 1 + min(h._min_depth() for h in hypernyms)
self.__dict__["min_depth"] = min_depth
return min_depth
|
python
|
def _min_depth(self):
"""Finds minimum path length from the root.
Notes
-----
Internal method. Do not call directly.
Returns
-------
int
Minimum path length from the root.
"""
if "min_depth" in self.__dict__:
return self.__dict__["min_depth"]
min_depth = 0
hypernyms = self.hypernyms()
if hypernyms:
min_depth = 1 + min(h._min_depth() for h in hypernyms)
self.__dict__["min_depth"] = min_depth
return min_depth
|
[
"def",
"_min_depth",
"(",
"self",
")",
":",
"if",
"\"min_depth\"",
"in",
"self",
".",
"__dict__",
":",
"return",
"self",
".",
"__dict__",
"[",
"\"min_depth\"",
"]",
"min_depth",
"=",
"0",
"hypernyms",
"=",
"self",
".",
"hypernyms",
"(",
")",
"if",
"hypernyms",
":",
"min_depth",
"=",
"1",
"+",
"min",
"(",
"h",
".",
"_min_depth",
"(",
")",
"for",
"h",
"in",
"hypernyms",
")",
"self",
".",
"__dict__",
"[",
"\"min_depth\"",
"]",
"=",
"min_depth",
"return",
"min_depth"
] |
Finds minimum path length from the root.
Notes
-----
Internal method. Do not call directly.
Returns
-------
int
Minimum path length from the root.
|
[
"Finds",
"minimum",
"path",
"length",
"from",
"the",
"root",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da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PEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1010 + 0o50) + chr(0b1011 + 0o54) + '\065', 2084 - 2076), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(11297 - 11186) + chr(0b110111) + chr(52), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1100010 + 0o15) + '\061' + '\064' + '\062', 32822 - 32814), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(0b101110 + 0o101) + chr(0b110001) + '\066' + '\067', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10111 + 0o32) + chr(0b110000) + chr(0b110111), 35698 - 35690), nzTpIcepk0o8(chr(0b110000) + chr(0b0 + 0o157) + '\x33' + chr(0b1 + 0o66), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\x36' + chr(0b0 + 0o67), 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\x6f' + chr(0b110001) + chr(52) + chr(1542 - 1489), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + '\x31' + '\x37', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1010001 + 0o36) + chr(52), 0o10), nzTpIcepk0o8(chr(48) + chr(4347 - 4236) + chr(51) + chr(0b110101) + '\x31', 15194 - 15186), nzTpIcepk0o8('\060' + chr(111) + chr(1265 - 1214) + '\060' + '\x37', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1100011 + 0o14) + chr(0b10011 + 0o42) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b110100) + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1100101 + 0o12) + '\x33' + chr(0b110000) + '\067', 8), nzTpIcepk0o8(chr(0b110000) + chr(1296 - 1185) + '\x33' + '\x35' + '\060', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9395 - 9284) + chr(0b111 + 0o53) + '\x34', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b1011 + 0o50) + '\063' + chr(0b10 + 0o63), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + '\x37' + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(50) + '\061' + '\x31', 0b1000), nzTpIcepk0o8(chr(1103 - 1055) + '\x6f' + chr(0b11111 + 0o22) + chr(0b110111) + chr(0b110110), 0b1000), nzTpIcepk0o8('\060' + chr(0b1011101 + 0o22) + chr(1067 - 1013) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(12247 - 12136) + chr(49) + chr(0b110110) + '\062', 0b1000), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b1101111) + '\x31' + '\x33' + chr(50), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\067' + chr(0b100000 + 0o25), 0o10), nzTpIcepk0o8('\x30' + chr(1513 - 1402) + chr(0b101 + 0o55) + '\x35' + chr(720 - 666), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1100011 + 0o14) + '\x33' + chr(0b101011 + 0o14) + '\x35', 0o10), nzTpIcepk0o8(chr(1965 - 1917) + '\x6f' + chr(0b110011) + chr(1802 - 1754) + chr(0b110 + 0o55), 0o10), nzTpIcepk0o8(chr(517 - 469) + '\x6f' + chr(51) + chr(49) + chr(0b11110 + 0o31), ord("\x08")), nzTpIcepk0o8(chr(749 - 701) + chr(111) + '\x33' + '\062' + chr(55), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(11197 - 11086) + chr(0b110001) + '\066' + chr(0b110010), 8), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + '\x32' + chr(54), 0b1000), nzTpIcepk0o8(chr(1676 - 1628) + chr(3164 - 3053) + chr(0b110010) + chr(0b100101 + 0o20) + chr(2575 - 2522), 38757 - 38749), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + chr(51) + '\064', ord("\x08")), nzTpIcepk0o8(chr(1522 - 1474) + '\157' + chr(217 - 162) + chr(0b10 + 0o61), 0b1000), nzTpIcepk0o8(chr(0b11000 + 0o30) + '\x6f' + chr(0b100101 + 0o15) + chr(1805 - 1757) + chr(0b10010 + 0o44), 0o10), nzTpIcepk0o8('\x30' + chr(5059 - 4948) + chr(49) + '\060' + chr(53), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + '\061' + chr(2759 - 2704), 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110010) + '\065' + chr(0b101001 + 0o13), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(2036 - 1985) + chr(0b11010 + 0o30) + '\x30', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\x6f' + chr(0b100011 + 0o22) + '\060', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x93'), chr(0b101110 + 0o66) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b110000 + 0o64) + chr(0b1100101))(chr(7532 - 7415) + chr(341 - 225) + chr(0b101100 + 0o72) + chr(0b101101) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def tRP7Ru2bIU8_(hXMPsSrOQzbh):
if roI3spqORKae(ES5oEprVxulp(b"\xd0U\x0c(#zG\x11'"), '\144' + chr(0b1010000 + 0o25) + '\x63' + chr(0b1101110 + 0o1) + chr(0b1100100) + chr(0b10011 + 0o122))(chr(11059 - 10942) + chr(3669 - 3553) + chr(0b1100110) + chr(630 - 585) + '\070') in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcbrU\x16v\\r\x04=P\x9b\x93'), chr(2550 - 2450) + chr(0b11110 + 0o107) + chr(99) + '\157' + '\144' + chr(237 - 136))(chr(0b1110101) + chr(116) + '\146' + chr(45) + '\070')):
return roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xcbrU\x16v\\r\x04=P\x9b\x93'), chr(0b100101 + 0o77) + chr(0b111010 + 0o53) + chr(99) + '\x6f' + chr(0b1100100) + chr(101))(chr(117) + '\x74' + chr(102) + chr(402 - 357) + '\070'))[roI3spqORKae(ES5oEprVxulp(b"\xd0U\x0c(#zG\x11'"), chr(959 - 859) + chr(101) + '\143' + chr(0b1101111) + chr(2440 - 2340) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56))]
Tkf2if82cAyR = nzTpIcepk0o8(chr(898 - 850) + chr(8444 - 8333) + '\x30', ord("\x08"))
DOVKLWKP2aLY = hXMPsSrOQzbh.hypernyms()
if DOVKLWKP2aLY:
Tkf2if82cAyR = nzTpIcepk0o8(chr(48) + chr(0b1010101 + 0o32) + '\x31', 0o10) + XURpmPuEWCNF((_9ve2uheHd6a._min_depth() for _9ve2uheHd6a in DOVKLWKP2aLY))
hXMPsSrOQzbh.vN7a1CEarTrT[roI3spqORKae(ES5oEprVxulp(b"\xd0U\x0c(#zG\x11'"), '\x64' + '\145' + chr(99) + chr(0b110010 + 0o75) + '\144' + '\x65')(chr(0b1001 + 0o154) + '\164' + chr(0b110100 + 0o62) + chr(810 - 765) + chr(0b110000 + 0o10))] = Tkf2if82cAyR
return Tkf2if82cAyR
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.get_related_synsets
|
def get_related_synsets(self,relation):
"""Retrieves all the synsets which are related by given relation.
Parameters
----------
relation : str
Name of the relation via which the sought synsets are linked.
Returns
-------
list of Synsets
Synsets which are related via `relation`.
"""
results = []
for relation_candidate in self._raw_synset.internalLinks:
if relation_candidate.name == relation:
linked_synset = synset(_get_key_from_raw_synset(relation_candidate.target_concept))
relation_candidate.target_concept = linked_synset._raw_synset
results.append(linked_synset)
return results
|
python
|
def get_related_synsets(self,relation):
"""Retrieves all the synsets which are related by given relation.
Parameters
----------
relation : str
Name of the relation via which the sought synsets are linked.
Returns
-------
list of Synsets
Synsets which are related via `relation`.
"""
results = []
for relation_candidate in self._raw_synset.internalLinks:
if relation_candidate.name == relation:
linked_synset = synset(_get_key_from_raw_synset(relation_candidate.target_concept))
relation_candidate.target_concept = linked_synset._raw_synset
results.append(linked_synset)
return results
|
[
"def",
"get_related_synsets",
"(",
"self",
",",
"relation",
")",
":",
"results",
"=",
"[",
"]",
"for",
"relation_candidate",
"in",
"self",
".",
"_raw_synset",
".",
"internalLinks",
":",
"if",
"relation_candidate",
".",
"name",
"==",
"relation",
":",
"linked_synset",
"=",
"synset",
"(",
"_get_key_from_raw_synset",
"(",
"relation_candidate",
".",
"target_concept",
")",
")",
"relation_candidate",
".",
"target_concept",
"=",
"linked_synset",
".",
"_raw_synset",
"results",
".",
"append",
"(",
"linked_synset",
")",
"return",
"results"
] |
Retrieves all the synsets which are related by given relation.
Parameters
----------
relation : str
Name of the relation via which the sought synsets are linked.
Returns
-------
list of Synsets
Synsets which are related via `relation`.
|
[
"Retrieves",
"all",
"the",
"synsets",
"which",
"are",
"related",
"by",
"given",
"relation",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L543-L564
|
train
|
Retrieves all the synsets which are related by given relation.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E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kv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1000 + 0o57) + chr(48), 0b1000), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(0b1101111) + '\x31' + chr(54) + '\063', 47477 - 47469), nzTpIcepk0o8(chr(0b110000) + chr(0b10001 + 0o136) + '\062' + '\063' + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\x6f' + chr(0b110011) + chr(51), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(843 - 794) + chr(0b100 + 0o55) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + chr(590 - 536), 20079 - 20071), nzTpIcepk0o8(chr(48) + '\157' + chr(2225 - 2175) + chr(0b110011) + '\064', 63038 - 63030), nzTpIcepk0o8(chr(0b110 + 0o52) + '\x6f' + '\060', 30582 - 30574), nzTpIcepk0o8('\060' + chr(0b101111 + 0o100) + chr(0b10111 + 0o34) + '\x31' + chr(0b100101 + 0o15), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1000 + 0o147) + '\063' + chr(48) + '\063', 0b1000), nzTpIcepk0o8(chr(48) + chr(5941 - 5830) + chr(0b100111 + 0o13) + chr(0b101100 + 0o10) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(0b110011 + 0o1) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(722 - 674) + chr(0b11101 + 0o122) + chr(0b110011) + chr(53) + chr(658 - 607), 9923 - 9915), nzTpIcepk0o8(chr(48) + '\x6f' + chr(49) + chr(0b110000) + '\062', 7414 - 7406), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + '\x33' + chr(0b110011), 9891 - 9883), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1977 - 1928) + '\x32' + chr(51), 0o10), nzTpIcepk0o8('\x30' + chr(6602 - 6491) + '\x33' + chr(486 - 436) + chr(55), 64827 - 64819), nzTpIcepk0o8(chr(1821 - 1773) + chr(111) + '\061' + chr(0b110010) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(4671 - 4560) + chr(0b1010 + 0o51) + chr(52) + chr(1034 - 980), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(1881 - 1830) + chr(2070 - 2015) + '\066', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1000011 + 0o54) + chr(49) + '\x37' + chr(1457 - 1403), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(463 - 411) + chr(0b110100), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b11 + 0o64) + chr(2364 - 2311), 61172 - 61164), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(111) + chr(0b10011 + 0o36), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101010 + 0o5) + chr(0b110011 + 0o0) + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(8190 - 8079) + chr(0b10 + 0o61) + chr(54) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(111) + chr(51) + '\x30' + chr(0b101101 + 0o11), 51823 - 51815), nzTpIcepk0o8(chr(1733 - 1685) + '\x6f' + chr(54) + chr(0b110100 + 0o2), 0o10), nzTpIcepk0o8(chr(48) + chr(9861 - 9750) + '\x31' + '\067' + chr(0b101001 + 0o11), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\063' + chr(51) + '\x36', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b101111 + 0o4) + '\x37' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b110011 + 0o74) + chr(0b110001) + chr(1900 - 1847) + chr(0b101001 + 0o13), 64025 - 64017), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(0b110100) + chr(1289 - 1240), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(5216 - 5105) + chr(0b110111) + chr(54), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1011111 + 0o20) + '\061' + chr(0b110110) + chr(0b110110 + 0o1), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + '\x34' + chr(0b110010 + 0o2), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101001 + 0o12) + chr(50) + chr(55), 8), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b1101111) + '\062' + chr(0b10111 + 0o36) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(7432 - 7321) + chr(49) + chr(0b110011) + chr(1066 - 1014), 31412 - 31404)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1584 - 1536) + '\x6f' + chr(0b101101 + 0o10) + '\x30', 33512 - 33504)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x16'), chr(0b1100000 + 0o4) + '\145' + chr(7732 - 7633) + chr(474 - 363) + '\144' + chr(0b101000 + 0o75))(chr(1996 - 1879) + '\164' + '\146' + '\055' + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def G23xPkltKA8S(hXMPsSrOQzbh, h0XevmlsMM2m):
v3B6eeO_B_ws = []
for wlG7_roxlW7K in roI3spqORKae(hXMPsSrOQzbh._raw_synset, roI3spqORKae(ES5oEprVxulp(b'Q\x1d\xef~:x\xfdl\x86\xaa\xce\x0f\x98'), chr(100) + chr(101) + '\x63' + chr(0b1001000 + 0o47) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(0b100010 + 0o13) + '\070')):
if roI3spqORKae(wlG7_roxlW7K, roI3spqORKae(ES5oEprVxulp(b'k?\xcdYzT\xccA\x95\xae\xe9\x01'), '\144' + chr(0b1100101) + '\x63' + '\x6f' + chr(0b1001 + 0o133) + chr(101))(chr(117) + chr(116) + chr(0b110100 + 0o62) + chr(0b101000 + 0o5) + '\070')) == h0XevmlsMM2m:
cY2_2liy2Ql5 = J7DVXYlVh6vo(VD1zkizP4nvh(wlG7_roxlW7K.target_concept))
wlG7_roxlW7K.mCptBYxJKOYh = cY2_2liy2Ql5._raw_synset
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b"p'\xc8/0q\xdbo\xa0\xac\xf5Q"), chr(100) + '\x65' + chr(0b10110 + 0o115) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(7263 - 7146) + '\164' + chr(10247 - 10145) + chr(836 - 791) + '\070'))(cY2_2liy2Ql5)
return v3B6eeO_B_ws
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.closure
|
def closure(self, relation, depth=float('inf')):
"""Finds all the ancestors of the synset using provided relation.
Parameters
----------
relation : str
Name of the relation which is recursively used to fetch the ancestors.
Returns
-------
list of Synsets
Returns the ancestors of the synset via given relations.
"""
ancestors = []
unvisited_ancestors = [(synset,1) for synset in self.get_related_synsets(relation)]
while len(unvisited_ancestors) > 0:
ancestor_depth = unvisited_ancestors.pop()
if ancestor_depth[1] > depth:
continue
unvisited_ancestors.extend([(synset,ancestor_depth[1]+1) for synset in ancestor_depth[0].get_related_synsets(relation)])
ancestors.append(ancestor_depth[0])
return list(set(ancestors))
|
python
|
def closure(self, relation, depth=float('inf')):
"""Finds all the ancestors of the synset using provided relation.
Parameters
----------
relation : str
Name of the relation which is recursively used to fetch the ancestors.
Returns
-------
list of Synsets
Returns the ancestors of the synset via given relations.
"""
ancestors = []
unvisited_ancestors = [(synset,1) for synset in self.get_related_synsets(relation)]
while len(unvisited_ancestors) > 0:
ancestor_depth = unvisited_ancestors.pop()
if ancestor_depth[1] > depth:
continue
unvisited_ancestors.extend([(synset,ancestor_depth[1]+1) for synset in ancestor_depth[0].get_related_synsets(relation)])
ancestors.append(ancestor_depth[0])
return list(set(ancestors))
|
[
"def",
"closure",
"(",
"self",
",",
"relation",
",",
"depth",
"=",
"float",
"(",
"'inf'",
")",
")",
":",
"ancestors",
"=",
"[",
"]",
"unvisited_ancestors",
"=",
"[",
"(",
"synset",
",",
"1",
")",
"for",
"synset",
"in",
"self",
".",
"get_related_synsets",
"(",
"relation",
")",
"]",
"while",
"len",
"(",
"unvisited_ancestors",
")",
">",
"0",
":",
"ancestor_depth",
"=",
"unvisited_ancestors",
".",
"pop",
"(",
")",
"if",
"ancestor_depth",
"[",
"1",
"]",
">",
"depth",
":",
"continue",
"unvisited_ancestors",
".",
"extend",
"(",
"[",
"(",
"synset",
",",
"ancestor_depth",
"[",
"1",
"]",
"+",
"1",
")",
"for",
"synset",
"in",
"ancestor_depth",
"[",
"0",
"]",
".",
"get_related_synsets",
"(",
"relation",
")",
"]",
")",
"ancestors",
".",
"append",
"(",
"ancestor_depth",
"[",
"0",
"]",
")",
"return",
"list",
"(",
"set",
"(",
"ancestors",
")",
")"
] |
Finds all the ancestors of the synset using provided relation.
Parameters
----------
relation : str
Name of the relation which is recursively used to fetch the ancestors.
Returns
-------
list of Synsets
Returns the ancestors of the synset via given relations.
|
[
"Finds",
"all",
"the",
"ancestors",
"of",
"the",
"synset",
"using",
"provided",
"relation",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L566-L591
|
train
|
Finds all the ancestors of the synset using the given relation.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf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YU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(10784 - 10673) + chr(1583 - 1534) + chr(0b110010) + '\063', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100011 + 0o16) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001) + chr(1918 - 1867) + chr(636 - 588), 0b1000), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(5940 - 5829) + '\061' + chr(1938 - 1884) + chr(52), 0o10), nzTpIcepk0o8(chr(2250 - 2202) + '\157' + '\062' + chr(0b10111 + 0o37) + '\x37', 3090 - 3082), nzTpIcepk0o8(chr(48) + chr(0b111 + 0o150) + chr(2282 - 2231) + chr(1314 - 1259), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101100 + 0o3) + '\x37' + chr(0b101 + 0o54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110100 + 0o2) + chr(55), 33378 - 33370), nzTpIcepk0o8('\060' + '\x6f' + chr(54), 0b1000), nzTpIcepk0o8('\x30' + chr(3596 - 3485) + chr(0b101000 + 0o12) + '\063' + chr(0b11001 + 0o32), 27664 - 27656), nzTpIcepk0o8(chr(0b110000) + chr(6351 - 6240) + chr(202 - 153) + chr(0b1100 + 0o45) + chr(48), 14912 - 14904), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + chr(54) + '\066', 0b1000), nzTpIcepk0o8('\x30' + chr(2580 - 2469) + '\062' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(1303 - 1255) + chr(6306 - 6195) + chr(0b1111 + 0o43) + chr(1267 - 1215) + '\x30', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b100 + 0o56) + '\061' + '\062', 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + chr(2223 - 2172) + '\x37', 8), nzTpIcepk0o8('\x30' + chr(0b1101101 + 0o2) + chr(51) + chr(0b101100 + 0o5) + '\065', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(0b110010) + '\062', 47127 - 47119), nzTpIcepk0o8(chr(717 - 669) + chr(0b1101111) + '\x32' + chr(0b110100) + chr(0b101101 + 0o11), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b1100 + 0o50) + '\064', 0o10), nzTpIcepk0o8(chr(1038 - 990) + chr(0b1010110 + 0o31) + '\066' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(2488 - 2436) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(2446 - 2396) + chr(0b110101) + chr(0b11010 + 0o33), ord("\x08")), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1000101 + 0o52) + chr(0b100010 + 0o17) + chr(1466 - 1411) + chr(2206 - 2151), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110 + 0o53) + '\067' + chr(1888 - 1840), 0b1000), nzTpIcepk0o8(chr(877 - 829) + chr(0b1101111) + chr(0b101101 + 0o6) + '\067' + '\x32', 42990 - 42982), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b111 + 0o57) + chr(49), 59226 - 59218), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + chr(0b110101) + '\x36', 0b1000), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\x6f' + '\062' + '\x36' + '\066', ord("\x08")), nzTpIcepk0o8('\060' + chr(2227 - 2116) + chr(0b110010) + chr(0b110001) + chr(1826 - 1776), 8), nzTpIcepk0o8(chr(0b11 + 0o55) + '\x6f' + '\060', 0o10), nzTpIcepk0o8(chr(1334 - 1286) + chr(111) + '\x32' + '\x31' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b100011 + 0o114) + chr(0b101000 + 0o11) + chr(0b110010) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + chr(595 - 484) + chr(181 - 130) + chr(0b101110 + 0o10) + chr(0b101000 + 0o15), ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(111) + chr(0b10000 + 0o41) + '\067', 14293 - 14285), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(0b1101000 + 0o7) + chr(0b110010) + chr(48) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + chr(53) + chr(1072 - 1024), 20732 - 20724), nzTpIcepk0o8('\060' + chr(111) + '\062' + '\x32' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(1110 - 1062) + chr(0b1010110 + 0o31) + chr(50) + chr(0b0 + 0o65) + chr(0b100100 + 0o15), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(2003 - 1955) + chr(0b100010 + 0o115) + chr(0b110101) + chr(48), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'}'), chr(0b110110 + 0o56) + '\x65' + chr(99) + chr(0b1101111) + '\x64' + chr(0b1010100 + 0o21))(chr(9849 - 9732) + chr(116) + '\146' + '\x2d' + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def qv2vA2lQDwdU(hXMPsSrOQzbh, h0XevmlsMM2m, UH0YjwuI_XzX=jLW6pRf2DSRk(roI3spqORKae(ES5oEprVxulp(b':g>'), '\x64' + chr(0b1100101) + '\x63' + '\x6f' + '\x64' + chr(5062 - 4961))('\165' + chr(0b1110100) + chr(102) + '\055' + chr(56)))):
vJFg7Um8apiB = []
qcDDiVLLvslV = [(J7DVXYlVh6vo, nzTpIcepk0o8(chr(2216 - 2168) + '\157' + chr(1514 - 1465), 0b1000)) for J7DVXYlVh6vo in hXMPsSrOQzbh.get_related_synsets(h0XevmlsMM2m)]
while ftfygxgFas5X(qcDDiVLLvslV) > nzTpIcepk0o8(chr(0b110000) + chr(111) + '\060', 8):
jOqSnIB_ZMby = qcDDiVLLvslV.uC_Yoybx7J0I()
if jOqSnIB_ZMby[nzTpIcepk0o8(chr(594 - 546) + chr(0b1101111) + '\061', 8)] > UH0YjwuI_XzX:
continue
roI3spqORKae(qcDDiVLLvslV, roI3spqORKae(ES5oEprVxulp(b'\x07Vk9\xd8{u`Y\xd9*\x87'), '\144' + chr(3535 - 3434) + chr(0b1011010 + 0o11) + chr(111) + '\x64' + '\145')('\165' + chr(6977 - 6861) + chr(9579 - 9477) + '\x2d' + '\070'))([(J7DVXYlVh6vo, jOqSnIB_ZMby[nzTpIcepk0o8(chr(0b110000) + chr(0b100000 + 0o117) + chr(0b110001), 8)] + nzTpIcepk0o8(chr(1840 - 1792) + chr(0b111011 + 0o64) + '\061', 8)) for J7DVXYlVh6vo in roI3spqORKae(jOqSnIB_ZMby[nzTpIcepk0o8('\060' + chr(0b1101111) + '\060', 8)], roI3spqORKae(ES5oEprVxulp(b'4l,+\xc5zUVr\xfe,\xa9c\xd9\xe4l\xa8\xa6\xd5'), chr(100) + chr(6885 - 6784) + chr(0b1000111 + 0o34) + '\x6f' + '\x64' + chr(0b101101 + 0o70))('\x75' + chr(116) + '\146' + '\055' + '\070'))(h0XevmlsMM2m)])
roI3spqORKae(vJFg7Um8apiB, roI3spqORKae(ES5oEprVxulp(b'\x1b]\x0b@\xcfx~Xl\xf4\x1d\xc3'), '\x64' + chr(0b1100101) + chr(99) + '\x6f' + chr(1392 - 1292) + '\145')(chr(0b1110000 + 0o5) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(56)))(jOqSnIB_ZMby[nzTpIcepk0o8('\060' + '\157' + chr(0b110000), 8)])
return H4NoA26ON7iG(Bvi71nNyvlqO(vJFg7Um8apiB))
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.root_hypernyms
|
def root_hypernyms(self):
"""Retrieves all the root hypernyms.
Returns
-------
list of Synsets
Roots via hypernymy relation.
"""
visited = set()
hypernyms_next_level = set(self.hypernyms())
current_hypernyms = set(hypernyms_next_level)
while len(hypernyms_next_level) > 0:
current_hypernyms = set(hypernyms_next_level)
hypernyms_next_level = set()
for synset in current_hypernyms:
if synset in visited:
continue
visited.add(synset)
hypernyms_next_level |= set(synset.hypernyms())
return list(current_hypernyms)
|
python
|
def root_hypernyms(self):
"""Retrieves all the root hypernyms.
Returns
-------
list of Synsets
Roots via hypernymy relation.
"""
visited = set()
hypernyms_next_level = set(self.hypernyms())
current_hypernyms = set(hypernyms_next_level)
while len(hypernyms_next_level) > 0:
current_hypernyms = set(hypernyms_next_level)
hypernyms_next_level = set()
for synset in current_hypernyms:
if synset in visited:
continue
visited.add(synset)
hypernyms_next_level |= set(synset.hypernyms())
return list(current_hypernyms)
|
[
"def",
"root_hypernyms",
"(",
"self",
")",
":",
"visited",
"=",
"set",
"(",
")",
"hypernyms_next_level",
"=",
"set",
"(",
"self",
".",
"hypernyms",
"(",
")",
")",
"current_hypernyms",
"=",
"set",
"(",
"hypernyms_next_level",
")",
"while",
"len",
"(",
"hypernyms_next_level",
")",
">",
"0",
":",
"current_hypernyms",
"=",
"set",
"(",
"hypernyms_next_level",
")",
"hypernyms_next_level",
"=",
"set",
"(",
")",
"for",
"synset",
"in",
"current_hypernyms",
":",
"if",
"synset",
"in",
"visited",
":",
"continue",
"visited",
".",
"add",
"(",
"synset",
")",
"hypernyms_next_level",
"|=",
"set",
"(",
"synset",
".",
"hypernyms",
"(",
")",
")",
"return",
"list",
"(",
"current_hypernyms",
")"
] |
Retrieves all the root hypernyms.
Returns
-------
list of Synsets
Roots via hypernymy relation.
|
[
"Retrieves",
"all",
"the",
"root",
"hypernyms",
".",
"Returns",
"-------",
"list",
"of",
"Synsets",
"Roots",
"via",
"hypernymy",
"relation",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L648-L671
|
train
|
Retrieves all the root hypernyms.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB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wTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(7221 - 7110) + chr(0b101110 + 0o4) + chr(0b110101) + chr(55), 4672 - 4664), nzTpIcepk0o8(chr(1850 - 1802) + '\x6f' + chr(1454 - 1403) + chr(0b1000 + 0o50) + chr(1109 - 1057), 49967 - 49959), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\067' + chr(0b101010 + 0o13), 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1100001 + 0o16) + chr(0b110100) + chr(0b110100 + 0o0), ord("\x08")), nzTpIcepk0o8(chr(2252 - 2204) + chr(0b1101111) + '\x32' + chr(0b110111) + '\063', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + chr(50) + '\x33', 534 - 526), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + chr(1855 - 1803) + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1100101 + 0o12) + chr(0b110011) + '\x35' + '\067', 44488 - 44480), nzTpIcepk0o8(chr(493 - 445) + chr(2047 - 1936) + chr(1220 - 1170) + '\062' + '\066', ord("\x08")), nzTpIcepk0o8('\060' + chr(6896 - 6785) + '\x31' + '\065', 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b1101 + 0o142) + chr(961 - 912) + '\062', 0o10), nzTpIcepk0o8('\060' + chr(111) + '\063' + chr(0b100101 + 0o15) + chr(55), 9028 - 9020), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b10111 + 0o130) + '\x33' + '\064' + chr(49), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1001110 + 0o41) + chr(50) + chr(0b1111 + 0o41) + '\065', 43482 - 43474), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(111) + chr(0b111 + 0o54) + chr(55) + '\x37', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b100111 + 0o13) + chr(0b110111), 14871 - 14863), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(2619 - 2508) + chr(0b101111 + 0o4) + chr(0b110011) + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1011100 + 0o23) + chr(0b110011) + chr(0b1110 + 0o45) + chr(0b1111 + 0o45), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + '\063' + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(1637 - 1587) + '\x36' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(1645 - 1597) + chr(0b10111 + 0o130) + '\x32' + chr(0b110111) + chr(1789 - 1736), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(159 - 110) + '\066' + chr(1655 - 1604), 34925 - 34917), nzTpIcepk0o8(chr(48) + chr(0b111101 + 0o62) + chr(51) + chr(803 - 754) + chr(0b110011), 0o10), nzTpIcepk0o8('\x30' + chr(2647 - 2536) + chr(0b110011) + '\065' + '\x30', 24875 - 24867), nzTpIcepk0o8(chr(0b110000) + chr(7619 - 7508) + chr(2232 - 2183) + chr(55) + chr(471 - 418), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101101 + 0o2) + chr(0b110001) + chr(49) + chr(0b11011 + 0o33), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b10100 + 0o133) + '\x31' + chr(0b111 + 0o56) + chr(0b110101), ord("\x08")), nzTpIcepk0o8('\060' + chr(5355 - 5244) + chr(0b101101 + 0o6) + chr(0b110100) + chr(2731 - 2678), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110100), 61982 - 61974), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001) + chr(0b100011 + 0o15) + chr(55), 0o10), nzTpIcepk0o8(chr(48) + chr(1434 - 1323) + chr(49) + chr(0b1 + 0o60) + chr(0b10011 + 0o37), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(0b110011) + '\x35', 8), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(4186 - 4075) + '\x31' + chr(0b10101 + 0o35) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b100010 + 0o20) + chr(1847 - 1798) + chr(51), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x31' + '\x31' + chr(1402 - 1353), 12517 - 12509), nzTpIcepk0o8(chr(1331 - 1283) + '\x6f' + chr(49) + '\x32' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(4459 - 4348) + chr(1903 - 1853) + chr(53) + chr(52), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(0b101111 + 0o4) + chr(0b110100 + 0o2) + chr(48), ord("\x08")), nzTpIcepk0o8(chr(1126 - 1078) + chr(0b101 + 0o152) + chr(55), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(74 - 26) + chr(0b1101111) + chr(53) + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x81'), chr(6792 - 6692) + '\x65' + chr(0b1010010 + 0o21) + chr(111) + chr(4882 - 4782) + chr(0b1100101 + 0o0))(chr(12093 - 11976) + chr(5336 - 5220) + chr(0b101 + 0o141) + chr(1012 - 967) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def GwyZ1LWIzcZw(hXMPsSrOQzbh):
TqxMRggTyjOU = Bvi71nNyvlqO()
ubLK0ipODanh = Bvi71nNyvlqO(hXMPsSrOQzbh.hypernyms())
GNgpKw4LPMEs = Bvi71nNyvlqO(ubLK0ipODanh)
while ftfygxgFas5X(ubLK0ipODanh) > nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110000), 0o10):
GNgpKw4LPMEs = Bvi71nNyvlqO(ubLK0ipODanh)
ubLK0ipODanh = Bvi71nNyvlqO()
for J7DVXYlVh6vo in GNgpKw4LPMEs:
if J7DVXYlVh6vo in TqxMRggTyjOU:
continue
roI3spqORKae(TqxMRggTyjOU, roI3spqORKae(ES5oEprVxulp(b'\xda\xf7l@\xd2\xe0/\x9e\xd2kI\xb3'), chr(100) + chr(0b11111 + 0o106) + chr(682 - 583) + chr(0b1100000 + 0o17) + chr(0b111001 + 0o53) + '\145')(chr(0b1101110 + 0o7) + '\x74' + '\146' + '\055' + '\x38'))(J7DVXYlVh6vo)
ubLK0ipODanh |= Bvi71nNyvlqO(J7DVXYlVh6vo.hypernyms())
return H4NoA26ON7iG(GNgpKw4LPMEs)
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.lch_similarity
|
def lch_similarity(self, synset):
"""Calculates Leacock and Chodorow's similarity between the two synsets.
Notes
-----
Similarity is calculated using the formula -log( (dist(synset1,synset2)+1) / (2*maximum taxonomy depth) ).
Parameters
----------
synset : Synset
Synset from which the similarity is calculated.
Returns
-------
float
Leacock and Chodorow's from `synset`.
None, if synsets are not connected via hypernymy/hyponymy relations. Obvious, if part-of-speeches don't match.
"""
if self._raw_synset.pos != synset._raw_synset.pos:
return None
depth = MAX_TAXONOMY_DEPTHS[self._raw_synset.pos]
distance = self._shortest_path_distance(synset)
if distance >= 0:
return -math.log((distance + 1) / (2.0 * depth))
else:
return None
|
python
|
def lch_similarity(self, synset):
"""Calculates Leacock and Chodorow's similarity between the two synsets.
Notes
-----
Similarity is calculated using the formula -log( (dist(synset1,synset2)+1) / (2*maximum taxonomy depth) ).
Parameters
----------
synset : Synset
Synset from which the similarity is calculated.
Returns
-------
float
Leacock and Chodorow's from `synset`.
None, if synsets are not connected via hypernymy/hyponymy relations. Obvious, if part-of-speeches don't match.
"""
if self._raw_synset.pos != synset._raw_synset.pos:
return None
depth = MAX_TAXONOMY_DEPTHS[self._raw_synset.pos]
distance = self._shortest_path_distance(synset)
if distance >= 0:
return -math.log((distance + 1) / (2.0 * depth))
else:
return None
|
[
"def",
"lch_similarity",
"(",
"self",
",",
"synset",
")",
":",
"if",
"self",
".",
"_raw_synset",
".",
"pos",
"!=",
"synset",
".",
"_raw_synset",
".",
"pos",
":",
"return",
"None",
"depth",
"=",
"MAX_TAXONOMY_DEPTHS",
"[",
"self",
".",
"_raw_synset",
".",
"pos",
"]",
"distance",
"=",
"self",
".",
"_shortest_path_distance",
"(",
"synset",
")",
"if",
"distance",
">=",
"0",
":",
"return",
"-",
"math",
".",
"log",
"(",
"(",
"distance",
"+",
"1",
")",
"/",
"(",
"2.0",
"*",
"depth",
")",
")",
"else",
":",
"return",
"None"
] |
Calculates Leacock and Chodorow's similarity between the two synsets.
Notes
-----
Similarity is calculated using the formula -log( (dist(synset1,synset2)+1) / (2*maximum taxonomy depth) ).
Parameters
----------
synset : Synset
Synset from which the similarity is calculated.
Returns
-------
float
Leacock and Chodorow's from `synset`.
None, if synsets are not connected via hypernymy/hyponymy relations. Obvious, if part-of-speeches don't match.
|
[
"Calculates",
"Leacock",
"and",
"Chodorow",
"s",
"similarity",
"between",
"the",
"two",
"synsets",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L694-L724
|
train
|
Calculates Leacock and Chodorow s similarity between two synsets.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_Hp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JqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b10001 + 0o37) + chr(111) + '\x31' + '\066' + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(820 - 770) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b1 + 0o62) + '\064' + chr(0b110111), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b100101 + 0o15) + '\065', 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\063' + chr(593 - 542) + chr(0b100100 + 0o21), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(5613 - 5502) + chr(50) + chr(51) + '\x34', 8744 - 8736), nzTpIcepk0o8('\060' + chr(111) + chr(837 - 787) + '\x31' + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b11 + 0o56) + '\064' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + '\065' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x34' + chr(2217 - 2164), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1579 - 1529) + '\060' + chr(0b10 + 0o61), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(3144 - 3033) + chr(1242 - 1192) + chr(0b110110) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b1101 + 0o142) + chr(0b110010) + '\x36', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b101100 + 0o103) + chr(49) + '\x30' + '\061', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b111 + 0o52) + '\065' + '\066', 8), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(3391 - 3280) + chr(0b110010) + chr(1309 - 1261), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1100110 + 0o11) + chr(51) + chr(51) + chr(1445 - 1394), 46255 - 46247), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(111) + chr(50) + '\x30' + chr(555 - 505), 16520 - 16512), nzTpIcepk0o8('\x30' + chr(0b11010 + 0o125) + chr(868 - 817) + chr(0b110100) + chr(0b11101 + 0o26), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1100001 + 0o16) + chr(0b100001 + 0o20) + chr(0b110011) + '\061', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b0 + 0o63) + chr(49) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1101111) + chr(335 - 284) + '\060' + '\x34', 33698 - 33690), nzTpIcepk0o8(chr(0b110000) + chr(0b1001010 + 0o45) + '\x31' + '\060' + '\x36', 0o10), nzTpIcepk0o8(chr(180 - 132) + chr(0b1101111) + chr(0b110010) + '\x31' + chr(48), 8), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b1101111) + '\x31' + chr(0b100000 + 0o20) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(2204 - 2154) + chr(52) + '\x32', 0b1000), nzTpIcepk0o8('\060' + chr(3617 - 3506) + '\061' + '\062' + chr(0b110010), 6867 - 6859), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(54) + chr(1648 - 1598), 57455 - 57447), nzTpIcepk0o8(chr(48) + '\157' + '\x35' + '\x36', 0o10), nzTpIcepk0o8(chr(450 - 402) + '\157' + chr(1182 - 1132) + chr(52) + '\x30', 30379 - 30371), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(596 - 547) + '\x34' + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(0b110111) + chr(55), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110010) + chr(49) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(1325 - 1277) + '\157' + chr(0b111 + 0o52) + '\061' + chr(1772 - 1720), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b10 + 0o155) + chr(0b100001 + 0o26) + chr(0b11001 + 0o30), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110101) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11101 + 0o25) + chr(55) + chr(0b101000 + 0o10), 19588 - 19580), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(0b1101111) + chr(51) + '\062' + chr(0b1100 + 0o46), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(51), 39917 - 39909)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(11845 - 11734) + chr(0b1010 + 0o53) + chr(1710 - 1662), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'Y'), '\x64' + chr(101) + '\143' + chr(111) + chr(0b1100100) + chr(101))(chr(0b1001001 + 0o54) + chr(0b1110100) + chr(0b1011001 + 0o15) + chr(0b101101) + chr(126 - 70)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def is1aZZz07_7i(hXMPsSrOQzbh, J7DVXYlVh6vo):
if roI3spqORKae(hXMPsSrOQzbh._raw_synset, roI3spqORKae(ES5oEprVxulp(b'>U\\\xa6J\xbb\xe9\xbe+\x0cD\xcc'), chr(100) + '\145' + chr(0b1010110 + 0o15) + chr(111) + '\144' + chr(3654 - 3553))('\165' + '\164' + chr(0b1010010 + 0o24) + chr(1982 - 1937) + chr(0b111000))) != roI3spqORKae(J7DVXYlVh6vo._raw_synset, roI3spqORKae(ES5oEprVxulp(b'>U\\\xa6J\xbb\xe9\xbe+\x0cD\xcc'), '\x64' + chr(0b1000011 + 0o42) + chr(0b1001001 + 0o32) + chr(0b1101111) + chr(0b1100100) + chr(4175 - 4074))(chr(11223 - 11106) + chr(0b1110100) + chr(8807 - 8705) + chr(0b11010 + 0o23) + chr(56))):
return None
UH0YjwuI_XzX = snO6sAQrwgiV[hXMPsSrOQzbh._raw_synset.IGIA_fu6MbaO]
cWxJ9qIyBuTI = hXMPsSrOQzbh._shortest_path_distance(J7DVXYlVh6vo)
if cWxJ9qIyBuTI >= nzTpIcepk0o8('\x30' + chr(111) + chr(2281 - 2233), 18404 - 18396):
return -roI3spqORKae(aQg01EfWg1cd, roI3spqORKae(ES5oEprVxulp(b'\x1b\x7f|\xa0\x7f\xea\xc8\xe7\x084B\xd5'), '\x64' + '\x65' + chr(0b1100011) + chr(0b10100 + 0o133) + chr(8448 - 8348) + '\x65')(chr(12130 - 12013) + chr(116) + '\x66' + chr(0b10011 + 0o32) + chr(56)))((cWxJ9qIyBuTI + nzTpIcepk0o8(chr(57 - 9) + '\x6f' + '\061', 0o10)) / (2.0 * UH0YjwuI_XzX))
else:
return None
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.wup_similarity
|
def wup_similarity(self, target_synset):
"""Calculates Wu and Palmer's similarity between the two synsets.
Notes
-----
Similarity is calculated using the formula ( 2*depth(least_common_subsumer(synset1,synset2)) ) / ( depth(synset1) + depth(synset2) )
Parameters
----------
synset : Synset
Synset from which the similarity is calculated.
Returns
-------
float
Wu and Palmer's similarity from `synset`.
"""
lchs = self.lowest_common_hypernyms(target_synset)
lcs_depth = lchs[0]._min_depth() if lchs and len(lchs) else None
self_depth = self._min_depth()
other_depth = target_synset._min_depth()
if lcs_depth is None or self_depth is None or other_depth is None:
return None
return (2.0 * lcs_depth) / (self_depth + other_depth)
|
python
|
def wup_similarity(self, target_synset):
"""Calculates Wu and Palmer's similarity between the two synsets.
Notes
-----
Similarity is calculated using the formula ( 2*depth(least_common_subsumer(synset1,synset2)) ) / ( depth(synset1) + depth(synset2) )
Parameters
----------
synset : Synset
Synset from which the similarity is calculated.
Returns
-------
float
Wu and Palmer's similarity from `synset`.
"""
lchs = self.lowest_common_hypernyms(target_synset)
lcs_depth = lchs[0]._min_depth() if lchs and len(lchs) else None
self_depth = self._min_depth()
other_depth = target_synset._min_depth()
if lcs_depth is None or self_depth is None or other_depth is None:
return None
return (2.0 * lcs_depth) / (self_depth + other_depth)
|
[
"def",
"wup_similarity",
"(",
"self",
",",
"target_synset",
")",
":",
"lchs",
"=",
"self",
".",
"lowest_common_hypernyms",
"(",
"target_synset",
")",
"lcs_depth",
"=",
"lchs",
"[",
"0",
"]",
".",
"_min_depth",
"(",
")",
"if",
"lchs",
"and",
"len",
"(",
"lchs",
")",
"else",
"None",
"self_depth",
"=",
"self",
".",
"_min_depth",
"(",
")",
"other_depth",
"=",
"target_synset",
".",
"_min_depth",
"(",
")",
"if",
"lcs_depth",
"is",
"None",
"or",
"self_depth",
"is",
"None",
"or",
"other_depth",
"is",
"None",
":",
"return",
"None",
"return",
"(",
"2.0",
"*",
"lcs_depth",
")",
"/",
"(",
"self_depth",
"+",
"other_depth",
")"
] |
Calculates Wu and Palmer's similarity between the two synsets.
Notes
-----
Similarity is calculated using the formula ( 2*depth(least_common_subsumer(synset1,synset2)) ) / ( depth(synset1) + depth(synset2) )
Parameters
----------
synset : Synset
Synset from which the similarity is calculated.
Returns
-------
float
Wu and Palmer's similarity from `synset`.
|
[
"Calculates",
"Wu",
"and",
"Palmer",
"s",
"similarity",
"between",
"the",
"two",
"synsets",
".",
"Notes",
"-----",
"Similarity",
"is",
"calculated",
"using",
"the",
"formula",
"(",
"2",
"*",
"depth",
"(",
"least_common_subsumer",
"(",
"synset1",
"synset2",
"))",
")",
"/",
"(",
"depth",
"(",
"synset1",
")",
"+",
"depth",
"(",
"synset2",
")",
")",
"Parameters",
"----------",
"synset",
":",
"Synset",
"Synset",
"from",
"which",
"the",
"similarity",
"is",
"calculated",
".",
"Returns",
"-------",
"float",
"Wu",
"and",
"Palmer",
"s",
"similarity",
"from",
"synset",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L726-L751
|
train
|
Calculates the Wu and Palmer s similarity between two synsets.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCt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sImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(49), 0o10), nzTpIcepk0o8(chr(1745 - 1697) + chr(10477 - 10366) + chr(50) + chr(2358 - 2304) + '\x32', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(0b0 + 0o60) + chr(48), 0b1000), nzTpIcepk0o8(chr(511 - 463) + chr(0b1011010 + 0o25) + chr(0b110101) + chr(1272 - 1218), 34641 - 34633), nzTpIcepk0o8(chr(1020 - 972) + '\x6f' + '\063' + chr(0b110010) + chr(54), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + chr(54) + '\x35', 6776 - 6768), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x33' + chr(1715 - 1664) + chr(0b100 + 0o55), 0o10), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b100001 + 0o116) + chr(51) + '\x36' + chr(0b101011 + 0o6), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\062' + chr(50) + chr(1854 - 1803), ord("\x08")), nzTpIcepk0o8('\x30' + chr(10459 - 10348) + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(612 - 561) + '\x33' + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\x6f' + chr(0b110010) + '\061' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b100101 + 0o14) + '\060' + '\061', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(370 - 321) + '\061' + '\x32', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1010001 + 0o36) + '\062' + chr(0b100010 + 0o20) + chr(0b100011 + 0o24), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(48), 21201 - 21193), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b11110 + 0o31) + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(50) + chr(176 - 122) + chr(0b110000), 5683 - 5675), nzTpIcepk0o8('\060' + chr(111) + chr(50) + '\x33' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(1261 - 1213) + chr(0b1101111) + chr(0b101111 + 0o2) + chr(0b1000 + 0o53) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(2241 - 2193) + chr(10750 - 10639) + chr(0b110010) + chr(0b1101 + 0o43) + chr(53), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + chr(50) + chr(55), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b11001 + 0o32) + chr(0b110010 + 0o5) + chr(1224 - 1174), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + chr(1308 - 1259) + chr(1461 - 1409), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101 + 0o142) + chr(294 - 245) + chr(1809 - 1754) + chr(139 - 90), 2673 - 2665), nzTpIcepk0o8(chr(986 - 938) + chr(0b1101111) + chr(0b110011) + chr(55) + chr(52), 8), nzTpIcepk0o8(chr(990 - 942) + chr(111) + '\x31' + '\067' + chr(0b110111), 43284 - 43276), nzTpIcepk0o8(chr(0b110000) + chr(3850 - 3739) + chr(0b110011) + '\060' + chr(0b101010 + 0o12), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1001000 + 0o47) + chr(2002 - 1951) + '\063' + chr(0b10000 + 0o43), ord("\x08")), nzTpIcepk0o8('\060' + chr(4565 - 4454) + '\065' + chr(1921 - 1871), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(49) + '\x35', 0b1000), nzTpIcepk0o8(chr(859 - 811) + chr(0b1101111) + '\066' + chr(550 - 502), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + chr(2228 - 2174) + chr(0b1000 + 0o55), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1101 + 0o45) + '\060' + chr(49), 0o10), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\157' + chr(1490 - 1440) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(10799 - 10688) + '\062' + chr(50) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(48) + chr(2031 - 1920) + chr(0b11110 + 0o27) + chr(0b110110), 8), nzTpIcepk0o8(chr(0b110000) + chr(12146 - 12035) + chr(0b1100 + 0o47) + chr(1330 - 1276) + '\x34', 45667 - 45659), nzTpIcepk0o8(chr(1640 - 1592) + chr(111) + chr(1287 - 1236) + chr(2383 - 2333) + '\066', 8), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(11788 - 11677) + chr(0b110101) + '\x31', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b10010 + 0o135) + '\x35' + chr(259 - 211), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b"'"), '\x64' + chr(0b1100101) + chr(958 - 859) + chr(0b1000010 + 0o55) + '\144' + '\x65')(chr(8008 - 7891) + chr(1889 - 1773) + chr(0b1100110) + '\055' + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def SwovE5VJPXkx(hXMPsSrOQzbh, yy5tKHLly148):
O8tjyGqqm3Q8 = hXMPsSrOQzbh.lowest_common_hypernyms(yy5tKHLly148)
Y9Hd8q9UN78b = O8tjyGqqm3Q8[nzTpIcepk0o8('\060' + chr(0b1101001 + 0o6) + chr(0b1111 + 0o41), 8)]._min_depth() if O8tjyGqqm3Q8 and ftfygxgFas5X(O8tjyGqqm3Q8) else None
ALhVrJAovGGS = hXMPsSrOQzbh._min_depth()
g9T8SEETo9ZI = yy5tKHLly148._min_depth()
if Y9Hd8q9UN78b is None or ALhVrJAovGGS is None or g9T8SEETo9ZI is None:
return None
return 2.0 * Y9Hd8q9UN78b / (ALhVrJAovGGS + g9T8SEETo9ZI)
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.definition
|
def definition(self):
"""Returns the definition of the synset.
Returns
-------
str
Definition of the synset as a new-line separated concatenated string from all its variants' definitions.
"""
return '\n'.join([variant.gloss for variant in self._raw_synset.variants if variant.gloss])
|
python
|
def definition(self):
"""Returns the definition of the synset.
Returns
-------
str
Definition of the synset as a new-line separated concatenated string from all its variants' definitions.
"""
return '\n'.join([variant.gloss for variant in self._raw_synset.variants if variant.gloss])
|
[
"def",
"definition",
"(",
"self",
")",
":",
"return",
"'\\n'",
".",
"join",
"(",
"[",
"variant",
".",
"gloss",
"for",
"variant",
"in",
"self",
".",
"_raw_synset",
".",
"variants",
"if",
"variant",
".",
"gloss",
"]",
")"
] |
Returns the definition of the synset.
Returns
-------
str
Definition of the synset as a new-line separated concatenated string from all its variants' definitions.
|
[
"Returns",
"the",
"definition",
"of",
"the",
"synset",
".",
"Returns",
"-------",
"str",
"Definition",
"of",
"the",
"synset",
"as",
"a",
"new",
"-",
"line",
"separated",
"concatenated",
"string",
"from",
"all",
"its",
"variants",
"definitions",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L764-L773
|
train
|
Returns the definition of the synset as a new - line separated concatenated string from all its variants
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZ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HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\x6f' + chr(0b11001 + 0o32) + chr(0b110101) + chr(2796 - 2742), 9674 - 9666), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1101111) + '\062' + chr(0b110110) + chr(49), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + chr(1860 - 1806) + chr(0b100111 + 0o17), 17461 - 17453), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(1623 - 1573) + chr(0b10100 + 0o42), 0b1000), nzTpIcepk0o8('\060' + chr(4162 - 4051) + chr(0b110010) + chr(626 - 573), 0b1000), nzTpIcepk0o8('\060' + chr(0b110111 + 0o70) + '\062' + chr(51) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(10196 - 10085) + chr(1187 - 1137) + '\x30', 0o10), nzTpIcepk0o8(chr(747 - 699) + chr(0b1101111) + '\061' + chr(2450 - 2395) + chr(0b110011), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(52) + chr(483 - 432), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1758 - 1709) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(2236 - 2188) + chr(3279 - 3168) + chr(0b110001) + chr(49) + '\x31', 0o10), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\x6f' + '\061' + chr(0b110011) + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1727 - 1678) + chr(0b110001) + chr(699 - 645), 30584 - 30576), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(1034 - 923) + '\x31' + chr(0b110110) + '\066', 0o10), nzTpIcepk0o8(chr(48) + chr(9716 - 9605) + chr(0b110010) + chr(2679 - 2626), 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1200 - 1151) + chr(0b110010) + chr(54), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(0b110111) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + '\x32' + '\066', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + chr(0b10001 + 0o42) + '\060', ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(51) + '\065', 16717 - 16709), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10100 + 0o37) + chr(0b11111 + 0o27) + chr(53), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + '\x32' + chr(0b10001 + 0o43), 41724 - 41716), nzTpIcepk0o8('\060' + '\157' + chr(1814 - 1765) + chr(49) + chr(0b101011 + 0o6), 8), nzTpIcepk0o8(chr(1101 - 1053) + '\157' + '\063' + chr(52) + '\x35', 37401 - 37393), nzTpIcepk0o8(chr(0b110000) + chr(0b11101 + 0o122) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + chr(0b110 + 0o61), 18289 - 18281), nzTpIcepk0o8(chr(1718 - 1670) + chr(0b1101111) + chr(0b110100) + chr(884 - 829), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b11 + 0o57) + chr(1207 - 1154) + chr(0b110011 + 0o1), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(4563 - 4452) + chr(51) + '\062' + chr(51), 50297 - 50289), nzTpIcepk0o8('\x30' + chr(0b1110 + 0o141) + chr(50) + '\x33' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(0b1101111) + chr(115 - 65) + '\064' + chr(302 - 254), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110000 + 0o6) + '\064', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110001) + '\x34' + '\067', 38275 - 38267), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\063' + chr(1586 - 1534) + '\065', 8), nzTpIcepk0o8(chr(48) + chr(0b1011010 + 0o25) + '\x31' + '\x37' + chr(50), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1097 - 1047) + chr(0b110000 + 0o3) + chr(355 - 305), ord("\x08")), nzTpIcepk0o8(chr(705 - 657) + chr(0b1101111) + chr(0b110 + 0o53) + chr(400 - 352), ord("\x08")), nzTpIcepk0o8(chr(1339 - 1291) + '\x6f' + chr(0b110010) + chr(2165 - 2113) + chr(49), 0b1000), nzTpIcepk0o8(chr(1809 - 1761) + chr(111) + chr(0b110011) + '\x33' + chr(0b101000 + 0o14), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b110000 + 0o77) + '\066' + chr(0b110001), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1140 - 1092) + chr(111) + chr(1272 - 1219) + chr(0b10110 + 0o32), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xc0'), chr(0b11100 + 0o110) + chr(101) + '\143' + chr(0b1101111) + '\x64' + '\x65')('\x75' + chr(0b1110100) + chr(0b1100110) + chr(1682 - 1637) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def E__n0JYQNJTL(hXMPsSrOQzbh):
return roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b'\xe4'), '\144' + chr(1356 - 1255) + chr(2109 - 2010) + chr(111) + '\144' + '\x65')('\165' + chr(0b1110011 + 0o1) + chr(7866 - 7764) + chr(0b11111 + 0o16) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\xb7\x85\x8f\x1b,\xdbs\x1dwO\x07*'), '\x64' + chr(101) + '\x63' + chr(0b1101111) + chr(0b1100100) + '\x65')('\x75' + '\164' + '\x66' + chr(660 - 615) + chr(546 - 490)))([roI3spqORKae(ZXJSPKxkIyZK, roI3spqORKae(ES5oEprVxulp(b'\x89\xdd\x99%f'), '\144' + chr(4255 - 4154) + chr(5352 - 5253) + chr(0b1100100 + 0o13) + chr(7397 - 7297) + chr(7411 - 7310))(chr(117) + '\x74' + '\x66' + chr(45) + '\x38')) for ZXJSPKxkIyZK in roI3spqORKae(hXMPsSrOQzbh._raw_synset, roI3spqORKae(ES5oEprVxulp(b'\x98\xd0\x84?t\xf7d\x08'), chr(0b1100100) + chr(2876 - 2775) + chr(5458 - 5359) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\x75' + '\x74' + chr(0b1100110) + '\055' + chr(2883 - 2827))) if roI3spqORKae(ZXJSPKxkIyZK, roI3spqORKae(ES5oEprVxulp(b'\x89\xdd\x99%f'), chr(4025 - 3925) + chr(101) + chr(0b0 + 0o143) + chr(111) + '\x64' + chr(0b1100101))(chr(0b10 + 0o163) + chr(0b1110100) + chr(3408 - 3306) + '\x2d' + '\x38'))])
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.examples
|
def examples(self):
"""Returns the examples of the synset.
Returns
-------
list of str
List of its variants' examples.
"""
examples = []
for example in [variant.examples for variant in self._raw_synset.variants if len(variant.examples)]:
examples.extend(example)
return examples
|
python
|
def examples(self):
"""Returns the examples of the synset.
Returns
-------
list of str
List of its variants' examples.
"""
examples = []
for example in [variant.examples for variant in self._raw_synset.variants if len(variant.examples)]:
examples.extend(example)
return examples
|
[
"def",
"examples",
"(",
"self",
")",
":",
"examples",
"=",
"[",
"]",
"for",
"example",
"in",
"[",
"variant",
".",
"examples",
"for",
"variant",
"in",
"self",
".",
"_raw_synset",
".",
"variants",
"if",
"len",
"(",
"variant",
".",
"examples",
")",
"]",
":",
"examples",
".",
"extend",
"(",
"example",
")",
"return",
"examples"
] |
Returns the examples of the synset.
Returns
-------
list of str
List of its variants' examples.
|
[
"Returns",
"the",
"examples",
"of",
"the",
"synset",
".",
"Returns",
"-------",
"list",
"of",
"str",
"List",
"of",
"its",
"variants",
"examples",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L775-L787
|
train
|
Returns the examples of the synset.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9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,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(6213 - 6102) + chr(0b110011) + chr(0b10010 + 0o37) + chr(0b1011 + 0o51), 0o10), nzTpIcepk0o8(chr(199 - 151) + chr(0b1101111) + chr(0b110001) + '\x35' + '\060', 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(0b1 + 0o156) + '\x33' + '\067' + chr(0b110000 + 0o1), 0b1000), nzTpIcepk0o8(chr(1348 - 1300) + '\x6f' + chr(0b101 + 0o55) + chr(0b100101 + 0o16) + chr(53), 60058 - 60050), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b10011 + 0o134) + chr(49) + '\062' + chr(0b110110), 54973 - 54965), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(54) + chr(0b1010 + 0o52), 63198 - 63190), nzTpIcepk0o8(chr(48) + '\x6f' + chr(49) + chr(0b10010 + 0o42) + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063', 16524 - 16516), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + '\x32' + chr(0b110110) + chr(0b110000), 0b1000), nzTpIcepk0o8('\x30' + chr(11149 - 11038) + '\x32' + chr(2499 - 2449) + '\064', 49988 - 49980), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\157' + chr(1872 - 1819) + '\x30', 31844 - 31836), nzTpIcepk0o8(chr(704 - 656) + chr(3870 - 3759) + '\066' + '\x36', 13395 - 13387), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\157' + '\x31' + chr(54) + '\065', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(796 - 746) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(48) + chr(430 - 319) + chr(0b101 + 0o56) + chr(50) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b101101 + 0o102) + '\063' + '\x30' + chr(50), ord("\x08")), nzTpIcepk0o8(chr(2279 - 2231) + '\157' + chr(49) + chr(1230 - 1176) + '\x32', 0o10), nzTpIcepk0o8(chr(199 - 151) + chr(0b1011000 + 0o27) + '\062' + chr(0b110101) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(1363 - 1315) + chr(0b1101111) + chr(0b101000 + 0o11) + chr(54) + '\062', 8), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(111) + chr(0b110001) + '\x33' + chr(0b11001 + 0o35), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\x31' + chr(0b110001) + chr(1941 - 1889), ord("\x08")), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(111) + chr(0b110001) + '\067' + '\063', 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(11653 - 11542) + chr(0b110001) + chr(2802 - 2747) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b1111 + 0o43) + '\060' + chr(0b10100 + 0o41), 16948 - 16940), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b11011 + 0o26) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\061' + '\x33' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + '\x35' + '\x37', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b11101 + 0o27) + '\x36', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b110011) + chr(1016 - 968), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b101011 + 0o10) + chr(0b11 + 0o55) + '\064', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(1798 - 1748) + chr(0b110001) + chr(0b101 + 0o53), 23538 - 23530), nzTpIcepk0o8(chr(1810 - 1762) + chr(12252 - 12141) + '\x33' + chr(327 - 279) + chr(0b110001), 0b1000), nzTpIcepk0o8('\060' + chr(0b1001111 + 0o40) + chr(0b110001) + chr(50) + chr(459 - 404), 40217 - 40209), nzTpIcepk0o8(chr(0b110000) + chr(10686 - 10575) + chr(2232 - 2181) + '\066' + chr(210 - 161), 0b1000), nzTpIcepk0o8(chr(710 - 662) + '\157' + '\062' + chr(417 - 367), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33', 8), nzTpIcepk0o8('\060' + '\157' + '\062' + chr(818 - 769) + chr(608 - 553), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(0b110010) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b101100 + 0o5) + chr(55) + '\x30', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + '\x35' + chr(0b110000), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe2'), '\x64' + chr(0b1011000 + 0o15) + chr(3959 - 3860) + chr(0b1101111) + chr(0b100001 + 0o103) + chr(101))(chr(0b1110101) + chr(116) + chr(102) + chr(0b101101) + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def BnqHauOFE9Uy(hXMPsSrOQzbh):
BnqHauOFE9Uy = []
for MJm1y5Zx1KzE in [roI3spqORKae(ZXJSPKxkIyZK, roI3spqORKae(ES5oEprVxulp(b'\xa9\x10\x98\xf0&X\x01p'), chr(100) + '\145' + chr(0b100111 + 0o74) + chr(111) + chr(100) + chr(101))(chr(3678 - 3561) + chr(116) + '\146' + '\x2d' + chr(56))) for ZXJSPKxkIyZK in roI3spqORKae(hXMPsSrOQzbh._raw_synset, roI3spqORKae(ES5oEprVxulp(b'\xba\t\x8b\xf47Z\x10p'), '\144' + '\145' + '\x63' + chr(0b1101110 + 0o1) + '\x64' + '\145')('\165' + '\164' + '\x66' + chr(0b101101) + chr(0b100000 + 0o30))) if ftfygxgFas5X(roI3spqORKae(ZXJSPKxkIyZK, roI3spqORKae(ES5oEprVxulp(b'\xa9\x10\x98\xf0&X\x01p'), chr(0b1100100) + chr(0b101011 + 0o72) + chr(0b1011111 + 0o4) + '\x6f' + chr(0b1100100) + '\145')('\x75' + '\164' + chr(6115 - 6013) + '\055' + chr(1445 - 1389))))]:
roI3spqORKae(BnqHauOFE9Uy, roI3spqORKae(ES5oEprVxulp(b'\x987\xca\xd09P(T\xef\xd6JG'), chr(100) + chr(101) + chr(0b10010 + 0o121) + '\157' + '\x64' + '\145')('\x75' + chr(10613 - 10497) + '\x66' + '\x2d' + chr(2329 - 2273)))(MJm1y5Zx1KzE)
return BnqHauOFE9Uy
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.lemmas
|
def lemmas(self):
"""Returns the synset's lemmas/variants' literal represantions.
Returns
-------
list of Lemmas
List of its variations' literals as Lemma objects.
"""
return [lemma("%s.%s"%(self.name,variant.literal)) for variant in self._raw_synset.variants]
|
python
|
def lemmas(self):
"""Returns the synset's lemmas/variants' literal represantions.
Returns
-------
list of Lemmas
List of its variations' literals as Lemma objects.
"""
return [lemma("%s.%s"%(self.name,variant.literal)) for variant in self._raw_synset.variants]
|
[
"def",
"lemmas",
"(",
"self",
")",
":",
"return",
"[",
"lemma",
"(",
"\"%s.%s\"",
"%",
"(",
"self",
".",
"name",
",",
"variant",
".",
"literal",
")",
")",
"for",
"variant",
"in",
"self",
".",
"_raw_synset",
".",
"variants",
"]"
] |
Returns the synset's lemmas/variants' literal represantions.
Returns
-------
list of Lemmas
List of its variations' literals as Lemma objects.
|
[
"Returns",
"the",
"synset",
"s",
"lemmas",
"/",
"variants",
"literal",
"represantions",
".",
"Returns",
"-------",
"list",
"of",
"Lemmas",
"List",
"of",
"its",
"variations",
"literals",
"as",
"Lemma",
"objects",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L789-L798
|
train
|
Returns the synset s lemmas as Lemmas as strings.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,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qaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(478 - 424) + '\x36', 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b101011 + 0o7) + chr(1950 - 1899), 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + '\x6f' + '\x31' + chr(52) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\157' + chr(51) + chr(51) + chr(1565 - 1511), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2392 - 2342) + chr(1969 - 1920) + chr(1230 - 1182), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110101) + chr(0b10001 + 0o43), ord("\x08")), nzTpIcepk0o8(chr(940 - 892) + chr(0b110 + 0o151) + chr(0b110100) + chr(0b101001 + 0o12), 0b1000), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111 + 0o0) + chr(0b11111 + 0o22) + chr(407 - 356) + chr(0b10010 + 0o40), 64822 - 64814), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + '\x31' + chr(0b1101 + 0o52), 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111) + '\x32' + '\060' + '\064', 0o10), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(531 - 420) + '\x32' + chr(51) + '\063', 0b1000), nzTpIcepk0o8(chr(1016 - 968) + '\x6f' + chr(0b110011) + chr(0b1101 + 0o45) + chr(2246 - 2198), 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(9223 - 9112) + chr(0b110111) + chr(49), 26843 - 26835), nzTpIcepk0o8('\x30' + chr(2708 - 2597) + chr(0b110010) + chr(0b110100) + '\064', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\x33' + '\067' + '\x37', 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(0b11 + 0o60) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(11750 - 11639) + chr(1590 - 1539) + chr(0b110000) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1101111) + chr(49) + '\x34' + chr(0b1000 + 0o52), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31' + '\065' + '\065', ord("\x08")), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(111) + chr(0b10101 + 0o35) + chr(0b110000), 35882 - 35874), nzTpIcepk0o8('\x30' + chr(4855 - 4744) + chr(0b110001) + chr(530 - 481) + chr(52), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + chr(49) + '\x33', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b101001 + 0o12) + chr(0b110101) + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110101) + '\x36', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b10010 + 0o41) + '\062' + chr(0b10111 + 0o33), 60856 - 60848), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(51) + chr(0b110110) + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(2656 - 2601), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + '\063' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(570 - 519) + '\066' + chr(52), 8), nzTpIcepk0o8('\060' + chr(0b1000001 + 0o56) + chr(404 - 355) + '\062' + chr(51), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(50) + chr(0b110000) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + chr(0b110001) + chr(0b110010), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\063' + '\x30' + chr(0b110111), 50387 - 50379), nzTpIcepk0o8(chr(1603 - 1555) + chr(0b10011 + 0o134) + chr(0b10 + 0o61) + '\060' + '\x37', 8), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(3807 - 3696) + chr(50) + '\x30' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b100000 + 0o117) + chr(0b100111 + 0o12) + chr(1900 - 1847) + chr(2052 - 2003), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(6339 - 6228) + chr(1112 - 1062) + chr(52) + '\067', 44362 - 44354), nzTpIcepk0o8('\060' + chr(0b100110 + 0o111) + '\063' + chr(0b101101 + 0o11), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(51) + chr(486 - 436), 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + '\061' + chr(0b110001), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b11100 + 0o123) + chr(537 - 484) + chr(0b110000), 51624 - 51616)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x18'), '\x64' + '\145' + '\143' + chr(0b1001001 + 0o46) + chr(0b1100100) + chr(0b101 + 0o140))(chr(0b1011010 + 0o33) + chr(0b1110100) + chr(0b1001011 + 0o33) + chr(0b1111 + 0o36) + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def a5VtTAxz8uDl(hXMPsSrOQzbh):
return [W6axg8J0N9kP(roI3spqORKae(ES5oEprVxulp(b'\x13`M\xfb\xfb'), chr(100) + '\145' + chr(0b110011 + 0o60) + chr(5243 - 5132) + chr(0b111010 + 0o52) + chr(0b111000 + 0o55))(chr(4127 - 4010) + '\x74' + chr(6075 - 5973) + chr(0b101101) + chr(0b111000)) % (roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'e_5\x9c\xbans\x1b\xd0\xe9\xd2\xb5'), chr(100) + chr(0b1100101) + chr(99) + '\x6f' + chr(0b1100100) + chr(0b110100 + 0o61))(chr(0b110011 + 0o102) + chr(12328 - 12212) + chr(3426 - 3324) + chr(45) + chr(0b111000))), roI3spqORKae(ZXJSPKxkIyZK, roI3spqORKae(ES5oEprVxulp(b'n 3\xef\xe4HGi\xfa\xbc\xd9\xa1'), chr(5213 - 5113) + '\x65' + chr(0b1100011) + chr(10788 - 10677) + '\x64' + chr(2823 - 2722))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b111000))))) for ZXJSPKxkIyZK in roI3spqORKae(hXMPsSrOQzbh._raw_synset, roI3spqORKae(ES5oEprVxulp(b'@r\x11\xb7\xe9BW)'), '\144' + chr(7756 - 7655) + chr(0b1100011) + chr(0b111100 + 0o63) + chr(6269 - 6169) + chr(101))('\x75' + chr(0b1011101 + 0o27) + chr(0b110111 + 0o57) + chr(0b101 + 0o50) + chr(0b111000)))]
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Synset.lowest_common_hypernyms
|
def lowest_common_hypernyms(self,target_synset):
"""Returns the common hypernyms of the synset and the target synset, which are furthest from the closest roots.
Parameters
----------
target_synset : Synset
Synset with which the common hypernyms are sought.
Returns
-------
list of Synsets
Common synsets which are the furthest from the closest roots.
"""
self_hypernyms = self._recursive_hypernyms(set())
other_hypernyms = target_synset._recursive_hypernyms(set())
common_hypernyms = self_hypernyms.intersection(other_hypernyms)
annot_common_hypernyms = [(hypernym, hypernym._min_depth()) for hypernym in common_hypernyms]
annot_common_hypernyms.sort(key = lambda annot_hypernym: annot_hypernym[1],reverse=True)
max_depth = annot_common_hypernyms[0][1] if len(annot_common_hypernyms) > 0 else None
if max_depth != None:
return [annot_common_hypernym[0] for annot_common_hypernym in annot_common_hypernyms if annot_common_hypernym[1] == max_depth]
else:
return None
|
python
|
def lowest_common_hypernyms(self,target_synset):
"""Returns the common hypernyms of the synset and the target synset, which are furthest from the closest roots.
Parameters
----------
target_synset : Synset
Synset with which the common hypernyms are sought.
Returns
-------
list of Synsets
Common synsets which are the furthest from the closest roots.
"""
self_hypernyms = self._recursive_hypernyms(set())
other_hypernyms = target_synset._recursive_hypernyms(set())
common_hypernyms = self_hypernyms.intersection(other_hypernyms)
annot_common_hypernyms = [(hypernym, hypernym._min_depth()) for hypernym in common_hypernyms]
annot_common_hypernyms.sort(key = lambda annot_hypernym: annot_hypernym[1],reverse=True)
max_depth = annot_common_hypernyms[0][1] if len(annot_common_hypernyms) > 0 else None
if max_depth != None:
return [annot_common_hypernym[0] for annot_common_hypernym in annot_common_hypernyms if annot_common_hypernym[1] == max_depth]
else:
return None
|
[
"def",
"lowest_common_hypernyms",
"(",
"self",
",",
"target_synset",
")",
":",
"self_hypernyms",
"=",
"self",
".",
"_recursive_hypernyms",
"(",
"set",
"(",
")",
")",
"other_hypernyms",
"=",
"target_synset",
".",
"_recursive_hypernyms",
"(",
"set",
"(",
")",
")",
"common_hypernyms",
"=",
"self_hypernyms",
".",
"intersection",
"(",
"other_hypernyms",
")",
"annot_common_hypernyms",
"=",
"[",
"(",
"hypernym",
",",
"hypernym",
".",
"_min_depth",
"(",
")",
")",
"for",
"hypernym",
"in",
"common_hypernyms",
"]",
"annot_common_hypernyms",
".",
"sort",
"(",
"key",
"=",
"lambda",
"annot_hypernym",
":",
"annot_hypernym",
"[",
"1",
"]",
",",
"reverse",
"=",
"True",
")",
"max_depth",
"=",
"annot_common_hypernyms",
"[",
"0",
"]",
"[",
"1",
"]",
"if",
"len",
"(",
"annot_common_hypernyms",
")",
">",
"0",
"else",
"None",
"if",
"max_depth",
"!=",
"None",
":",
"return",
"[",
"annot_common_hypernym",
"[",
"0",
"]",
"for",
"annot_common_hypernym",
"in",
"annot_common_hypernyms",
"if",
"annot_common_hypernym",
"[",
"1",
"]",
"==",
"max_depth",
"]",
"else",
":",
"return",
"None"
] |
Returns the common hypernyms of the synset and the target synset, which are furthest from the closest roots.
Parameters
----------
target_synset : Synset
Synset with which the common hypernyms are sought.
Returns
-------
list of Synsets
Common synsets which are the furthest from the closest roots.
|
[
"Returns",
"the",
"common",
"hypernyms",
"of",
"the",
"synset",
"and",
"the",
"target",
"synset",
"which",
"are",
"furthest",
"from",
"the",
"closest",
"roots",
".",
"Parameters",
"----------",
"target_synset",
":",
"Synset",
"Synset",
"with",
"which",
"the",
"common",
"hypernyms",
"are",
"sought",
".",
"Returns",
"-------",
"list",
"of",
"Synsets",
"Common",
"synsets",
"which",
"are",
"the",
"furthest",
"from",
"the",
"closest",
"roots",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L800-L827
|
train
|
Returns the lowest common hypernyms of the synset and the target synset.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7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41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1271 - 1221) + chr(900 - 849) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + '\x32' + chr(2543 - 2492), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b100 + 0o153) + chr(50) + chr(0b11011 + 0o31) + chr(53), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + '\063' + '\060', 0o10), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(10688 - 10577) + chr(1938 - 1888) + chr(1066 - 1016) + chr(0b101011 + 0o6), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010001 + 0o36) + chr(0b11001 + 0o32) + chr(0b100101 + 0o14) + chr(2552 - 2499), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\x36', 0b1000), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(111) + chr(275 - 224) + chr(55) + '\062', 0b1000), nzTpIcepk0o8(chr(1726 - 1678) + '\x6f' + chr(1281 - 1230) + '\062' + '\067', 58685 - 58677), nzTpIcepk0o8(chr(704 - 656) + chr(0b1101111) + chr(0b110011) + '\063' + chr(0b10111 + 0o35), 0b1000), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(0b10011 + 0o134) + chr(51) + chr(0b11000 + 0o31), 0b1000), nzTpIcepk0o8(chr(794 - 746) + '\x6f' + '\x35' + chr(2243 - 2189), 0o10), nzTpIcepk0o8(chr(48) + chr(8200 - 8089) + '\063' + chr(1056 - 1002) + chr(2281 - 2232), 47126 - 47118), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110011) + '\x33' + '\x35', 31765 - 31757), nzTpIcepk0o8(chr(1656 - 1608) + chr(0b1000001 + 0o56) + chr(2302 - 2251) + chr(1741 - 1693), 49098 - 49090), nzTpIcepk0o8('\060' + chr(0b10100 + 0o133) + '\065' + '\x35', 16708 - 16700), nzTpIcepk0o8(chr(2261 - 2213) + chr(5926 - 5815) + chr(2116 - 2067) + chr(0b110111) + '\062', 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(0b110101 + 0o1) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\x33' + '\067' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b100 + 0o54) + '\157' + chr(50) + chr(0b10111 + 0o32) + chr(206 - 154), 0o10), nzTpIcepk0o8('\060' + chr(0b111000 + 0o67) + chr(50) + chr(0b110010) + '\066', 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(1988 - 1937) + '\x32' + chr(0b101000 + 0o11), ord("\x08")), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(0b1101111) + chr(0b110011) + chr(0b1011 + 0o52) + chr(53), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1000110 + 0o51) + '\x33', 23402 - 23394), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + chr(52) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(398 - 349) + '\x37' + chr(53), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\x33' + chr(48) + '\x35', 0o10), nzTpIcepk0o8(chr(48) + chr(10685 - 10574) + '\063' + '\061' + '\x35', 8), nzTpIcepk0o8(chr(842 - 794) + chr(8959 - 8848) + '\064' + '\x37', 0o10), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\x6f' + '\x32' + chr(0b1100 + 0o44) + chr(1682 - 1629), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(50) + chr(49) + chr(0b110101), 47982 - 47974), nzTpIcepk0o8(chr(0b110000) + chr(0b1100000 + 0o17) + '\061' + '\x34' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(111) + '\063' + chr(0b110001) + '\067', 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\x6f' + '\x33' + '\x36' + chr(941 - 889), 59330 - 59322), nzTpIcepk0o8(chr(1942 - 1894) + chr(10577 - 10466) + '\x33' + chr(0b110100) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + '\x34' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + '\x37' + chr(0b101000 + 0o11), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + '\061' + chr(0b110010), 37702 - 37694), nzTpIcepk0o8(chr(1528 - 1480) + chr(111) + chr(0b110001) + chr(54) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b111001 + 0o66) + '\x31' + chr(49) + chr(2419 - 2369), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b100000 + 0o20) + '\x6f' + chr(0b10000 + 0o45) + chr(1825 - 1777), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xb1'), '\x64' + chr(6076 - 5975) + '\x63' + chr(1847 - 1736) + '\x64' + '\145')('\x75' + chr(2716 - 2600) + chr(0b1100110) + chr(45) + chr(3039 - 2983)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def g4XxnuAdV0Aj(hXMPsSrOQzbh, yy5tKHLly148):
rC5G80HvPLKb = hXMPsSrOQzbh._recursive_hypernyms(Bvi71nNyvlqO())
vrB0k0zo1ySp = yy5tKHLly148._recursive_hypernyms(Bvi71nNyvlqO())
EJ8PluajOKP0 = rC5G80HvPLKb.intersection(vrB0k0zo1ySp)
oda6wQ5FDgaq = [(Xk2YkBCizYN5, Xk2YkBCizYN5._min_depth()) for Xk2YkBCizYN5 in EJ8PluajOKP0]
roI3spqORKae(oda6wQ5FDgaq, roI3spqORKae(ES5oEprVxulp(b'\xec\xfc\xd7\xec'), '\144' + chr(0b1110 + 0o127) + chr(5751 - 5652) + chr(0b10110 + 0o131) + chr(5138 - 5038) + chr(101))(chr(0b1001101 + 0o50) + '\x74' + '\x66' + chr(1625 - 1580) + chr(182 - 126)))(key=lambda uUnUhkkp9PQR: uUnUhkkp9PQR[nzTpIcepk0o8(chr(0b100001 + 0o17) + '\157' + chr(0b110001), 0b1000)], reverse=nzTpIcepk0o8(chr(48) + '\x6f' + chr(49), 8))
dQNXocQ4z2HF = oda6wQ5FDgaq[nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\060', 20350 - 20342)][nzTpIcepk0o8(chr(48) + '\157' + chr(49), 8)] if ftfygxgFas5X(oda6wQ5FDgaq) > nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100100 + 0o14), 8) else None
if dQNXocQ4z2HF is not None:
return [cbsmbkvJDe7S[nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(48), 8)] for cbsmbkvJDe7S in oda6wQ5FDgaq if cbsmbkvJDe7S[nzTpIcepk0o8(chr(0b110 + 0o52) + '\157' + chr(0b110001), 8)] == dQNXocQ4z2HF]
else:
return None
|
estnltk/estnltk
|
estnltk/wordnet/wn.py
|
Lemma.synset
|
def synset(self):
"""Returns synset into which the given lemma belongs to.
Returns
-------
Synset
Synset into which the given lemma belongs to.
"""
return synset('%s.%s.%s.%s'%(self.synset_literal,self.synset_pos,self.synset_sense,self.literal))
|
python
|
def synset(self):
"""Returns synset into which the given lemma belongs to.
Returns
-------
Synset
Synset into which the given lemma belongs to.
"""
return synset('%s.%s.%s.%s'%(self.synset_literal,self.synset_pos,self.synset_sense,self.literal))
|
[
"def",
"synset",
"(",
"self",
")",
":",
"return",
"synset",
"(",
"'%s.%s.%s.%s'",
"%",
"(",
"self",
".",
"synset_literal",
",",
"self",
".",
"synset_pos",
",",
"self",
".",
"synset_sense",
",",
"self",
".",
"literal",
")",
")"
] |
Returns synset into which the given lemma belongs to.
Returns
-------
Synset
Synset into which the given lemma belongs to.
|
[
"Returns",
"synset",
"into",
"which",
"the",
"given",
"lemma",
"belongs",
"to",
".",
"Returns",
"-------",
"Synset",
"Synset",
"into",
"which",
"the",
"given",
"lemma",
"belongs",
"to",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wordnet/wn.py#L864-L873
|
train
|
Returns a synset in which the given lemma belongs to.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUS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urjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(10083 - 9972) + chr(0b11100 + 0o26) + chr(54) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b11000 + 0o30) + '\x6f' + chr(0b110001) + chr(0b1110 + 0o42) + chr(625 - 571), 0b1000), nzTpIcepk0o8(chr(718 - 670) + chr(111) + chr(0b110010) + chr(0b1001 + 0o53) + chr(0b10 + 0o62), 0b1000), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\x6f' + '\x33' + '\064' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1606 - 1556) + '\x33' + '\065', 26785 - 26777), nzTpIcepk0o8(chr(737 - 689) + chr(0b110111 + 0o70) + chr(50) + chr(53) + chr(2951 - 2896), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b110001) + chr(55), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1101 + 0o44) + '\x37' + chr(2223 - 2169), 5400 - 5392), nzTpIcepk0o8(chr(1735 - 1687) + chr(0b101110 + 0o101) + '\x32' + chr(245 - 197) + chr(0b10100 + 0o41), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(8707 - 8596) + '\x32' + chr(0b110111) + '\066', 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111) + chr(0b110111) + chr(1934 - 1881), 0b1000), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(111) + chr(1986 - 1935) + chr(51) + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b10000 + 0o43) + chr(858 - 803) + '\x33', 0b1000), nzTpIcepk0o8(chr(0b1001 + 0o47) + '\x6f' + chr(52) + chr(0b10001 + 0o42), 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\157' + chr(51) + chr(0b110101) + '\x30', 0o10), nzTpIcepk0o8('\x30' + chr(0b101001 + 0o106) + chr(0b110011) + chr(54) + chr(52), 0o10), nzTpIcepk0o8(chr(1673 - 1625) + chr(111) + chr(0b10101 + 0o34) + chr(0b101 + 0o55) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(1269 - 1221) + chr(111) + chr(51) + chr(0b110000) + chr(0b110010), 0o10), nzTpIcepk0o8(chr(1521 - 1473) + '\x6f' + chr(1570 - 1518) + chr(0b10010 + 0o44), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2092 - 2041) + '\x34' + '\x32', 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + chr(0b110010) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b1101111) + '\x33' + chr(54) + chr(1868 - 1815), ord("\x08")), nzTpIcepk0o8(chr(2193 - 2145) + chr(0b1000011 + 0o54) + '\062' + '\066' + '\x37', 8), nzTpIcepk0o8('\060' + '\157' + chr(49) + chr(0b101101 + 0o5) + chr(0b101 + 0o53), 27079 - 27071), nzTpIcepk0o8('\x30' + chr(3435 - 3324) + '\063' + '\x31' + chr(49), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + '\063' + chr(0b110 + 0o52), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(2370 - 2317) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(0b1100100 + 0o13) + chr(0b110010) + '\x33' + chr(0b1111 + 0o43), 18307 - 18299), nzTpIcepk0o8(chr(48) + chr(464 - 353) + '\063' + chr(0b100001 + 0o24) + chr(0b11011 + 0o30), 0b1000), nzTpIcepk0o8(chr(2078 - 2030) + chr(10532 - 10421) + '\x31' + chr(0b101001 + 0o16) + chr(0b11111 + 0o22), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(55) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x34' + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1100000 + 0o17) + chr(1917 - 1868) + '\x33' + chr(1998 - 1946), 12563 - 12555), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b11110 + 0o23) + '\066', 13218 - 13210), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + '\061' + chr(1403 - 1355), 60259 - 60251), nzTpIcepk0o8(chr(0b101111 + 0o1) + '\x6f' + '\067' + '\065', 8), nzTpIcepk0o8(chr(0b11011 + 0o25) + '\x6f' + chr(0b11010 + 0o30) + chr(0b110001 + 0o0) + '\x32', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101001 + 0o6) + chr(50) + '\x32', 7926 - 7918), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10111 + 0o34) + chr(0b11010 + 0o26) + chr(0b1111 + 0o46), 0o10), nzTpIcepk0o8(chr(0b100 + 0o54) + '\157' + '\062' + '\x37', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\157' + chr(53) + chr(0b110000), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x99'), chr(0b1100100) + chr(0b1001100 + 0o31) + chr(0b101011 + 0o70) + '\157' + chr(0b110010 + 0o62) + chr(0b1100101))(chr(117) + '\x74' + chr(102) + chr(45) + chr(0b11 + 0o65)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def J7DVXYlVh6vo(hXMPsSrOQzbh):
return J7DVXYlVh6vo(roI3spqORKae(ES5oEprVxulp(b'\x925\x8a\xc0\xee\x81\xea\r\xab\x9bN'), chr(153 - 53) + chr(5114 - 5013) + '\x63' + chr(0b11101 + 0o122) + chr(0b1100100) + '\x65')(chr(0b111100 + 0o71) + '\x74' + '\x66' + chr(45) + chr(56)) % (roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc4?\xca\x96\xf8\xdb\x90\x12\xec\xcaX\xad\x9aO'), chr(1747 - 1647) + '\x65' + '\143' + chr(0b11011 + 0o124) + chr(100) + '\145')('\165' + chr(0b1010010 + 0o42) + '\146' + '\x2d' + chr(0b111000))), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc4?\xca\x96\xf8\xdb\x90\x0e\xea\xcd'), '\x64' + '\145' + chr(0b1100011) + chr(0b1010111 + 0o30) + chr(0b1100100) + chr(101))('\165' + '\164' + chr(102) + chr(0b10010 + 0o33) + '\x38')), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc4?\xca\x96\xf8\xdb\x90\r\xe0\xd0N\xba'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(111) + chr(8663 - 8563) + chr(0b1011010 + 0o13))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + '\070')), roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xefu\xf4\xd4\xf1\xcb\xabM\xf0\x86\x7f\xae'), chr(0b1100100) + chr(0b1000101 + 0o40) + chr(1420 - 1321) + chr(111) + chr(8337 - 8237) + chr(0b1100101))(chr(0b100 + 0o161) + '\164' + chr(0b1000110 + 0o40) + chr(0b101101) + chr(0b111000)))))
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
convert_vm_json_to_mrf
|
def convert_vm_json_to_mrf( vabamorf_json ):
''' Converts from vabamorf's JSON output, given as dict, into pre-syntactic mrf
format, given as a list of lines, as in the output of etmrf.
The aimed format looks something like this:
<s>
Kolmandaks
kolmandaks+0 //_D_ //
kolmas+ks //_O_ sg tr //
kihutas
kihuta+s //_V_ s //
end
end+0 //_Y_ ? //
ise+0 //_P_ sg p //
soomlane
soomlane+0 //_S_ sg n //
</s>
'''
if not isinstance( vabamorf_json, dict ):
raise Exception(' Expected dict as an input argument! ')
json_sentences = []
# 1) flatten paragraphs
if 'paragraphs' in vabamorf_json:
for pr in vabamorf_json['paragraphs']:
if 'sentences' in pr:
for sent in pr['sentences']:
json_sentences.append( sent )
# 2) flatten sentences
elif 'sentences' in vabamorf_json:
for sent in vabamorf_json['sentences']:
json_sentences.append( sent )
# 3) Iterate over sentences and perform conversion
results = []
for sentJson in json_sentences:
results.append('<s>')
for wordJson in sentJson['words']:
if wordJson['text'] == '<s>' or wordJson['text'] == '</s>':
continue
wordStr = wordJson['text']
# Escape double quotation marks
wordStr = _esc_double_quotes( wordStr )
results.append( wordStr )
for analysisJson in wordJson['analysis']:
root = analysisJson['root']
root = _esc_double_quotes( root )
# NB! ending="0" erineb ending=""-st:
# 1) eestlane (ending="0");
# 2) Rio (ending="") de (ending="") Jaineros;
ending = analysisJson[ENDING]
pos = analysisJson['partofspeech']
clitic = analysisJson['clitic']
form = analysisJson['form']
if pos == 'Z':
results.append( ''.join([' ',root,' //_Z_ //']) )
else:
results.append( ''.join([' ',root,'+',ending,clitic,' //', '_',pos,'_ ',form,' //']) )
if 'analysis' not in wordJson:
results.append( ' '+'####' )
results.append('</s>')
return results
|
python
|
def convert_vm_json_to_mrf( vabamorf_json ):
''' Converts from vabamorf's JSON output, given as dict, into pre-syntactic mrf
format, given as a list of lines, as in the output of etmrf.
The aimed format looks something like this:
<s>
Kolmandaks
kolmandaks+0 //_D_ //
kolmas+ks //_O_ sg tr //
kihutas
kihuta+s //_V_ s //
end
end+0 //_Y_ ? //
ise+0 //_P_ sg p //
soomlane
soomlane+0 //_S_ sg n //
</s>
'''
if not isinstance( vabamorf_json, dict ):
raise Exception(' Expected dict as an input argument! ')
json_sentences = []
# 1) flatten paragraphs
if 'paragraphs' in vabamorf_json:
for pr in vabamorf_json['paragraphs']:
if 'sentences' in pr:
for sent in pr['sentences']:
json_sentences.append( sent )
# 2) flatten sentences
elif 'sentences' in vabamorf_json:
for sent in vabamorf_json['sentences']:
json_sentences.append( sent )
# 3) Iterate over sentences and perform conversion
results = []
for sentJson in json_sentences:
results.append('<s>')
for wordJson in sentJson['words']:
if wordJson['text'] == '<s>' or wordJson['text'] == '</s>':
continue
wordStr = wordJson['text']
# Escape double quotation marks
wordStr = _esc_double_quotes( wordStr )
results.append( wordStr )
for analysisJson in wordJson['analysis']:
root = analysisJson['root']
root = _esc_double_quotes( root )
# NB! ending="0" erineb ending=""-st:
# 1) eestlane (ending="0");
# 2) Rio (ending="") de (ending="") Jaineros;
ending = analysisJson[ENDING]
pos = analysisJson['partofspeech']
clitic = analysisJson['clitic']
form = analysisJson['form']
if pos == 'Z':
results.append( ''.join([' ',root,' //_Z_ //']) )
else:
results.append( ''.join([' ',root,'+',ending,clitic,' //', '_',pos,'_ ',form,' //']) )
if 'analysis' not in wordJson:
results.append( ' '+'####' )
results.append('</s>')
return results
|
[
"def",
"convert_vm_json_to_mrf",
"(",
"vabamorf_json",
")",
":",
"if",
"not",
"isinstance",
"(",
"vabamorf_json",
",",
"dict",
")",
":",
"raise",
"Exception",
"(",
"' Expected dict as an input argument! '",
")",
"json_sentences",
"=",
"[",
"]",
"# 1) flatten paragraphs",
"if",
"'paragraphs'",
"in",
"vabamorf_json",
":",
"for",
"pr",
"in",
"vabamorf_json",
"[",
"'paragraphs'",
"]",
":",
"if",
"'sentences'",
"in",
"pr",
":",
"for",
"sent",
"in",
"pr",
"[",
"'sentences'",
"]",
":",
"json_sentences",
".",
"append",
"(",
"sent",
")",
"# 2) flatten sentences",
"elif",
"'sentences'",
"in",
"vabamorf_json",
":",
"for",
"sent",
"in",
"vabamorf_json",
"[",
"'sentences'",
"]",
":",
"json_sentences",
".",
"append",
"(",
"sent",
")",
"# 3) Iterate over sentences and perform conversion",
"results",
"=",
"[",
"]",
"for",
"sentJson",
"in",
"json_sentences",
":",
"results",
".",
"append",
"(",
"'<s>'",
")",
"for",
"wordJson",
"in",
"sentJson",
"[",
"'words'",
"]",
":",
"if",
"wordJson",
"[",
"'text'",
"]",
"==",
"'<s>'",
"or",
"wordJson",
"[",
"'text'",
"]",
"==",
"'</s>'",
":",
"continue",
"wordStr",
"=",
"wordJson",
"[",
"'text'",
"]",
"# Escape double quotation marks",
"wordStr",
"=",
"_esc_double_quotes",
"(",
"wordStr",
")",
"results",
".",
"append",
"(",
"wordStr",
")",
"for",
"analysisJson",
"in",
"wordJson",
"[",
"'analysis'",
"]",
":",
"root",
"=",
"analysisJson",
"[",
"'root'",
"]",
"root",
"=",
"_esc_double_quotes",
"(",
"root",
")",
"# NB! ending=\"0\" erineb ending=\"\"-st:",
"# 1) eestlane (ending=\"0\");",
"# 2) Rio (ending=\"\") de (ending=\"\") Jaineros;",
"ending",
"=",
"analysisJson",
"[",
"ENDING",
"]",
"pos",
"=",
"analysisJson",
"[",
"'partofspeech'",
"]",
"clitic",
"=",
"analysisJson",
"[",
"'clitic'",
"]",
"form",
"=",
"analysisJson",
"[",
"'form'",
"]",
"if",
"pos",
"==",
"'Z'",
":",
"results",
".",
"append",
"(",
"''",
".",
"join",
"(",
"[",
"' '",
",",
"root",
",",
"' //_Z_ //'",
"]",
")",
")",
"else",
":",
"results",
".",
"append",
"(",
"''",
".",
"join",
"(",
"[",
"' '",
",",
"root",
",",
"'+'",
",",
"ending",
",",
"clitic",
",",
"' //'",
",",
"'_'",
",",
"pos",
",",
"'_ '",
",",
"form",
",",
"' //'",
"]",
")",
")",
"if",
"'analysis'",
"not",
"in",
"wordJson",
":",
"results",
".",
"append",
"(",
"' '",
"+",
"'####'",
")",
"results",
".",
"append",
"(",
"'</s>'",
")",
"return",
"results"
] |
Converts from vabamorf's JSON output, given as dict, into pre-syntactic mrf
format, given as a list of lines, as in the output of etmrf.
The aimed format looks something like this:
<s>
Kolmandaks
kolmandaks+0 //_D_ //
kolmas+ks //_O_ sg tr //
kihutas
kihuta+s //_V_ s //
end
end+0 //_Y_ ? //
ise+0 //_P_ sg p //
soomlane
soomlane+0 //_S_ sg n //
</s>
|
[
"Converts",
"from",
"vabamorf",
"s",
"JSON",
"output",
"given",
"as",
"dict",
"into",
"pre",
"-",
"syntactic",
"mrf",
"format",
"given",
"as",
"a",
"list",
"of",
"lines",
"as",
"in",
"the",
"output",
"of",
"etmrf",
".",
"The",
"aimed",
"format",
"looks",
"something",
"like",
"this",
":",
"<s",
">",
"Kolmandaks",
"kolmandaks",
"+",
"0",
"//",
"_D_",
"//",
"kolmas",
"+",
"ks",
"//",
"_O_",
"sg",
"tr",
"//",
"kihutas",
"kihuta",
"+",
"s",
"//",
"_V_",
"s",
"//",
"end",
"end",
"+",
"0",
"//",
"_Y_",
"?",
"//",
"ise",
"+",
"0",
"//",
"_P_",
"sg",
"p",
"//",
"soomlane",
"soomlane",
"+",
"0",
"//",
"_S_",
"sg",
"n",
"//",
"<",
"/",
"s",
">"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax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WT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\157' + '\062' + chr(1775 - 1727) + chr(54), 39102 - 39094), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\x6f' + '\062' + chr(51) + chr(0b10 + 0o65), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1100110 + 0o11) + chr(1779 - 1729) + chr(0b10110 + 0o33) + chr(1382 - 1327), 52918 - 52910), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + chr(0b10000 + 0o43) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110111) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(48) + chr(2186 - 2075) + chr(0b110001) + chr(51) + chr(0b110101), 12454 - 12446), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\157' + chr(0b110110) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(2434 - 2323) + '\061' + '\x31' + chr(0b11000 + 0o37), ord("\x08")), nzTpIcepk0o8(chr(1206 - 1158) + chr(10236 - 10125) + chr(0b110010) + '\x36' + chr(2383 - 2333), ord("\x08")), nzTpIcepk0o8('\x30' + chr(9110 - 8999) + chr(0b110011) + chr(49) + chr(0b100000 + 0o21), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101001 + 0o6) + chr(1502 - 1451) + '\x33' + '\x31', 28171 - 28163), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(233 - 183) + chr(54), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b111010 + 0o65) + '\061' + chr(437 - 384) + chr(0b1111 + 0o50), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1001001 + 0o46) + '\x31' + chr(0b101110 + 0o4) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1780 - 1730) + chr(0b100110 + 0o15) + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010100 + 0o33) + chr(50) + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(961 - 911) + chr(0b110011) + chr(0b101 + 0o54), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b110111 + 0o70) + chr(0b10111 + 0o32) + chr(0b11011 + 0o25) + chr(0b100100 + 0o23), 17219 - 17211), nzTpIcepk0o8(chr(2054 - 2006) + chr(0b11 + 0o154) + chr(2283 - 2232) + chr(0b11101 + 0o30) + chr(48), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110111) + '\066', 0b1000), nzTpIcepk0o8(chr(1065 - 1017) + '\x6f' + '\x33' + '\x35' + chr(0b100000 + 0o27), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b1 + 0o62) + chr(48) + '\x36', 0o10), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1111 + 0o140) + chr(0b110011 + 0o0) + chr(0b110010) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + '\063' + chr(0b100011 + 0o20), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(7946 - 7835) + chr(0b110011) + '\067' + chr(0b11001 + 0o35), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(49) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1249 - 1200) + chr(0b11010 + 0o26) + '\x37', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b110101) + chr(48), 8), nzTpIcepk0o8(chr(48) + '\157' + '\x32' + '\x36' + '\x30', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(1009 - 960) + '\x37' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(1532 - 1484) + chr(111) + '\x31' + chr(0b1000 + 0o50), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + chr(0b10000 + 0o44) + chr(0b11100 + 0o32), 25119 - 25111), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b1101 + 0o142) + '\x32' + '\x33' + '\061', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1001100 + 0o43) + '\x33' + chr(0b101001 + 0o10) + chr(491 - 441), 63725 - 63717), nzTpIcepk0o8('\x30' + '\x6f' + '\x31' + chr(0b100111 + 0o11) + chr(0b100001 + 0o26), 8), nzTpIcepk0o8('\x30' + '\157' + '\061' + '\x32' + '\x34', 22327 - 22319), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b1101111) + '\x36' + '\x32', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b10111 + 0o32) + chr(48) + chr(0b11111 + 0o26), 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + chr(0b10110 + 0o131) + chr(0b110001) + chr(0b110110) + '\064', 22149 - 22141)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\157' + '\065' + chr(242 - 194), 50388 - 50380)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xa8'), chr(0b1000111 + 0o35) + chr(0b1100101) + '\x63' + chr(5833 - 5722) + chr(6901 - 6801) + '\145')('\x75' + chr(0b1110100) + '\146' + chr(0b101101) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def JWIVqrqiSdLL(SrGmq6qDHmWD):
if not suIjIS24Zkqw(SrGmq6qDHmWD, znjnJWK64FDT):
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'\xa6\xda\xf7)Z>C*\xd6\xe9\xbd\x7f\x0c"\xbat\xeag\x89P\xcf\xaf\xb8+\x8b\xfa?&\x9a\xd7\x0ee\xc3\xf7\xbeft'), chr(0b1100100) + chr(3083 - 2982) + chr(99) + '\x6f' + '\x64' + chr(0b101010 + 0o73))(chr(0b1110101) + chr(116) + chr(1692 - 1590) + '\055' + '\x38'))
l4u91NaPosar = []
if roI3spqORKae(ES5oEprVxulp(b'\xf6\xfe\xfd8X/V?\xda\xba'), '\144' + chr(101) + chr(0b1100011) + chr(7154 - 7043) + chr(0b11001 + 0o113) + chr(0b1011110 + 0o7))(chr(0b11001 + 0o134) + '\x74' + '\x66' + chr(45) + chr(1025 - 969)) in SrGmq6qDHmWD:
for FRkhMNj4RQb_ in SrGmq6qDHmWD[roI3spqORKae(ES5oEprVxulp(b'\xf6\xfe\xfd8X/V?\xda\xba'), chr(0b111001 + 0o53) + chr(9431 - 9330) + chr(4520 - 4421) + chr(111) + '\x64' + chr(101))('\165' + chr(6944 - 6828) + chr(0b1100110) + chr(0b101010 + 0o3) + chr(1794 - 1738))]:
if roI3spqORKae(ES5oEprVxulp(b'\xf5\xfa\xe1-Z3T*\xc1'), chr(3544 - 3444) + '\x65' + chr(6901 - 6802) + chr(0b110110 + 0o71) + chr(0b1100100) + '\x65')(chr(117) + '\x74' + '\146' + chr(45) + chr(56)) in FRkhMNj4RQb_:
for KCSwZZoid0kT in FRkhMNj4RQb_[roI3spqORKae(ES5oEprVxulp(b'\xf5\xfa\xe1-Z3T*\xc1'), '\x64' + chr(0b1100101) + chr(99) + '\157' + chr(0b1010111 + 0o15) + chr(0b1000001 + 0o44))(chr(5558 - 5441) + chr(0b1010100 + 0o40) + '\x66' + chr(45) + chr(0b110001 + 0o7))]:
roI3spqORKae(l4u91NaPosar, roI3spqORKae(ES5oEprVxulp(b'\xce\xcb\xdcmG:p \xd8\xa6\x8c#'), '\x64' + chr(0b10001 + 0o124) + chr(7756 - 7657) + chr(111) + '\144' + '\x65')(chr(0b1001110 + 0o47) + chr(0b1101000 + 0o14) + chr(9590 - 9488) + chr(0b101101) + '\x38'))(KCSwZZoid0kT)
elif roI3spqORKae(ES5oEprVxulp(b'\xf5\xfa\xe1-Z3T*\xc1'), chr(8848 - 8748) + chr(101) + chr(0b0 + 0o143) + '\x6f' + '\144' + chr(0b1100101))(chr(0b1001011 + 0o52) + chr(0b1100110 + 0o16) + chr(0b1100110) + chr(45) + chr(1623 - 1567)) in SrGmq6qDHmWD:
for KCSwZZoid0kT in SrGmq6qDHmWD[roI3spqORKae(ES5oEprVxulp(b'\xf5\xfa\xe1-Z3T*\xc1'), chr(0b1011001 + 0o13) + chr(101) + '\x63' + chr(542 - 431) + '\144' + chr(8696 - 8595))(chr(9149 - 9032) + chr(0b11001 + 0o133) + chr(0b1001111 + 0o27) + '\x2d' + chr(0b111000))]:
roI3spqORKae(l4u91NaPosar, roI3spqORKae(ES5oEprVxulp(b'\xce\xcb\xdcmG:p \xd8\xa6\x8c#'), chr(2688 - 2588) + chr(2562 - 2461) + '\143' + '\x6f' + chr(6293 - 6193) + '\x65')('\165' + chr(116) + '\x66' + chr(1463 - 1418) + chr(0b111000)))(KCSwZZoid0kT)
v3B6eeO_B_ws = []
for KLoRaYtbyrxk in l4u91NaPosar:
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'\xce\xcb\xdcmG:p \xd8\xa6\x8c#'), chr(100) + '\x65' + chr(2442 - 2343) + '\157' + '\144' + chr(101))(chr(117) + chr(0b1100101 + 0o17) + '\x66' + chr(0b100011 + 0o12) + chr(1698 - 1642)))(roI3spqORKae(ES5oEprVxulp(b'\xba\xec\xb1'), '\144' + chr(4321 - 4220) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(101))(chr(0b1011100 + 0o31) + '\x74' + chr(0b1100110) + '\055' + chr(0b11011 + 0o35)))
for lM7de3DJue_Z in KLoRaYtbyrxk[roI3spqORKae(ES5oEprVxulp(b'\xf1\xf0\xfd=L'), '\x64' + chr(101) + '\143' + chr(0b1011110 + 0o21) + '\x64' + chr(101))(chr(0b1101110 + 0o7) + '\x74' + chr(0b101101 + 0o71) + '\055' + '\x38')]:
if lM7de3DJue_Z[roI3spqORKae(ES5oEprVxulp(b'\xf2\xfa\xf7-'), '\144' + chr(0b1100101) + chr(0b101100 + 0o67) + '\157' + chr(100) + chr(101))(chr(117) + chr(0b1101010 + 0o12) + chr(0b1100110) + chr(0b11 + 0o52) + chr(56))] == roI3spqORKae(ES5oEprVxulp(b'\xba\xec\xb1'), '\x64' + chr(0b1001110 + 0o27) + chr(99) + chr(9889 - 9778) + chr(2955 - 2855) + '\145')(chr(11390 - 11273) + '\164' + chr(1286 - 1184) + '\x2d' + chr(56)) or lM7de3DJue_Z[roI3spqORKae(ES5oEprVxulp(b'\xf2\xfa\xf7-'), chr(100) + '\x65' + chr(99) + '\x6f' + '\x64' + chr(0b1100101))('\x75' + chr(0b1110100) + '\x66' + '\055' + chr(0b10011 + 0o45))] == roI3spqORKae(ES5oEprVxulp(b'\xba\xb0\xfcg'), chr(0b1100100) + '\x65' + '\x63' + chr(0b1101111) + chr(0b10111 + 0o115) + chr(0b11001 + 0o114))(chr(117) + '\164' + chr(102) + chr(0b100 + 0o51) + chr(0b10011 + 0o45)):
continue
JJAWRCQXg7Ql = lM7de3DJue_Z[roI3spqORKae(ES5oEprVxulp(b'\xf2\xfa\xf7-'), chr(0b100 + 0o140) + chr(0b1100101) + '\x63' + chr(10660 - 10549) + chr(0b1100100) + '\145')('\x75' + chr(0b110000 + 0o104) + chr(9382 - 9280) + '\055' + chr(1137 - 1081))]
JJAWRCQXg7Ql = Y0K4qyQWqFb2(JJAWRCQXg7Ql)
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'\xce\xcb\xdcmG:p \xd8\xa6\x8c#'), '\x64' + chr(0b1000000 + 0o45) + chr(0b100 + 0o137) + chr(0b1101100 + 0o3) + '\144' + chr(101))(chr(117) + chr(0b1110100) + '\146' + chr(0b101010 + 0o3) + '\070'))(JJAWRCQXg7Ql)
for gguAGzpinKCZ in lM7de3DJue_Z[roI3spqORKae(ES5oEprVxulp(b'\xe7\xf1\xee5F.^<'), '\x64' + chr(9594 - 9493) + chr(0b1100011) + chr(111) + '\144' + chr(0b1100101))(chr(117) + chr(2346 - 2230) + '\x66' + chr(327 - 282) + chr(214 - 158))]:
kF9CWBi2ucGu = gguAGzpinKCZ[roI3spqORKae(ES5oEprVxulp(b'\xf4\xf0\xe0-'), '\144' + chr(0b1100101) + '\143' + chr(0b1101111) + '\x64' + chr(101))(chr(0b1010001 + 0o44) + chr(0b11110 + 0o126) + chr(5749 - 5647) + chr(0b101101) + chr(0b111000))]
kF9CWBi2ucGu = Y0K4qyQWqFb2(kF9CWBi2ucGu)
gGWNbYJDKZ1z = gguAGzpinKCZ[zgdklXsg49m8]
IGIA_fu6MbaO = gguAGzpinKCZ[roI3spqORKae(ES5oEprVxulp(b'\xf6\xfe\xfd-P;D?\xd7\xac\xba~'), chr(0b101010 + 0o72) + chr(101) + '\x63' + chr(111) + '\144' + chr(1461 - 1360))(chr(0b1011101 + 0o30) + '\164' + '\146' + '\055' + chr(0b111000))]
xnngJsefWp9W = gguAGzpinKCZ[roI3spqORKae(ES5oEprVxulp(b'\xe5\xf3\xe6-V>'), '\x64' + '\145' + chr(3017 - 2918) + '\157' + chr(2334 - 2234) + chr(0b101100 + 0o71))(chr(0b111101 + 0o70) + '\x74' + '\x66' + chr(356 - 311) + chr(0b111000))]
qnYTYR39V38E = gguAGzpinKCZ[roI3spqORKae(ES5oEprVxulp(b'\xe0\xf0\xfd4'), '\x64' + '\145' + chr(99) + '\x6f' + chr(0b1100100) + chr(9475 - 9374))(chr(0b1110101) + '\164' + chr(0b1011101 + 0o11) + chr(0b100010 + 0o13) + '\070')]
if IGIA_fu6MbaO == roI3spqORKae(ES5oEprVxulp(b'\xdc'), '\x64' + '\145' + chr(99) + chr(0b100001 + 0o116) + chr(0b10110 + 0o116) + '\145')(chr(0b1110101) + chr(0b1100001 + 0o23) + chr(102) + chr(1107 - 1062) + '\x38'):
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'\xce\xcb\xdcmG:p \xd8\xa6\x8c#'), chr(100) + chr(8478 - 8377) + chr(0b1010010 + 0o21) + '\x6f' + chr(0b1100100) + '\x65')(chr(4892 - 4775) + chr(116) + chr(8565 - 8463) + '\055' + chr(566 - 510)))(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(101) + chr(2788 - 2689) + chr(5410 - 5299) + '\x64' + '\x65')('\165' + chr(0b1001001 + 0o53) + '\x66' + chr(0b1 + 0o54) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\xdf\xab\xf6\x14\x06\x1fT)\xe6\x8a\x97g'), chr(100) + '\145' + chr(0b100001 + 0o102) + '\x6f' + chr(7368 - 7268) + chr(2064 - 1963))(chr(9808 - 9691) + chr(116) + chr(102) + chr(0b101101) + chr(56)))([roI3spqORKae(ES5oEprVxulp(b'\xa6\xbf\xafy'), '\144' + chr(5809 - 5708) + chr(99) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(117) + '\x74' + chr(102) + '\055' + '\070'), kF9CWBi2ucGu, roI3spqORKae(ES5oEprVxulp(b'\xa6\xb0\xa0\x06e\x02\x17`\x9d'), chr(0b1100100) + chr(1062 - 961) + chr(0b1010011 + 0o20) + chr(111) + chr(0b1100100) + chr(101))('\x75' + chr(0b111001 + 0o73) + chr(9812 - 9710) + '\055' + '\x38')]))
else:
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'\xce\xcb\xdcmG:p \xd8\xa6\x8c#'), chr(100) + '\145' + chr(9584 - 9485) + chr(111) + chr(0b1100100) + '\x65')(chr(117) + '\164' + '\x66' + chr(1379 - 1334) + '\070'))(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b''), chr(0b101011 + 0o71) + '\145' + chr(0b101011 + 0o70) + '\157' + chr(0b1111 + 0o125) + chr(101))(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b10 + 0o66)), roI3spqORKae(ES5oEprVxulp(b'\xdf\xab\xf6\x14\x06\x1fT)\xe6\x8a\x97g'), chr(8811 - 8711) + '\145' + chr(0b1100011) + chr(2553 - 2442) + chr(100) + '\145')(chr(117) + '\164' + '\146' + '\055' + chr(56)))([roI3spqORKae(ES5oEprVxulp(b'\xa6\xbf\xafy'), '\x64' + '\145' + chr(5251 - 5152) + '\157' + chr(2481 - 2381) + '\x65')(chr(0b1110101) + '\164' + '\x66' + '\x2d' + chr(56)), kF9CWBi2ucGu, roI3spqORKae(ES5oEprVxulp(b'\xad'), chr(100) + chr(8331 - 8230) + '\x63' + '\x6f' + '\x64' + chr(0b1000111 + 0o36))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\070'), gGWNbYJDKZ1z, xnngJsefWp9W, roI3spqORKae(ES5oEprVxulp(b'\xa6\xb0\xa0'), chr(0b1100 + 0o130) + chr(0b111100 + 0o51) + chr(0b1100011) + chr(6509 - 6398) + chr(8908 - 8808) + chr(2618 - 2517))('\165' + '\x74' + '\146' + chr(0b100011 + 0o12) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\xd9'), '\144' + chr(2946 - 2845) + chr(4010 - 3911) + '\x6f' + chr(0b1100100) + '\145')(chr(961 - 844) + chr(0b1110100) + '\x66' + chr(375 - 330) + '\070'), IGIA_fu6MbaO, roI3spqORKae(ES5oEprVxulp(b'\xd9\xbf'), chr(0b1100100) + chr(5125 - 5024) + chr(0b1100011) + chr(10839 - 10728) + chr(100) + '\145')('\165' + chr(116) + chr(0b1011000 + 0o16) + chr(297 - 252) + chr(1914 - 1858)), qnYTYR39V38E, roI3spqORKae(ES5oEprVxulp(b'\xa6\xb0\xa0'), chr(9408 - 9308) + '\145' + chr(99) + '\x6f' + chr(1549 - 1449) + chr(0b111 + 0o136))(chr(117) + chr(0b1001000 + 0o54) + '\x66' + chr(0b100100 + 0o11) + chr(0b111000))]))
if roI3spqORKae(ES5oEprVxulp(b'\xe7\xf1\xee5F.^<'), chr(0b1100100) + chr(0b110101 + 0o60) + '\x63' + chr(0b1101111) + chr(4491 - 4391) + '\x65')(chr(117) + chr(8524 - 8408) + chr(102) + '\x2d' + chr(0b111000)) not in lM7de3DJue_Z:
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'\xce\xcb\xdcmG:p \xd8\xa6\x8c#'), '\x64' + '\x65' + '\143' + '\157' + chr(100) + chr(0b1000100 + 0o41))(chr(117) + chr(0b1110100) + '\x66' + '\x2d' + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\xa6\xbf\xafy'), chr(0b1100100) + '\x65' + chr(9536 - 9437) + chr(6997 - 6886) + chr(0b1100100) + '\x65')(chr(117) + chr(0b1110100) + '\146' + '\055' + chr(2250 - 2194)) + roI3spqORKae(ES5oEprVxulp(b'\xa5\xbc\xacz'), '\144' + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(100) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + '\x2d' + chr(0b11010 + 0o36)))
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'\xce\xcb\xdcmG:p \xd8\xa6\x8c#'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\x6f' + '\x64' + '\x65')(chr(0b1100100 + 0o21) + '\164' + '\146' + chr(0b101011 + 0o2) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\xba\xb0\xfcg'), chr(0b101 + 0o137) + '\x65' + chr(4833 - 4734) + '\157' + '\144' + chr(101))('\x75' + '\x74' + chr(0b1100110) + chr(45) + '\070'))
return v3B6eeO_B_ws
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
convert_Text_to_mrf
|
def convert_Text_to_mrf( text ):
''' Converts from Text object into pre-syntactic mrf format, given as a list of
lines, as in the output of etmrf.
*) If the input Text has already been morphologically analysed, uses the existing
analysis;
*) If the input has not been analysed, performs the analysis with required settings:
word quessing is turned on, proper-name analyses are turned off;
'''
from estnltk.text import Text
if not isinstance( text, Text ):
raise Exception(' Expected estnltk\'s Text as an input argument! ')
if not text.is_tagged( ANALYSIS ):
# If morphological analysis has not been performed yet, set the right arguments and
# perform the analysis
kwargs = text.get_kwargs()
kwargs['vabamorf'] = True
kwargs['guess'] = True
kwargs['propername'] = False
kwargs['disambiguate'] = False
text.__kwargs = kwargs
text = text.tag_analysis()
# Iterate over sentences and perform conversion
results = []
for sentence in text.divide( layer=WORDS, by=SENTENCES ):
results.append('<s>')
for i in range(len(sentence)):
wordJson = sentence[i]
wordStr = wordJson[TEXT]
# Escape double quotation marks
wordStr = _esc_double_quotes( wordStr )
results.append( wordStr )
for analysisJson in wordJson[ANALYSIS]:
root = analysisJson[ROOT]
root = _esc_double_quotes( root )
# NB! ending="0" erineb ending=""-st:
# 1) eestlane (ending="0");
# 2) Rio (ending="") de (ending="") Jaineros;
ending = analysisJson[ENDING]
pos = analysisJson[POSTAG]
clitic = analysisJson[CLITIC]
form = analysisJson[FORM]
if pos == 'Z':
results.append( ''.join([' ',root,' //_Z_ //']) )
else:
results.append( ''.join([' ',root,'+',ending,clitic,' //', '_',pos,'_ ',form,' //']) )
if ANALYSIS not in wordJson:
results.append( ' '+'####' )
results.append('</s>')
return results
|
python
|
def convert_Text_to_mrf( text ):
''' Converts from Text object into pre-syntactic mrf format, given as a list of
lines, as in the output of etmrf.
*) If the input Text has already been morphologically analysed, uses the existing
analysis;
*) If the input has not been analysed, performs the analysis with required settings:
word quessing is turned on, proper-name analyses are turned off;
'''
from estnltk.text import Text
if not isinstance( text, Text ):
raise Exception(' Expected estnltk\'s Text as an input argument! ')
if not text.is_tagged( ANALYSIS ):
# If morphological analysis has not been performed yet, set the right arguments and
# perform the analysis
kwargs = text.get_kwargs()
kwargs['vabamorf'] = True
kwargs['guess'] = True
kwargs['propername'] = False
kwargs['disambiguate'] = False
text.__kwargs = kwargs
text = text.tag_analysis()
# Iterate over sentences and perform conversion
results = []
for sentence in text.divide( layer=WORDS, by=SENTENCES ):
results.append('<s>')
for i in range(len(sentence)):
wordJson = sentence[i]
wordStr = wordJson[TEXT]
# Escape double quotation marks
wordStr = _esc_double_quotes( wordStr )
results.append( wordStr )
for analysisJson in wordJson[ANALYSIS]:
root = analysisJson[ROOT]
root = _esc_double_quotes( root )
# NB! ending="0" erineb ending=""-st:
# 1) eestlane (ending="0");
# 2) Rio (ending="") de (ending="") Jaineros;
ending = analysisJson[ENDING]
pos = analysisJson[POSTAG]
clitic = analysisJson[CLITIC]
form = analysisJson[FORM]
if pos == 'Z':
results.append( ''.join([' ',root,' //_Z_ //']) )
else:
results.append( ''.join([' ',root,'+',ending,clitic,' //', '_',pos,'_ ',form,' //']) )
if ANALYSIS not in wordJson:
results.append( ' '+'####' )
results.append('</s>')
return results
|
[
"def",
"convert_Text_to_mrf",
"(",
"text",
")",
":",
"from",
"estnltk",
".",
"text",
"import",
"Text",
"if",
"not",
"isinstance",
"(",
"text",
",",
"Text",
")",
":",
"raise",
"Exception",
"(",
"' Expected estnltk\\'s Text as an input argument! '",
")",
"if",
"not",
"text",
".",
"is_tagged",
"(",
"ANALYSIS",
")",
":",
"# If morphological analysis has not been performed yet, set the right arguments and ",
"# perform the analysis ",
"kwargs",
"=",
"text",
".",
"get_kwargs",
"(",
")",
"kwargs",
"[",
"'vabamorf'",
"]",
"=",
"True",
"kwargs",
"[",
"'guess'",
"]",
"=",
"True",
"kwargs",
"[",
"'propername'",
"]",
"=",
"False",
"kwargs",
"[",
"'disambiguate'",
"]",
"=",
"False",
"text",
".",
"__kwargs",
"=",
"kwargs",
"text",
"=",
"text",
".",
"tag_analysis",
"(",
")",
"# Iterate over sentences and perform conversion",
"results",
"=",
"[",
"]",
"for",
"sentence",
"in",
"text",
".",
"divide",
"(",
"layer",
"=",
"WORDS",
",",
"by",
"=",
"SENTENCES",
")",
":",
"results",
".",
"append",
"(",
"'<s>'",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"sentence",
")",
")",
":",
"wordJson",
"=",
"sentence",
"[",
"i",
"]",
"wordStr",
"=",
"wordJson",
"[",
"TEXT",
"]",
"# Escape double quotation marks",
"wordStr",
"=",
"_esc_double_quotes",
"(",
"wordStr",
")",
"results",
".",
"append",
"(",
"wordStr",
")",
"for",
"analysisJson",
"in",
"wordJson",
"[",
"ANALYSIS",
"]",
":",
"root",
"=",
"analysisJson",
"[",
"ROOT",
"]",
"root",
"=",
"_esc_double_quotes",
"(",
"root",
")",
"# NB! ending=\"0\" erineb ending=\"\"-st:",
"# 1) eestlane (ending=\"0\");",
"# 2) Rio (ending=\"\") de (ending=\"\") Jaineros;",
"ending",
"=",
"analysisJson",
"[",
"ENDING",
"]",
"pos",
"=",
"analysisJson",
"[",
"POSTAG",
"]",
"clitic",
"=",
"analysisJson",
"[",
"CLITIC",
"]",
"form",
"=",
"analysisJson",
"[",
"FORM",
"]",
"if",
"pos",
"==",
"'Z'",
":",
"results",
".",
"append",
"(",
"''",
".",
"join",
"(",
"[",
"' '",
",",
"root",
",",
"' //_Z_ //'",
"]",
")",
")",
"else",
":",
"results",
".",
"append",
"(",
"''",
".",
"join",
"(",
"[",
"' '",
",",
"root",
",",
"'+'",
",",
"ending",
",",
"clitic",
",",
"' //'",
",",
"'_'",
",",
"pos",
",",
"'_ '",
",",
"form",
",",
"' //'",
"]",
")",
")",
"if",
"ANALYSIS",
"not",
"in",
"wordJson",
":",
"results",
".",
"append",
"(",
"' '",
"+",
"'####'",
")",
"results",
".",
"append",
"(",
"'</s>'",
")",
"return",
"results"
] |
Converts from Text object into pre-syntactic mrf format, given as a list of
lines, as in the output of etmrf.
*) If the input Text has already been morphologically analysed, uses the existing
analysis;
*) If the input has not been analysed, performs the analysis with required settings:
word quessing is turned on, proper-name analyses are turned off;
|
[
"Converts",
"from",
"Text",
"object",
"into",
"pre",
"-",
"syntactic",
"mrf",
"format",
"given",
"as",
"a",
"list",
"of",
"lines",
"as",
"in",
"the",
"output",
"of",
"etmrf",
".",
"*",
")",
"If",
"the",
"input",
"Text",
"has",
"already",
"been",
"morphologically",
"analysed",
"uses",
"the",
"existing",
"analysis",
";",
"*",
")",
"If",
"the",
"input",
"has",
"not",
"been",
"analysed",
"performs",
"the",
"analysis",
"with",
"required",
"settings",
":",
"word",
"quessing",
"is",
"turned",
"on",
"proper",
"-",
"name",
"analyses",
"are",
"turned",
"off",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L156-L204
|
train
|
Converts a Text object into a list of pre - syntactic mrf format given as a list of
lines.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjF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N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(111) + '\x36' + chr(0b110110), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110 + 0o55) + chr(0b101011 + 0o11) + chr(0b110101), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(2092 - 2042) + chr(76 - 27), 56062 - 56054), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b110111) + '\067', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(12097 - 11986) + chr(0b10000 + 0o43) + chr(61 - 12) + '\066', 0b1000), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1101111) + chr(0b10111 + 0o34) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + chr(0b10 + 0o60) + chr(0b1101 + 0o43), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + '\066' + chr(0b101001 + 0o11), ord("\x08")), nzTpIcepk0o8(chr(428 - 380) + chr(0b1101111) + chr(2110 - 2057) + '\066', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + '\x35' + chr(0b101110 + 0o2), 46793 - 46785), nzTpIcepk0o8('\x30' + chr(111) + chr(55) + '\x33', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(811 - 760) + chr(0b110000), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\062' + chr(0b1011 + 0o50) + '\063', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(177 - 128) + chr(2100 - 2051), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\x33' + '\x36' + chr(1632 - 1577), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + '\065' + chr(49), 49404 - 49396), nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b1101111) + '\061' + chr(836 - 782) + chr(0b1010 + 0o46), 0b1000), nzTpIcepk0o8(chr(0b1000 + 0o50) + '\157' + chr(51) + chr(52), 0b1000), nzTpIcepk0o8('\060' + chr(10372 - 10261) + '\x33' + chr(0b110100) + chr(0b1111 + 0o45), 0b1000), nzTpIcepk0o8(chr(1304 - 1256) + chr(6601 - 6490) + '\x32' + chr(0b110011) + chr(53), 40720 - 40712), nzTpIcepk0o8(chr(716 - 668) + chr(7458 - 7347) + chr(1936 - 1887) + chr(876 - 825), 0o10), nzTpIcepk0o8(chr(1249 - 1201) + chr(0b1000000 + 0o57) + chr(2322 - 2273) + chr(0b101010 + 0o10) + '\x35', 43139 - 43131), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b110000) + chr(1151 - 1100), 0b1000), nzTpIcepk0o8('\060' + chr(9093 - 8982) + '\064' + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(52) + '\x37', 8), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\x6f' + '\x36' + chr(54), 8), nzTpIcepk0o8(chr(1802 - 1754) + '\x6f' + chr(143 - 93) + chr(0b101001 + 0o12) + '\061', 11201 - 11193), nzTpIcepk0o8('\x30' + '\157' + chr(0b111 + 0o56), 0b1000), nzTpIcepk0o8('\060' + chr(0b110 + 0o151) + chr(49) + chr(53) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b10000 + 0o137) + chr(49) + chr(0b101100 + 0o7) + chr(0b110011), 12509 - 12501), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b100101 + 0o14) + '\x36' + chr(0b100 + 0o55), ord("\x08")), nzTpIcepk0o8(chr(2290 - 2242) + chr(111) + chr(0b110011) + chr(54) + chr(0b110001), 48679 - 48671), nzTpIcepk0o8('\x30' + chr(6616 - 6505) + chr(2224 - 2174) + chr(50) + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + chr(1415 - 1304) + chr(0b11 + 0o57) + chr(0b100000 + 0o26) + chr(0b111 + 0o52), 0b1000), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(111) + chr(0b110010) + '\x34', 34823 - 34815), nzTpIcepk0o8('\x30' + '\157' + chr(0b100110 + 0o17) + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(0b110001 + 0o3) + chr(54), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b10001 + 0o136) + chr(0b101011 + 0o6) + chr(0b110011) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x37' + chr(0b110 + 0o60), 0b1000), nzTpIcepk0o8(chr(1549 - 1501) + chr(111) + chr(1636 - 1585) + chr(0b111 + 0o56) + '\x37', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(4300 - 4189) + chr(53) + chr(48), 19597 - 19589)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x18'), chr(0b110010 + 0o62) + '\x65' + chr(3026 - 2927) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(0b110000 + 0o105) + '\x74' + '\146' + chr(0b101011 + 0o2) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def xQLLh3X5MXnv(cpStk7cY1TJd):
(Yunp_Kt7vLoC,) = (roI3spqORKae(roI3spqORKae(rFFUeiYWzOhx(roI3spqORKae(ES5oEprVxulp(b'S\x96%\x91\xa2n\xbb\x9cZ\x8dCl'), '\x64' + '\x65' + '\x63' + chr(0b1100110 + 0o11) + chr(0b111011 + 0o51) + chr(0b1100101))(chr(6852 - 6735) + chr(6557 - 6441) + chr(0b1100110) + chr(0b1101 + 0o40) + chr(0b11110 + 0o32)), roI3spqORKae(ES5oEprVxulp(b'b\x80)\x8b'), chr(100) + chr(0b1100101) + '\x63' + '\157' + chr(0b110100 + 0o60) + chr(0b1100101))('\x75' + '\x74' + '\x66' + chr(45) + chr(0b111000))), roI3spqORKae(ES5oEprVxulp(b'B\x80)\x8b'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b110000 + 0o77) + chr(0b1000000 + 0o44) + chr(0b1011101 + 0o10))('\x75' + chr(376 - 260) + '\x66' + '\055' + '\070')), roI3spqORKae(ES5oEprVxulp(b'b\x80)\x8b'), chr(100) + chr(568 - 467) + chr(99) + chr(9771 - 9660) + chr(0b111101 + 0o47) + '\145')(chr(117) + '\164' + chr(0b1011111 + 0o7) + chr(0b1101 + 0o40) + chr(0b111000))),)
if not suIjIS24Zkqw(cpStk7cY1TJd, Yunp_Kt7vLoC):
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b"\x16\xa0)\x8f\xaby\xa4\xd7J\xc8^k\xef'\x9b\xdd\x1b;\x97\xbd_0\xbbS\x07W\xea%\x0b5Q\x98\xfc\xc1aXF>L\x88C\x884\x91\xba;\xf0"), '\144' + chr(203 - 102) + '\143' + chr(111) + '\144' + chr(9997 - 9896))(chr(9314 - 9197) + chr(0b1110001 + 0o3) + chr(3647 - 3545) + chr(0b10101 + 0o30) + chr(1940 - 1884)))
if not roI3spqORKae(cpStk7cY1TJd, roI3spqORKae(ES5oEprVxulp(b'_\x96\x0e\x8b\xaf}\xb7\xd7J'), chr(0b100 + 0o140) + '\145' + chr(0b101011 + 0o70) + chr(0b1101111) + chr(0b110001 + 0o63) + chr(0b110101 + 0o60))('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b101011 + 0o2) + chr(56)))(otAw_H2b5sjH):
q5n0sHDDTy90 = cpStk7cY1TJd.get_kwargs()
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'@\x843\x9e\xa3u\xa2\xd4'), '\x64' + chr(101) + chr(548 - 449) + chr(7308 - 7197) + chr(0b101 + 0o137) + chr(421 - 320))('\x75' + chr(7074 - 6958) + '\x66' + chr(0b11001 + 0o24) + '\070')] = nzTpIcepk0o8(chr(0b10101 + 0o33) + '\157' + '\061', ord("\x08"))
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'Q\x904\x8c\xbd'), chr(0b1100100) + chr(101) + chr(0b111 + 0o134) + chr(0b1101111) + chr(0b1100100) + chr(101))('\x75' + chr(0b1110100) + chr(0b111 + 0o137) + chr(45) + '\070')] = nzTpIcepk0o8('\x30' + chr(0b11100 + 0o123) + chr(0b110 + 0o53), 8)
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'F\x97>\x8f\xabh\xbe\xd3C\x8d'), chr(9532 - 9432) + chr(0b1010111 + 0o16) + '\x63' + chr(12254 - 12143) + chr(0b1100100) + chr(101))(chr(0b1110101) + '\164' + chr(102) + '\x2d' + '\070')] = nzTpIcepk0o8('\060' + chr(0b1100010 + 0o15) + chr(0b11011 + 0o25), 0b1000)
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'R\x8c"\x9e\xa3x\xb9\xd5[\x89O}'), '\x64' + '\x65' + chr(0b1100011) + '\157' + chr(0b1100100) + '\x65')(chr(0b101001 + 0o114) + chr(0b1000 + 0o154) + '\146' + chr(406 - 361) + chr(297 - 241))] = nzTpIcepk0o8('\x30' + '\x6f' + chr(885 - 837), 8)
cpStk7cY1TJd.cFrTr8Cek0pN = q5n0sHDDTy90
cpStk7cY1TJd = cpStk7cY1TJd.tag_analysis()
v3B6eeO_B_ws = []
for v3YfwzoUholR in roI3spqORKae(cpStk7cY1TJd, roI3spqORKae(ES5oEprVxulp(b"R\x8c'\x96\xaa\x7f"), chr(0b1100100) + '\x65' + '\x63' + chr(111) + '\x64' + '\145')(chr(0b1011010 + 0o33) + chr(0b10000 + 0o144) + '\146' + chr(0b101101) + chr(0b10110 + 0o42)))(layer=dwqZnwPLrnLJ, by=DUoBUczr5TtH):
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'~\xb1\x02\xcb\xb6}\x97\xddD\x87n-'), chr(2576 - 2476) + '\145' + '\x63' + chr(0b1101111) + '\144' + chr(0b1100101))(chr(4739 - 4622) + chr(12465 - 12349) + chr(427 - 325) + '\055' + chr(689 - 633)))(roI3spqORKae(ES5oEprVxulp(b'\n\x96o'), '\144' + '\x65' + '\143' + '\157' + chr(0b1100100) + chr(3229 - 3128))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b111000)))
for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(v3YfwzoUholR)):
lM7de3DJue_Z = v3YfwzoUholR[ZlbFMSG8gCoF]
JJAWRCQXg7Ql = lM7de3DJue_Z[JPzDaf6_RoFd]
JJAWRCQXg7Ql = Y0K4qyQWqFb2(JJAWRCQXg7Ql)
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'~\xb1\x02\xcb\xb6}\x97\xddD\x87n-'), '\144' + '\x65' + chr(0b1100011) + chr(111) + chr(100) + chr(7942 - 7841))(chr(117) + chr(116) + '\x66' + chr(0b101101) + chr(56)))(JJAWRCQXg7Ql)
for gguAGzpinKCZ in lM7de3DJue_Z[otAw_H2b5sjH]:
kF9CWBi2ucGu = gguAGzpinKCZ[XsvoTOpX8A2b]
kF9CWBi2ucGu = Y0K4qyQWqFb2(kF9CWBi2ucGu)
gGWNbYJDKZ1z = gguAGzpinKCZ[zgdklXsg49m8]
IGIA_fu6MbaO = gguAGzpinKCZ[QivUjX90e7n8]
xnngJsefWp9W = gguAGzpinKCZ[wh2l35lgVgt0]
qnYTYR39V38E = gguAGzpinKCZ[invlgHm8TzbV]
if IGIA_fu6MbaO == roI3spqORKae(ES5oEprVxulp(b'l'), '\144' + chr(0b1100101) + chr(0b1001001 + 0o32) + chr(0b1101001 + 0o6) + '\144' + chr(0b1100101))('\165' + chr(0b11001 + 0o133) + chr(2606 - 2504) + '\x2d' + chr(1187 - 1131)):
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'~\xb1\x02\xcb\xb6}\x97\xddD\x87n-'), '\x64' + chr(0b1100101) + chr(99) + '\157' + '\144' + chr(0b1100101))(chr(7117 - 7000) + chr(0b1110100) + chr(102) + chr(0b101101) + '\070'))(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b''), chr(4655 - 4555) + chr(0b1100101) + chr(0b1100011 + 0o0) + chr(0b1101111) + '\x64' + chr(251 - 150))('\165' + '\x74' + '\146' + chr(1230 - 1185) + '\070'), roI3spqORKae(ES5oEprVxulp(b'o\xd1(\xb2\xf7X\xb3\xd4z\xabui'), chr(0b1100100) + chr(1038 - 937) + '\143' + chr(111) + '\144' + '\145')(chr(0b1001011 + 0o52) + chr(0b1011011 + 0o31) + chr(6156 - 6054) + '\x2d' + '\070'))([roI3spqORKae(ES5oEprVxulp(b'\x16\xc5q\xdf'), chr(0b1100100) + '\x65' + '\143' + '\157' + chr(0b1100100) + chr(101))('\165' + chr(0b1010000 + 0o44) + chr(0b101100 + 0o72) + chr(0b101 + 0o50) + chr(2984 - 2928)), kF9CWBi2ucGu, roI3spqORKae(ES5oEprVxulp(b'\x16\xca~\xa0\x94E\xf0\x9d\x01'), chr(6623 - 6523) + chr(0b1100101) + chr(0b1100011) + chr(5561 - 5450) + '\144' + chr(0b1100101))('\x75' + chr(2214 - 2098) + '\x66' + '\055' + chr(56))]))
else:
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'~\xb1\x02\xcb\xb6}\x97\xddD\x87n-'), chr(100) + '\x65' + '\143' + chr(111) + chr(9601 - 9501) + chr(5445 - 5344))(chr(117) + '\164' + chr(102) + '\x2d' + chr(3118 - 3062)))(roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b''), chr(9404 - 9304) + '\145' + chr(0b1010001 + 0o22) + chr(111) + chr(1017 - 917) + chr(0b1110 + 0o127))(chr(0b1110101) + '\164' + chr(102) + '\055' + chr(0b101111 + 0o11)), roI3spqORKae(ES5oEprVxulp(b'o\xd1(\xb2\xf7X\xb3\xd4z\xabui'), chr(355 - 255) + chr(0b1100101) + chr(0b1100011) + chr(111) + '\144' + chr(101))(chr(117) + '\164' + chr(0b110011 + 0o63) + chr(1616 - 1571) + chr(0b111000)))([roI3spqORKae(ES5oEprVxulp(b'\x16\xc5q\xdf'), '\144' + chr(101) + '\143' + chr(111) + '\x64' + chr(101))(chr(3651 - 3534) + chr(0b1011 + 0o151) + '\146' + chr(193 - 148) + '\070'), kF9CWBi2ucGu, roI3spqORKae(ES5oEprVxulp(b'\x1d'), chr(100) + '\145' + '\x63' + chr(0b1101111) + '\x64' + chr(4822 - 4721))(chr(0b1110101) + '\164' + '\146' + chr(45) + chr(0b10111 + 0o41)), gGWNbYJDKZ1z, xnngJsefWp9W, roI3spqORKae(ES5oEprVxulp(b'\x16\xca~'), chr(100) + chr(101) + chr(0b1100011) + chr(6693 - 6582) + chr(0b10110 + 0o116) + '\145')(chr(0b1010010 + 0o43) + '\x74' + chr(10185 - 10083) + '\x2d' + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'i'), chr(100) + '\x65' + chr(99) + chr(0b11101 + 0o122) + chr(0b1100100) + chr(101))(chr(117) + chr(116) + '\x66' + '\x2d' + chr(56)), IGIA_fu6MbaO, roI3spqORKae(ES5oEprVxulp(b'i\xc5'), '\144' + chr(0b1100101) + '\x63' + chr(0b1101111) + '\144' + chr(0b1100101))(chr(12087 - 11970) + '\x74' + '\x66' + '\055' + chr(667 - 611)), qnYTYR39V38E, roI3spqORKae(ES5oEprVxulp(b'\x16\xca~'), chr(0b111100 + 0o50) + chr(0b1001010 + 0o33) + chr(99) + chr(111) + '\x64' + chr(0b1100101))(chr(0b1010101 + 0o40) + '\x74' + chr(0b1001101 + 0o31) + chr(0b101101) + '\070')]))
if otAw_H2b5sjH not in lM7de3DJue_Z:
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'~\xb1\x02\xcb\xb6}\x97\xddD\x87n-'), chr(100) + chr(0b101111 + 0o66) + '\143' + chr(111) + chr(100) + chr(0b111010 + 0o53))(chr(1968 - 1851) + '\164' + chr(0b1000100 + 0o42) + chr(0b101101) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\x16\xc5q\xdf'), '\144' + '\145' + '\143' + chr(12128 - 12017) + chr(3949 - 3849) + '\x65')('\165' + chr(0b1100010 + 0o22) + '\x66' + chr(45) + '\x38') + roI3spqORKae(ES5oEprVxulp(b'\x15\xc6r\xdc'), chr(100) + chr(0b111111 + 0o46) + chr(0b1100011) + chr(3442 - 3331) + chr(0b1100100) + '\145')(chr(5682 - 5565) + chr(0b1110100) + chr(102) + chr(1347 - 1302) + chr(0b10110 + 0o42)))
roI3spqORKae(v3B6eeO_B_ws, roI3spqORKae(ES5oEprVxulp(b'~\xb1\x02\xcb\xb6}\x97\xddD\x87n-'), chr(100) + chr(0b1100101) + chr(99) + chr(0b1010111 + 0o30) + chr(0b11 + 0o141) + '\145')(chr(0b1000001 + 0o64) + chr(12992 - 12876) + chr(0b1 + 0o145) + chr(45) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\n\xca"\xc1'), '\x64' + chr(0b10110 + 0o117) + '\x63' + '\x6f' + chr(7531 - 7431) + '\145')(chr(0b1110101) + '\164' + chr(0b111000 + 0o56) + chr(0b1111 + 0o36) + chr(3017 - 2961)))
return v3B6eeO_B_ws
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
load_fs_mrf_to_syntax_mrf_translation_rules
|
def load_fs_mrf_to_syntax_mrf_translation_rules( rulesFile ):
''' Loads rules that can be used to convert from Filosoft's mrf format to
syntactic analyzer's format. Returns a dict containing rules.
Expects that each line in the input file contains a single rule, and that
different parts of the rule separated by @ symbols, e.g.
1@_S_ ?@Substantiiv apellatiiv@_S_ com @Noun common@Nc@NCSX@kesk-
32@_H_ ?@Substantiiv prooprium@_S_ prop @Noun proper@Np@NPCSX@Kesk-
313@_A_@Adjektiiv positiiv@_A_ pos@Adjective positive@A-p@ASX@salkus
Only 2nd element and 4th element are extracted from each line; 2nd element
will be the key of the dict entry, and 4th element will be added to the
value of the dict entry (the value is a list of strings);
A list is used for storing values because one Filosoft's analysis could
be mapped to multiple syntactic analyzer's analyses;
Lines that have ¤ in the beginning of the line will be skipped;
'''
rules = {}
in_f = codecs.open(rulesFile, mode='r', encoding='utf-8')
for line in in_f:
line = line.rstrip()
if line.startswith('¤'):
continue
parts = line.split('@')
if len(parts) < 4:
raise Exception(' Unexpected format of the line: ', line)
if parts[1] not in rules:
rules[parts[1]] = []
rules[parts[1]].append( parts[3] )
in_f.close()
return rules
|
python
|
def load_fs_mrf_to_syntax_mrf_translation_rules( rulesFile ):
''' Loads rules that can be used to convert from Filosoft's mrf format to
syntactic analyzer's format. Returns a dict containing rules.
Expects that each line in the input file contains a single rule, and that
different parts of the rule separated by @ symbols, e.g.
1@_S_ ?@Substantiiv apellatiiv@_S_ com @Noun common@Nc@NCSX@kesk-
32@_H_ ?@Substantiiv prooprium@_S_ prop @Noun proper@Np@NPCSX@Kesk-
313@_A_@Adjektiiv positiiv@_A_ pos@Adjective positive@A-p@ASX@salkus
Only 2nd element and 4th element are extracted from each line; 2nd element
will be the key of the dict entry, and 4th element will be added to the
value of the dict entry (the value is a list of strings);
A list is used for storing values because one Filosoft's analysis could
be mapped to multiple syntactic analyzer's analyses;
Lines that have ¤ in the beginning of the line will be skipped;
'''
rules = {}
in_f = codecs.open(rulesFile, mode='r', encoding='utf-8')
for line in in_f:
line = line.rstrip()
if line.startswith('¤'):
continue
parts = line.split('@')
if len(parts) < 4:
raise Exception(' Unexpected format of the line: ', line)
if parts[1] not in rules:
rules[parts[1]] = []
rules[parts[1]].append( parts[3] )
in_f.close()
return rules
|
[
"def",
"load_fs_mrf_to_syntax_mrf_translation_rules",
"(",
"rulesFile",
")",
":",
"rules",
"=",
"{",
"}",
"in_f",
"=",
"codecs",
".",
"open",
"(",
"rulesFile",
",",
"mode",
"=",
"'r'",
",",
"encoding",
"=",
"'utf-8'",
")",
"for",
"line",
"in",
"in_f",
":",
"line",
"=",
"line",
".",
"rstrip",
"(",
")",
"if",
"line",
".",
"startswith",
"(",
"'¤')",
":",
"",
"continue",
"parts",
"=",
"line",
".",
"split",
"(",
"'@'",
")",
"if",
"len",
"(",
"parts",
")",
"<",
"4",
":",
"raise",
"Exception",
"(",
"' Unexpected format of the line: '",
",",
"line",
")",
"if",
"parts",
"[",
"1",
"]",
"not",
"in",
"rules",
":",
"rules",
"[",
"parts",
"[",
"1",
"]",
"]",
"=",
"[",
"]",
"rules",
"[",
"parts",
"[",
"1",
"]",
"]",
".",
"append",
"(",
"parts",
"[",
"3",
"]",
")",
"in_f",
".",
"close",
"(",
")",
"return",
"rules"
] |
Loads rules that can be used to convert from Filosoft's mrf format to
syntactic analyzer's format. Returns a dict containing rules.
Expects that each line in the input file contains a single rule, and that
different parts of the rule separated by @ symbols, e.g.
1@_S_ ?@Substantiiv apellatiiv@_S_ com @Noun common@Nc@NCSX@kesk-
32@_H_ ?@Substantiiv prooprium@_S_ prop @Noun proper@Np@NPCSX@Kesk-
313@_A_@Adjektiiv positiiv@_A_ pos@Adjective positive@A-p@ASX@salkus
Only 2nd element and 4th element are extracted from each line; 2nd element
will be the key of the dict entry, and 4th element will be added to the
value of the dict entry (the value is a list of strings);
A list is used for storing values because one Filosoft's analysis could
be mapped to multiple syntactic analyzer's analyses;
Lines that have ¤ in the beginning of the line will be skipped;
|
[
"Loads",
"rules",
"that",
"can",
"be",
"used",
"to",
"convert",
"from",
"Filosoft",
"s",
"mrf",
"format",
"to",
"syntactic",
"analyzer",
"s",
"format",
".",
"Returns",
"a",
"dict",
"containing",
"rules",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L214-L248
|
train
|
Loads rules that can be used to convert from Filosoft s mrf format to
syntactic analyzer s format. Returns a dict containing rules that can be used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NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(942 - 893) + chr(55) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1011110 + 0o21) + chr(0b110011) + '\x32' + chr(0b11 + 0o56), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + chr(0b110001) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(1180 - 1132) + chr(0b1101111) + '\x31' + chr(0b110011) + chr(947 - 894), ord("\x08")), nzTpIcepk0o8(chr(981 - 933) + '\x6f' + chr(0b110010) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b10001 + 0o136) + '\062' + chr(0b110001) + '\x32', 52035 - 52027), nzTpIcepk0o8(chr(48) + chr(0b1010100 + 0o33) + '\x33' + '\063' + '\x33', 32880 - 32872), nzTpIcepk0o8('\x30' + chr(0b1101001 + 0o6) + chr(0b11010 + 0o31) + chr(0b110000) + '\061', 27485 - 27477), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\157' + chr(0b1001 + 0o50) + chr(0b110110) + chr(0b101101 + 0o6), 1589 - 1581), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1772 - 1723) + chr(0b110000) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b101000 + 0o107) + '\x32' + chr(50) + chr(1735 - 1683), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + chr(51), 0o10), nzTpIcepk0o8(chr(757 - 709) + chr(0b1101111) + '\063' + chr(0b110001), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(954 - 905) + chr(53), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1 + 0o61) + chr(0b111 + 0o51) + chr(0b101010 + 0o12), 0b1000), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + '\061' + chr(0b110000 + 0o6) + '\061', ord("\x08")), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1010010 + 0o35) + chr(0b100000 + 0o22) + chr(0b110000) + chr(0b101000 + 0o16), 0b1000), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b1101111) + chr(2016 - 1966) + '\067' + chr(1601 - 1551), 47111 - 47103), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b100000 + 0o21) + chr(53), 8), nzTpIcepk0o8('\060' + chr(0b10011 + 0o134) + chr(993 - 944) + '\067', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110000 + 0o2) + '\064' + '\x30', 10245 - 10237), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110010) + chr(55) + '\066', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\063', 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110111), 31441 - 31433), nzTpIcepk0o8(chr(2229 - 2181) + chr(111) + '\x32' + '\x32' + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1882 - 1833) + chr(0b101111 + 0o4) + '\x35', 8), nzTpIcepk0o8(chr(48) + '\x6f' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b10101 + 0o33) + '\x6f' + chr(49) + chr(0b1100 + 0o47) + '\065', 8), nzTpIcepk0o8(chr(48) + chr(0b100000 + 0o117) + chr(51) + chr(0b1110 + 0o44), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\061' + '\x33' + chr(48), 0b1000), nzTpIcepk0o8(chr(500 - 452) + chr(0b1101111) + '\x32' + chr(0b110000) + '\065', 33503 - 33495), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(5069 - 4958) + chr(0b11100 + 0o27) + '\064', 19473 - 19465), nzTpIcepk0o8(chr(57 - 9) + chr(11687 - 11576) + '\x32' + chr(0b10011 + 0o42) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(52) + '\062', 10657 - 10649), nzTpIcepk0o8('\060' + chr(6584 - 6473) + '\x33' + chr(49) + chr(0b110011), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x32' + '\061' + chr(50), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(49) + chr(2156 - 2105), 0b1000), nzTpIcepk0o8('\x30' + chr(8325 - 8214) + chr(1243 - 1194) + chr(0b110000) + chr(0b1110 + 0o45), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + chr(0b100101 + 0o13) + '\x31', 8), nzTpIcepk0o8('\060' + chr(0b1100011 + 0o14) + '\063' + chr(102 - 50) + chr(847 - 792), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\157' + '\065' + chr(0b11010 + 0o26), 1449 - 1441)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'Q'), '\144' + chr(7488 - 7387) + chr(99) + chr(10292 - 10181) + chr(0b1100100) + chr(0b1100101))(chr(5280 - 5163) + '\164' + chr(102) + chr(0b101101) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Mf3NPPvc_MBI(uti8pvS7lzk4):
YjCtpAh18y9x = {}
mkkQK_f7m_F1 = Hj8X5RtMNBIn.DnU3Rq9N5ala(uti8pvS7lzk4, mode=roI3spqORKae(ES5oEprVxulp(b'\r'), '\x64' + '\145' + chr(5473 - 5374) + chr(0b1011000 + 0o27) + '\144' + chr(101))('\x75' + '\x74' + chr(0b1101 + 0o131) + '\055' + chr(0b101100 + 0o14)), encoding=roI3spqORKae(ES5oEprVxulp(b'\n\xa5\xefp('), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(111) + chr(0b1010110 + 0o16) + '\145')('\165' + chr(0b111110 + 0o66) + chr(4343 - 4241) + chr(45) + '\070'))
for ffiOpFBWGmZU in mkkQK_f7m_F1:
ffiOpFBWGmZU = ffiOpFBWGmZU.rstrip()
if roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'\x0c\xa5\xe8/d\xf9\xac\xa8\x07*'), chr(0b110011 + 0o61) + chr(0b1011001 + 0o14) + chr(0b110000 + 0o63) + chr(0b1101111) + chr(100) + chr(101))(chr(11699 - 11582) + chr(4241 - 4125) + chr(9574 - 9472) + chr(45) + '\070'))(roI3spqORKae(ES5oEprVxulp(b'\xbdu'), chr(0b1010001 + 0o23) + chr(0b110000 + 0o65) + chr(0b1100011) + chr(0b1101111) + chr(100) + '\x65')(chr(0b1110101) + chr(5576 - 5460) + '\146' + '\055' + '\070')):
continue
ws_9aXBYp0Zv = ffiOpFBWGmZU.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'?'), chr(100) + chr(2050 - 1949) + chr(0b1011000 + 0o13) + chr(111) + '\144' + chr(101))(chr(8069 - 7952) + chr(116) + chr(0b1100110) + '\055' + chr(995 - 939)))
if ftfygxgFas5X(ws_9aXBYp0Zv) < nzTpIcepk0o8(chr(48) + '\157' + chr(0b110100), 0o10):
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b"_\x84\xe78h\xfa\xbe\xa2\x07'\xf03\x7fb\xf6\x1c\xe7\xce-`\xc6\x9ego\xf5}j4t=\xbf<"), '\144' + chr(0b1100101) + chr(0b1011111 + 0o4) + '\x6f' + chr(0b1001001 + 0o33) + '\x65')(chr(10689 - 10572) + '\164' + '\146' + chr(0b1001 + 0o44) + chr(1218 - 1162)), ffiOpFBWGmZU)
if ws_9aXBYp0Zv[nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31', 0o10)] not in YjCtpAh18y9x:
YjCtpAh18y9x[ws_9aXBYp0Zv[nzTpIcepk0o8('\x30' + '\157' + '\x31', 8)]] = []
roI3spqORKae(YjCtpAh18y9x[ws_9aXBYp0Zv[nzTpIcepk0o8('\060' + '\x6f' + chr(1378 - 1329), 8)]], roI3spqORKae(ES5oEprVxulp(b'7\x85\xdaih\xed\x9c\xae\x19-\xc1&'), chr(0b1010000 + 0o24) + chr(101) + chr(0b1100011) + '\157' + chr(100) + chr(101))('\165' + chr(11911 - 11795) + chr(0b110001 + 0o65) + '\055' + '\x38'))(ws_9aXBYp0Zv[nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(6544 - 6433) + '\x33', ord("\x08"))])
roI3spqORKae(mkkQK_f7m_F1, roI3spqORKae(ES5oEprVxulp(b'%\xb4\xf8jS\xe9\xbd\xf8&&\xacy'), chr(0b1100100) + chr(0b1100101) + chr(6390 - 6291) + '\157' + '\144' + chr(101))(chr(117) + chr(9897 - 9781) + chr(0b1100110) + chr(0b10000 + 0o35) + chr(273 - 217)))()
return YjCtpAh18y9x
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
_convert_punctuation
|
def _convert_punctuation( line ):
''' Converts given analysis line if it describes punctuation; Uses the set
of predefined punctuation conversion rules from _punctConversions;
_punctConversions should be a list of lists, where each outer list stands
for a single conversion rule and inner list contains a pair of elements:
first is the regexp pattern and the second is the replacement, used in
re.sub( pattern, replacement, line )
Returns the converted line (same as input, if no conversion was
performed);
'''
for [pattern, replacement] in _punctConversions:
lastline = line
line = re.sub(pattern, replacement, line)
if lastline != line:
break
return line
|
python
|
def _convert_punctuation( line ):
''' Converts given analysis line if it describes punctuation; Uses the set
of predefined punctuation conversion rules from _punctConversions;
_punctConversions should be a list of lists, where each outer list stands
for a single conversion rule and inner list contains a pair of elements:
first is the regexp pattern and the second is the replacement, used in
re.sub( pattern, replacement, line )
Returns the converted line (same as input, if no conversion was
performed);
'''
for [pattern, replacement] in _punctConversions:
lastline = line
line = re.sub(pattern, replacement, line)
if lastline != line:
break
return line
|
[
"def",
"_convert_punctuation",
"(",
"line",
")",
":",
"for",
"[",
"pattern",
",",
"replacement",
"]",
"in",
"_punctConversions",
":",
"lastline",
"=",
"line",
"line",
"=",
"re",
".",
"sub",
"(",
"pattern",
",",
"replacement",
",",
"line",
")",
"if",
"lastline",
"!=",
"line",
":",
"break",
"return",
"line"
] |
Converts given analysis line if it describes punctuation; Uses the set
of predefined punctuation conversion rules from _punctConversions;
_punctConversions should be a list of lists, where each outer list stands
for a single conversion rule and inner list contains a pair of elements:
first is the regexp pattern and the second is the replacement, used in
re.sub( pattern, replacement, line )
Returns the converted line (same as input, if no conversion was
performed);
|
[
"Converts",
"given",
"analysis",
"line",
"if",
"it",
"describes",
"punctuation",
";",
"Uses",
"the",
"set",
"of",
"predefined",
"punctuation",
"conversion",
"rules",
"from",
"_punctConversions",
";",
"_punctConversions",
"should",
"be",
"a",
"list",
"of",
"lists",
"where",
"each",
"outer",
"list",
"stands",
"for",
"a",
"single",
"conversion",
"rule",
"and",
"inner",
"list",
"contains",
"a",
"pair",
"of",
"elements",
":",
"first",
"is",
"the",
"regexp",
"pattern",
"and",
"the",
"second",
"is",
"the",
"replacement",
"used",
"in",
"re",
".",
"sub",
"(",
"pattern",
"replacement",
"line",
")",
"Returns",
"the",
"converted",
"line",
"(",
"same",
"as",
"input",
"if",
"no",
"conversion",
"was",
"performed",
")",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L280-L297
|
train
|
Converts given analysis line if it describes punctuation.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,Es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ae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + chr(111 - 62) + chr(0b110001) + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(474 - 424), ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b110010) + '\x37' + chr(54), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1110 + 0o44) + chr(55) + chr(0b110101), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + '\x33' + chr(0b10111 + 0o32), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2296 - 2247) + chr(2763 - 2709) + chr(0b11111 + 0o23), 31262 - 31254), nzTpIcepk0o8(chr(48) + chr(1499 - 1388) + chr(0b110001) + chr(52) + '\x36', 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(111) + '\061' + chr(0b100111 + 0o13) + '\066', 0b1000), nzTpIcepk0o8(chr(1814 - 1766) + chr(3185 - 3074) + chr(0b11001 + 0o31) + chr(0b11110 + 0o26) + chr(785 - 737), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1001010 + 0o45) + chr(0b110010) + chr(1200 - 1151) + chr(1449 - 1395), 61142 - 61134), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(53) + chr(0b101001 + 0o15), 2126 - 2118), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x32' + '\066' + chr(0b1000 + 0o54), 0o10), nzTpIcepk0o8(chr(48) + chr(0b111100 + 0o63) + chr(49) + chr(0b110001) + chr(54), 8), nzTpIcepk0o8(chr(48) + chr(6925 - 6814) + '\064', 64650 - 64642), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2369 - 2319) + '\x37', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(1047 - 997) + chr(52), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(495 - 446) + '\x30' + '\x34', 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(8022 - 7911) + chr(0b110111) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\063' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + '\063' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(406 - 358) + chr(2055 - 1944) + chr(0b110010) + chr(1820 - 1770) + '\063', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(51) + chr(376 - 321), 46818 - 46810), nzTpIcepk0o8(chr(434 - 386) + chr(111) + '\061' + '\x34' + '\x31', 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b10000 + 0o137) + '\x32' + chr(1829 - 1779) + '\x33', 8), nzTpIcepk0o8(chr(204 - 156) + chr(111) + chr(0b100100 + 0o22) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + '\x6f' + chr(0b11001 + 0o30) + chr(289 - 240), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(1793 - 1743) + '\061' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(7661 - 7550) + chr(0b110011) + chr(0b1101 + 0o43) + '\061', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(50) + chr(0b11110 + 0o24) + chr(52), 0o10), nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1101111) + '\063' + chr(0b10101 + 0o41) + chr(1361 - 1311), 28576 - 28568), nzTpIcepk0o8(chr(0b110000) + chr(0b10 + 0o155) + chr(1209 - 1160) + chr(2282 - 2233) + '\066', 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1100 + 0o51), 651 - 643), nzTpIcepk0o8('\x30' + '\157' + chr(0b10000 + 0o43) + chr(0b11 + 0o57) + chr(1134 - 1085), 0o10), nzTpIcepk0o8('\060' + chr(4480 - 4369) + '\x31' + chr(49) + chr(51), 26671 - 26663), nzTpIcepk0o8(chr(0b110000) + chr(0b111000 + 0o67) + chr(1801 - 1751) + '\x31' + chr(0b10 + 0o56), 0o10), nzTpIcepk0o8(chr(2303 - 2255) + chr(0b1101111) + chr(423 - 372) + chr(0b1011 + 0o50) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(6777 - 6666) + '\x32' + chr(51) + chr(0b1110 + 0o50), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + '\065' + chr(0b110111), 434 - 426), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100101 + 0o16) + chr(2225 - 2174) + chr(2099 - 2048), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(111) + '\x35' + chr(0b101100 + 0o4), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'"'), '\x64' + chr(101) + chr(0b1100011) + '\157' + '\x64' + '\x65')(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + chr(1514 - 1458)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def NNzzurCAzsVM(ffiOpFBWGmZU):
for [UYtHA0XyNB9C, uEyuA_NJ7W1X] in Fu__MxxzBUV5:
BLAKzrkzDgaA = ffiOpFBWGmZU
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(UYtHA0XyNB9C, uEyuA_NJ7W1X, ffiOpFBWGmZU)
if BLAKzrkzDgaA != ffiOpFBWGmZU:
break
return ffiOpFBWGmZU
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
convert_mrf_to_syntax_mrf
|
def convert_mrf_to_syntax_mrf( mrf_lines, conversion_rules ):
''' Converts given lines from Filosoft's mrf format to syntactic analyzer's
format, using the morph-category conversion rules from conversion_rules,
and punctuation via method _convert_punctuation();
As a result of conversion, the input list mrf_lines will be modified,
and also returned after a successful conversion;
Morph-category conversion rules should be loaded via method
load_fs_mrf_to_syntax_mrf_translation_rules( rulesFile ),
usually from a file named 'tmorftrtabel.txt';
Note that the resulting list of lines likely has more lines than the
original list had, because the conversion often requires that the
original Filosoft's analysis is expanded into multiple analyses
suitable for the syntactic analyzer;
'''
i = 0
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if line.startswith(' '): # only consider lines of analysis
# 1) Convert punctuation
if _punctOrAbbrev.search(line):
mrf_lines[i] = _convert_punctuation( line )
if '_Y_' not in line:
i += 1
continue
# 2) Convert morphological analyses that have a form specified
withFormMatch = _morfWithForm.search(line)
if withFormMatch:
root = withFormMatch.group(1)
pos = withFormMatch.group(2)
formStr = withFormMatch.group(3)
forms = formStr.split(',')
all_new_lines = []
for form in forms:
morphKey = pos+' '+form.strip()
if morphKey in conversion_rules:
newlines = [ ' '+root+' //'+_esc_que_mark(r)+' //' for r in conversion_rules[morphKey] ]
all_new_lines.extend( newlines )
if all_new_lines:
del mrf_lines[i]
for newline in all_new_lines:
mrf_lines.insert(i, newline)
i += len(newlines)
continue
else:
withoutFormMatch = _morfWithoutForm.search(line)
if withoutFormMatch:
# 3) Convert morphological analyses that have only POS specified
root = withoutFormMatch.group(1)
pos = withoutFormMatch.group(2)
morphKey = pos
all_new_lines = []
if morphKey in conversion_rules:
newlines = [ ' '+root+' //'+_esc_que_mark(r)+' //' for r in conversion_rules[morphKey] ]
all_new_lines.extend( newlines )
if all_new_lines:
del mrf_lines[i]
for newline in all_new_lines:
mrf_lines.insert(i, newline)
i += len(newlines)
continue
i += 1
return mrf_lines
|
python
|
def convert_mrf_to_syntax_mrf( mrf_lines, conversion_rules ):
''' Converts given lines from Filosoft's mrf format to syntactic analyzer's
format, using the morph-category conversion rules from conversion_rules,
and punctuation via method _convert_punctuation();
As a result of conversion, the input list mrf_lines will be modified,
and also returned after a successful conversion;
Morph-category conversion rules should be loaded via method
load_fs_mrf_to_syntax_mrf_translation_rules( rulesFile ),
usually from a file named 'tmorftrtabel.txt';
Note that the resulting list of lines likely has more lines than the
original list had, because the conversion often requires that the
original Filosoft's analysis is expanded into multiple analyses
suitable for the syntactic analyzer;
'''
i = 0
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if line.startswith(' '): # only consider lines of analysis
# 1) Convert punctuation
if _punctOrAbbrev.search(line):
mrf_lines[i] = _convert_punctuation( line )
if '_Y_' not in line:
i += 1
continue
# 2) Convert morphological analyses that have a form specified
withFormMatch = _morfWithForm.search(line)
if withFormMatch:
root = withFormMatch.group(1)
pos = withFormMatch.group(2)
formStr = withFormMatch.group(3)
forms = formStr.split(',')
all_new_lines = []
for form in forms:
morphKey = pos+' '+form.strip()
if morphKey in conversion_rules:
newlines = [ ' '+root+' //'+_esc_que_mark(r)+' //' for r in conversion_rules[morphKey] ]
all_new_lines.extend( newlines )
if all_new_lines:
del mrf_lines[i]
for newline in all_new_lines:
mrf_lines.insert(i, newline)
i += len(newlines)
continue
else:
withoutFormMatch = _morfWithoutForm.search(line)
if withoutFormMatch:
# 3) Convert morphological analyses that have only POS specified
root = withoutFormMatch.group(1)
pos = withoutFormMatch.group(2)
morphKey = pos
all_new_lines = []
if morphKey in conversion_rules:
newlines = [ ' '+root+' //'+_esc_que_mark(r)+' //' for r in conversion_rules[morphKey] ]
all_new_lines.extend( newlines )
if all_new_lines:
del mrf_lines[i]
for newline in all_new_lines:
mrf_lines.insert(i, newline)
i += len(newlines)
continue
i += 1
return mrf_lines
|
[
"def",
"convert_mrf_to_syntax_mrf",
"(",
"mrf_lines",
",",
"conversion_rules",
")",
":",
"i",
"=",
"0",
"while",
"(",
"i",
"<",
"len",
"(",
"mrf_lines",
")",
")",
":",
"line",
"=",
"mrf_lines",
"[",
"i",
"]",
"if",
"line",
".",
"startswith",
"(",
"' '",
")",
":",
"# only consider lines of analysis ",
"# 1) Convert punctuation",
"if",
"_punctOrAbbrev",
".",
"search",
"(",
"line",
")",
":",
"mrf_lines",
"[",
"i",
"]",
"=",
"_convert_punctuation",
"(",
"line",
")",
"if",
"'_Y_'",
"not",
"in",
"line",
":",
"i",
"+=",
"1",
"continue",
"# 2) Convert morphological analyses that have a form specified",
"withFormMatch",
"=",
"_morfWithForm",
".",
"search",
"(",
"line",
")",
"if",
"withFormMatch",
":",
"root",
"=",
"withFormMatch",
".",
"group",
"(",
"1",
")",
"pos",
"=",
"withFormMatch",
".",
"group",
"(",
"2",
")",
"formStr",
"=",
"withFormMatch",
".",
"group",
"(",
"3",
")",
"forms",
"=",
"formStr",
".",
"split",
"(",
"','",
")",
"all_new_lines",
"=",
"[",
"]",
"for",
"form",
"in",
"forms",
":",
"morphKey",
"=",
"pos",
"+",
"' '",
"+",
"form",
".",
"strip",
"(",
")",
"if",
"morphKey",
"in",
"conversion_rules",
":",
"newlines",
"=",
"[",
"' '",
"+",
"root",
"+",
"' //'",
"+",
"_esc_que_mark",
"(",
"r",
")",
"+",
"' //'",
"for",
"r",
"in",
"conversion_rules",
"[",
"morphKey",
"]",
"]",
"all_new_lines",
".",
"extend",
"(",
"newlines",
")",
"if",
"all_new_lines",
":",
"del",
"mrf_lines",
"[",
"i",
"]",
"for",
"newline",
"in",
"all_new_lines",
":",
"mrf_lines",
".",
"insert",
"(",
"i",
",",
"newline",
")",
"i",
"+=",
"len",
"(",
"newlines",
")",
"continue",
"else",
":",
"withoutFormMatch",
"=",
"_morfWithoutForm",
".",
"search",
"(",
"line",
")",
"if",
"withoutFormMatch",
":",
"# 3) Convert morphological analyses that have only POS specified",
"root",
"=",
"withoutFormMatch",
".",
"group",
"(",
"1",
")",
"pos",
"=",
"withoutFormMatch",
".",
"group",
"(",
"2",
")",
"morphKey",
"=",
"pos",
"all_new_lines",
"=",
"[",
"]",
"if",
"morphKey",
"in",
"conversion_rules",
":",
"newlines",
"=",
"[",
"' '",
"+",
"root",
"+",
"' //'",
"+",
"_esc_que_mark",
"(",
"r",
")",
"+",
"' //'",
"for",
"r",
"in",
"conversion_rules",
"[",
"morphKey",
"]",
"]",
"all_new_lines",
".",
"extend",
"(",
"newlines",
")",
"if",
"all_new_lines",
":",
"del",
"mrf_lines",
"[",
"i",
"]",
"for",
"newline",
"in",
"all_new_lines",
":",
"mrf_lines",
".",
"insert",
"(",
"i",
",",
"newline",
")",
"i",
"+=",
"len",
"(",
"newlines",
")",
"continue",
"i",
"+=",
"1",
"return",
"mrf_lines"
] |
Converts given lines from Filosoft's mrf format to syntactic analyzer's
format, using the morph-category conversion rules from conversion_rules,
and punctuation via method _convert_punctuation();
As a result of conversion, the input list mrf_lines will be modified,
and also returned after a successful conversion;
Morph-category conversion rules should be loaded via method
load_fs_mrf_to_syntax_mrf_translation_rules( rulesFile ),
usually from a file named 'tmorftrtabel.txt';
Note that the resulting list of lines likely has more lines than the
original list had, because the conversion often requires that the
original Filosoft's analysis is expanded into multiple analyses
suitable for the syntactic analyzer;
|
[
"Converts",
"given",
"lines",
"from",
"Filosoft",
"s",
"mrf",
"format",
"to",
"syntactic",
"analyzer",
"s",
"format",
"using",
"the",
"morph",
"-",
"category",
"conversion",
"rules",
"from",
"conversion_rules",
"and",
"punctuation",
"via",
"method",
"_convert_punctuation",
"()",
";",
"As",
"a",
"result",
"of",
"conversion",
"the",
"input",
"list",
"mrf_lines",
"will",
"be",
"modified",
"and",
"also",
"returned",
"after",
"a",
"successful",
"conversion",
";",
"Morph",
"-",
"category",
"conversion",
"rules",
"should",
"be",
"loaded",
"via",
"method",
"load_fs_mrf_to_syntax_mrf_translation_rules",
"(",
"rulesFile",
")",
"usually",
"from",
"a",
"file",
"named",
"tmorftrtabel",
".",
"txt",
";",
"Note",
"that",
"the",
"resulting",
"list",
"of",
"lines",
"likely",
"has",
"more",
"lines",
"than",
"the",
"original",
"list",
"had",
"because",
"the",
"conversion",
"often",
"requires",
"that",
"the",
"original",
"Filosoft",
"s",
"analysis",
"is",
"expanded",
"into",
"multiple",
"analyses",
"suitable",
"for",
"the",
"syntactic",
"analyzer",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L306-L369
|
train
|
Converts given lines from Filosoft s mrf format to syntactic analyzer s equivalent MRF format.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,Td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ptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31', 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b1100 + 0o46) + chr(1040 - 987) + '\x37', 0b1000), nzTpIcepk0o8(chr(1233 - 1185) + chr(111) + chr(0b11 + 0o56) + chr(0b11011 + 0o32) + chr(51), 0o10), nzTpIcepk0o8(chr(270 - 222) + chr(2477 - 2366) + chr(0b11100 + 0o26) + '\061', 45716 - 45708), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(373 - 323) + '\x30' + '\060', 0o10), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(111) + '\061' + chr(1229 - 1175) + chr(0b101100 + 0o6), 0b1000), nzTpIcepk0o8(chr(1491 - 1443) + '\x6f' + chr(50) + chr(102 - 49) + chr(0b110111), 8), nzTpIcepk0o8(chr(1931 - 1883) + '\157' + chr(50) + '\x33' + '\066', ord("\x08")), nzTpIcepk0o8('\060' + chr(1261 - 1150) + chr(0b110001) + chr(1002 - 949) + chr(55), 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101111) + '\x36' + '\065', 57057 - 57049), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + '\065' + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(11954 - 11843) + chr(51) + chr(50) + '\063', 58554 - 58546), nzTpIcepk0o8('\060' + chr(0b1100010 + 0o15) + chr(49) + chr(48) + '\x33', 0o10), nzTpIcepk0o8(chr(48) + chr(6768 - 6657) + chr(0b110010) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b101101 + 0o4) + '\x31' + chr(48), 46867 - 46859), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(0b1101111) + chr(1158 - 1107) + '\x35' + chr(2543 - 2491), 0o10), nzTpIcepk0o8(chr(0b1001 + 0o47) + '\157' + '\061' + '\067' + chr(0b11101 + 0o25), ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(9482 - 9371) + chr(0b100100 + 0o16) + chr(0b11101 + 0o25) + chr(51), 0b1000), nzTpIcepk0o8(chr(1834 - 1786) + chr(0b1101111) + chr(49) + chr(2215 - 2166) + chr(0b11010 + 0o27), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + chr(0b100100 + 0o17) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110100) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1101111) + chr(1514 - 1464) + chr(0b1 + 0o61) + chr(0b10100 + 0o37), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(50) + '\066' + '\062', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b0 + 0o61) + chr(1040 - 990) + chr(50), 0o10), nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(0b1 + 0o62) + '\066', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + '\060' + chr(551 - 496), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(74 - 22), 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b1000001 + 0o56) + '\062' + chr(0b110011) + chr(1933 - 1878), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b100001 + 0o116) + chr(51) + chr(0b1110 + 0o47) + chr(0b10100 + 0o42), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(7017 - 6906) + '\x32' + chr(48) + '\x36', 39098 - 39090), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110011) + chr(49) + chr(54), 0b1000), nzTpIcepk0o8(chr(48) + chr(6398 - 6287) + '\x32' + '\x34', 0b1000), nzTpIcepk0o8(chr(48) + chr(11730 - 11619) + chr(0b110001) + '\x32', ord("\x08")), nzTpIcepk0o8(chr(0b11011 + 0o25) + '\157' + chr(49) + '\064' + chr(1618 - 1570), 24483 - 24475), nzTpIcepk0o8('\060' + chr(0b1100010 + 0o15) + chr(49) + '\060' + '\x32', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110 + 0o53) + chr(0b110111) + chr(0b10111 + 0o36), 27174 - 27166), nzTpIcepk0o8(chr(1472 - 1424) + '\157' + chr(51) + chr(0b110010) + chr(0b110010), 60870 - 60862), nzTpIcepk0o8('\x30' + '\157' + chr(1151 - 1101) + '\067' + '\x34', ord("\x08")), nzTpIcepk0o8(chr(2189 - 2141) + chr(5144 - 5033) + chr(1141 - 1091) + chr(451 - 396) + chr(0b110 + 0o61), 0b1000), nzTpIcepk0o8('\060' + chr(0b1011110 + 0o21) + chr(50) + chr(0b110111) + chr(0b100101 + 0o17), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b101010 + 0o105) + chr(0b101011 + 0o12) + '\060', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'/'), chr(100) + chr(0b1100101) + chr(0b10 + 0o141) + '\157' + chr(0b100 + 0o140) + '\x65')(chr(117) + '\164' + chr(0b110100 + 0o62) + chr(0b11101 + 0o20) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def qQyUzg5TKmNB(ZOwnRpAlM0Jv, yIA1HUZWr8JC):
ZlbFMSG8gCoF = nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(48), ord("\x08"))
while ZlbFMSG8gCoF < ftfygxgFas5X(ZOwnRpAlM0Jv):
ffiOpFBWGmZU = ZOwnRpAlM0Jv[ZlbFMSG8gCoF]
if roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'r\xdb\nc\xf4\x01\xd8\xf7\x1b]'), chr(100) + '\x65' + chr(0b1000100 + 0o37) + chr(0b1010110 + 0o31) + chr(0b1100100) + chr(101))(chr(12203 - 12086) + chr(2981 - 2865) + chr(0b1100 + 0o132) + chr(0b0 + 0o55) + chr(0b110110 + 0o2)))(roI3spqORKae(ES5oEprVxulp(b'!\x8f'), chr(100) + chr(101) + '\143' + chr(2190 - 2079) + chr(100) + '\x65')(chr(117) + chr(0b1110100) + '\x66' + chr(0b1111 + 0o36) + chr(56))):
if roI3spqORKae(pL63rVs9EjM2, roI3spqORKae(ES5oEprVxulp(b'E\xce1)\xc9\x1c\xd5\xcf\x08s \xa5'), chr(100) + '\x65' + chr(8739 - 8640) + chr(111) + '\x64' + '\x65')('\x75' + chr(0b1011100 + 0o30) + chr(102) + chr(0b11 + 0o52) + '\070'))(ffiOpFBWGmZU):
ZOwnRpAlM0Jv[ZlbFMSG8gCoF] = NNzzurCAzsVM(ffiOpFBWGmZU)
if roI3spqORKae(ES5oEprVxulp(b'^\xf64'), chr(100) + '\x65' + chr(0b1100011) + chr(9564 - 9453) + chr(100) + chr(101))('\165' + '\164' + chr(1762 - 1660) + chr(210 - 165) + '\x38') not in ffiOpFBWGmZU:
ZlbFMSG8gCoF += nzTpIcepk0o8('\060' + '\x6f' + chr(1212 - 1163), 8)
continue
UXDVFmdY2TzC = yvdHWvO06IDr.DaZ8InzQgFJv(ffiOpFBWGmZU)
if UXDVFmdY2TzC:
kF9CWBi2ucGu = UXDVFmdY2TzC.F9lJ8RbIonqb(nzTpIcepk0o8(chr(0b110000) + chr(0b111110 + 0o61) + '\061', 8))
IGIA_fu6MbaO = UXDVFmdY2TzC.F9lJ8RbIonqb(nzTpIcepk0o8('\060' + chr(0b1101000 + 0o7) + '\x32', 20848 - 20840))
sZPhmuh0E0qM = UXDVFmdY2TzC.F9lJ8RbIonqb(nzTpIcepk0o8('\060' + chr(0b1101101 + 0o2) + chr(51), 0b1000))
aifz_TERphvt = sZPhmuh0E0qM.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'-'), chr(0b1011001 + 0o13) + '\145' + '\x63' + chr(0b100001 + 0o116) + chr(100) + chr(0b1100101))('\x75' + '\164' + '\x66' + '\055' + chr(0b11100 + 0o34)))
aNPnTi2lSZPK = []
for qnYTYR39V38E in aifz_TERphvt:
Px_pbY5IU4aV = IGIA_fu6MbaO + roI3spqORKae(ES5oEprVxulp(b'!'), chr(0b111111 + 0o45) + '\x65' + '\143' + '\x6f' + chr(0b1100100) + chr(0b101110 + 0o67))(chr(117) + chr(0b1110100) + chr(0b1011001 + 0o15) + chr(45) + '\x38') + qnYTYR39V38E.kdIDrcwZTCs5()
if Px_pbY5IU4aV in yIA1HUZWr8JC:
KnfgAZOLjfC5 = [roI3spqORKae(ES5oEprVxulp(b'!\x8fK1'), '\x64' + '\x65' + chr(99) + chr(0b1101100 + 0o3) + chr(100) + chr(0b1100101))(chr(117) + chr(0b1110100) + '\146' + '\055' + chr(1126 - 1070)) + kF9CWBi2ucGu + roI3spqORKae(ES5oEprVxulp(b'!\x80D'), chr(7592 - 7492) + '\145' + chr(9032 - 8933) + chr(0b1101111) + chr(0b111110 + 0o46) + chr(0b1100101))(chr(0b1010110 + 0o37) + '\164' + chr(987 - 885) + chr(1480 - 1435) + chr(0b1000 + 0o60)) + ymCaRG8aPBxQ(LCrwg7lcbmU9) + roI3spqORKae(ES5oEprVxulp(b'!\x80D'), '\144' + '\x65' + '\x63' + chr(111) + '\144' + chr(0b111011 + 0o52))('\x75' + chr(116) + chr(102) + chr(0b1011 + 0o42) + '\070') for LCrwg7lcbmU9 in yIA1HUZWr8JC[Px_pbY5IU4aV]]
roI3spqORKae(aNPnTi2lSZPK, roI3spqORKae(ES5oEprVxulp(b'U\xf0X\\\xef\x16\xe3\xc90w\x08\xa2'), '\144' + '\x65' + chr(0b111010 + 0o51) + chr(0b1101010 + 0o5) + chr(100) + chr(101))(chr(0b1110100 + 0o1) + chr(0b1110100) + chr(6853 - 6751) + chr(45) + chr(0b111000)))(KnfgAZOLjfC5)
if aNPnTi2lSZPK:
del ZOwnRpAlM0Jv[ZlbFMSG8gCoF]
for lMNDfQPwvbTI in aNPnTi2lSZPK:
roI3spqORKae(ZOwnRpAlM0Jv, roI3spqORKae(ES5oEprVxulp(b'h\xc1\x18t\xf2\x06'), chr(0b1100011 + 0o1) + '\145' + chr(99) + chr(0b1000110 + 0o51) + '\144' + chr(0b1100101))('\x75' + '\x74' + '\x66' + '\x2d' + '\070'))(ZlbFMSG8gCoF, lMNDfQPwvbTI)
ZlbFMSG8gCoF += ftfygxgFas5X(KnfgAZOLjfC5)
continue
else:
KZEzqbytl7Le = IapWH5IkIt69.DaZ8InzQgFJv(ffiOpFBWGmZU)
if KZEzqbytl7Le:
kF9CWBi2ucGu = KZEzqbytl7Le.F9lJ8RbIonqb(nzTpIcepk0o8(chr(0b110000) + chr(0b1100 + 0o143) + chr(49), 8))
IGIA_fu6MbaO = KZEzqbytl7Le.F9lJ8RbIonqb(nzTpIcepk0o8('\060' + '\157' + chr(0b110010), 8))
Px_pbY5IU4aV = IGIA_fu6MbaO
aNPnTi2lSZPK = []
if Px_pbY5IU4aV in yIA1HUZWr8JC:
KnfgAZOLjfC5 = [roI3spqORKae(ES5oEprVxulp(b'!\x8fK1'), chr(0b1110 + 0o126) + chr(101) + '\x63' + chr(0b1101111) + chr(100) + '\145')(chr(0b0 + 0o165) + '\x74' + chr(8777 - 8675) + chr(0b101101) + '\x38') + kF9CWBi2ucGu + roI3spqORKae(ES5oEprVxulp(b'!\x80D'), chr(0b1100100) + '\x65' + chr(2238 - 2139) + chr(0b1001111 + 0o40) + chr(0b1100100) + chr(0b1100101))(chr(12493 - 12376) + '\x74' + '\146' + chr(0b100110 + 0o7) + chr(2172 - 2116)) + ymCaRG8aPBxQ(LCrwg7lcbmU9) + roI3spqORKae(ES5oEprVxulp(b'!\x80D'), chr(0b1100100) + chr(0b10100 + 0o121) + '\x63' + chr(111) + '\144' + chr(101))('\x75' + '\164' + chr(0b1100110) + '\x2d' + chr(0b111000)) for LCrwg7lcbmU9 in yIA1HUZWr8JC[Px_pbY5IU4aV]]
roI3spqORKae(aNPnTi2lSZPK, roI3spqORKae(ES5oEprVxulp(b'U\xf0X\\\xef\x16\xe3\xc90w\x08\xa2'), chr(0b100010 + 0o102) + chr(0b10001 + 0o124) + chr(99) + chr(0b1101111) + chr(142 - 42) + chr(0b11001 + 0o114))(chr(117) + '\164' + chr(0b1100110) + chr(0b11 + 0o52) + chr(617 - 561)))(KnfgAZOLjfC5)
if aNPnTi2lSZPK:
del ZOwnRpAlM0Jv[ZlbFMSG8gCoF]
for lMNDfQPwvbTI in aNPnTi2lSZPK:
roI3spqORKae(ZOwnRpAlM0Jv, roI3spqORKae(ES5oEprVxulp(b'h\xc1\x18t\xf2\x06'), chr(100) + chr(1286 - 1185) + '\143' + '\157' + chr(0b1010001 + 0o23) + '\145')(chr(12534 - 12417) + chr(116) + chr(9580 - 9478) + '\x2d' + chr(0b100 + 0o64)))(ZlbFMSG8gCoF, lMNDfQPwvbTI)
ZlbFMSG8gCoF += ftfygxgFas5X(KnfgAZOLjfC5)
continue
ZlbFMSG8gCoF += nzTpIcepk0o8(chr(1339 - 1291) + chr(0b1101 + 0o142) + '\x31', 8)
return ZOwnRpAlM0Jv
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
convert_pronouns
|
def convert_pronouns( mrf_lines ):
''' Converts pronouns (analysis lines with '_P_') from Filosoft's mrf to
syntactic analyzer's mrf format;
Uses the set of predefined pronoun conversion rules from _pronConversions;
_pronConversions should be a list of lists, where each outer list stands
for a single conversion rule and inner list contains a pair of elements:
first is the regexp pattern and the second is the replacement, used in
re.sub( pattern, replacement, line )
Returns the input mrf list, with the lines converted from one format
to another;
'''
i = 0
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if '_P_' in line: # only consider lines containing pronoun analyses
for [pattern, replacement] in _pronConversions:
lastline = line
line = re.sub(pattern, replacement, line)
if lastline != line:
mrf_lines[i] = line
break
i += 1
return mrf_lines
|
python
|
def convert_pronouns( mrf_lines ):
''' Converts pronouns (analysis lines with '_P_') from Filosoft's mrf to
syntactic analyzer's mrf format;
Uses the set of predefined pronoun conversion rules from _pronConversions;
_pronConversions should be a list of lists, where each outer list stands
for a single conversion rule and inner list contains a pair of elements:
first is the regexp pattern and the second is the replacement, used in
re.sub( pattern, replacement, line )
Returns the input mrf list, with the lines converted from one format
to another;
'''
i = 0
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if '_P_' in line: # only consider lines containing pronoun analyses
for [pattern, replacement] in _pronConversions:
lastline = line
line = re.sub(pattern, replacement, line)
if lastline != line:
mrf_lines[i] = line
break
i += 1
return mrf_lines
|
[
"def",
"convert_pronouns",
"(",
"mrf_lines",
")",
":",
"i",
"=",
"0",
"while",
"(",
"i",
"<",
"len",
"(",
"mrf_lines",
")",
")",
":",
"line",
"=",
"mrf_lines",
"[",
"i",
"]",
"if",
"'_P_'",
"in",
"line",
":",
"# only consider lines containing pronoun analyses",
"for",
"[",
"pattern",
",",
"replacement",
"]",
"in",
"_pronConversions",
":",
"lastline",
"=",
"line",
"line",
"=",
"re",
".",
"sub",
"(",
"pattern",
",",
"replacement",
",",
"line",
")",
"if",
"lastline",
"!=",
"line",
":",
"mrf_lines",
"[",
"i",
"]",
"=",
"line",
"break",
"i",
"+=",
"1",
"return",
"mrf_lines"
] |
Converts pronouns (analysis lines with '_P_') from Filosoft's mrf to
syntactic analyzer's mrf format;
Uses the set of predefined pronoun conversion rules from _pronConversions;
_pronConversions should be a list of lists, where each outer list stands
for a single conversion rule and inner list contains a pair of elements:
first is the regexp pattern and the second is the replacement, used in
re.sub( pattern, replacement, line )
Returns the input mrf list, with the lines converted from one format
to another;
|
[
"Converts",
"pronouns",
"(",
"analysis",
"lines",
"with",
"_P_",
")",
"from",
"Filosoft",
"s",
"mrf",
"to",
"syntactic",
"analyzer",
"s",
"mrf",
"format",
";",
"Uses",
"the",
"set",
"of",
"predefined",
"pronoun",
"conversion",
"rules",
"from",
"_pronConversions",
";",
"_pronConversions",
"should",
"be",
"a",
"list",
"of",
"lists",
"where",
"each",
"outer",
"list",
"stands",
"for",
"a",
"single",
"conversion",
"rule",
"and",
"inner",
"list",
"contains",
"a",
"pair",
"of",
"elements",
":",
"first",
"is",
"the",
"regexp",
"pattern",
"and",
"the",
"second",
"is",
"the",
"replacement",
"used",
"in",
"re",
".",
"sub",
"(",
"pattern",
"replacement",
"line",
")",
"Returns",
"the",
"input",
"mrf",
"list",
"with",
"the",
"lines",
"converted",
"from",
"one",
"format",
"to",
"another",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L493-L517
|
train
|
Converts pronouns from Filosoft s mrf to
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,Uti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BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101011 + 0o6) + chr(0b1001 + 0o52) + chr(0b110110), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + chr(54) + chr(0b110101 + 0o0), 0b1000), nzTpIcepk0o8(chr(248 - 200) + '\x6f' + '\x31' + chr(0b100010 + 0o17) + chr(2278 - 2229), 58358 - 58350), nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\x33' + chr(55), 58481 - 58473), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + '\067' + '\x34', 47632 - 47624), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(1471 - 1360) + '\x32' + '\x33' + chr(53), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(169 - 118) + chr(55), 24998 - 24990), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(572 - 521) + '\062', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + '\x33' + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b11001 + 0o126) + '\x33' + chr(0b110001) + '\x33', 0o10), nzTpIcepk0o8('\060' + chr(10206 - 10095) + chr(0b110001) + chr(0b110101) + '\062', 23436 - 23428), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(48) + '\064', 15651 - 15643), nzTpIcepk0o8(chr(303 - 255) + chr(2314 - 2203) + '\062' + chr(769 - 719) + chr(0b110011), 52492 - 52484), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(111) + chr(0b110001) + '\x33' + chr(0b11001 + 0o27), 32764 - 32756), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + '\x37' + chr(0b110000), 27083 - 27075), nzTpIcepk0o8('\060' + chr(0b1000000 + 0o57) + chr(50) + chr(2079 - 2024) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + chr(0b110010) + '\x35', 45091 - 45083), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001) + chr(0b110 + 0o61) + '\060', 8109 - 8101), nzTpIcepk0o8('\x30' + '\x6f' + chr(1032 - 981) + '\062' + chr(1270 - 1217), 0o10), nzTpIcepk0o8(chr(1920 - 1872) + chr(111) + '\063' + chr(0b101000 + 0o12) + chr(55), 34897 - 34889), nzTpIcepk0o8('\060' + chr(0b1101111) + '\063' + chr(0b110101) + '\066', 54923 - 54915), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + chr(54) + chr(0b110001), 7149 - 7141), nzTpIcepk0o8(chr(814 - 766) + chr(111) + chr(1597 - 1547) + '\x30' + chr(0b110010), 39984 - 39976), nzTpIcepk0o8(chr(48) + chr(0b11101 + 0o122) + chr(0b110001 + 0o1) + chr(0b110110) + '\063', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + chr(51) + '\x34', 0o10), nzTpIcepk0o8(chr(1404 - 1356) + chr(0b1101111) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b11110 + 0o24) + chr(0b110011) + chr(2163 - 2113), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b10000 + 0o43) + chr(48) + chr(351 - 302), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b11101 + 0o122) + chr(577 - 528) + '\064', 56458 - 56450), nzTpIcepk0o8(chr(0b100011 + 0o15) + '\157' + chr(0b110011) + chr(50) + '\064', 0b1000), nzTpIcepk0o8(chr(1318 - 1270) + chr(0b1101111) + '\063' + chr(510 - 457) + chr(852 - 802), 0b1000), nzTpIcepk0o8(chr(2187 - 2139) + chr(0b1101111) + chr(1115 - 1061) + chr(52), 0o10), nzTpIcepk0o8('\060' + chr(860 - 749) + chr(504 - 453) + chr(52) + '\x34', 63632 - 63624), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b11010 + 0o35) + chr(54), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + chr(55), 8), nzTpIcepk0o8('\x30' + chr(7346 - 7235) + '\063' + chr(0b101011 + 0o5) + chr(2413 - 2358), 9876 - 9868), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(0b101111 + 0o100) + chr(0b11001 + 0o30) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(55) + chr(661 - 610), ord("\x08")), nzTpIcepk0o8(chr(1583 - 1535) + chr(6904 - 6793) + chr(0b110111) + '\x34', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1100101 + 0o12) + chr(0b110 + 0o57) + chr(0b110000), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'p'), '\144' + chr(101) + chr(99) + '\x6f' + chr(100) + '\145')(chr(117) + '\x74' + chr(8246 - 8144) + chr(0b101101) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def YD8fEtW3ZEcS(ZOwnRpAlM0Jv):
ZlbFMSG8gCoF = nzTpIcepk0o8(chr(0b111 + 0o51) + '\x6f' + chr(1295 - 1247), 0b1000)
while ZlbFMSG8gCoF < ftfygxgFas5X(ZOwnRpAlM0Jv):
ffiOpFBWGmZU = ZOwnRpAlM0Jv[ZlbFMSG8gCoF]
if roI3spqORKae(ES5oEprVxulp(b'\x01%\x16'), chr(100) + chr(101) + chr(99) + chr(0b1101111) + chr(100) + chr(0b1100000 + 0o5))(chr(0b1110101) + chr(116) + chr(7728 - 7626) + chr(1281 - 1236) + chr(56)) in ffiOpFBWGmZU:
for [UYtHA0XyNB9C, uEyuA_NJ7W1X] in cJDORhopI24c:
BLAKzrkzDgaA = ffiOpFBWGmZU
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(UYtHA0XyNB9C, uEyuA_NJ7W1X, ffiOpFBWGmZU)
if BLAKzrkzDgaA != ffiOpFBWGmZU:
ZOwnRpAlM0Jv[ZlbFMSG8gCoF] = ffiOpFBWGmZU
break
ZlbFMSG8gCoF += nzTpIcepk0o8(chr(404 - 356) + chr(0b1101111) + chr(0b11000 + 0o31), 8)
return ZOwnRpAlM0Jv
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
remove_duplicate_analyses
|
def remove_duplicate_analyses( mrf_lines, allow_to_delete_all = True ):
''' Removes duplicate analysis lines from mrf_lines.
Uses special logic for handling adposition analyses ('_K_ pre' && '_K_ post')
that do not have subcategorization information:
*) If a word has both adposition analyses, removes '_K_ pre';
*) If a word has '_K_ post', removes it;
Note that '_K_ pre' and '_K_ post' with subcategorization information will
be kept.
The parameter allow_to_delete_all specifies whether it is allowed to delete
all analysis or not. If allow_to_delete_all == False, then one last analysis
won't be deleted, regardless whether it should be deleted considering the
adposition-deletion rules;
The original implementation corresponds to the settings allow_to_delete_all=True
(and this is also the default value of the parameter);
Returns the input list where the removals have been applied;
'''
i = 0
seen_analyses = []
analyses_count = 0
to_delete = []
Kpre_index = -1
Kpost_index = -1
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if not line.startswith(' '):
if Kpre_index != -1 and Kpost_index != -1:
# If there was both _K_pre and _K_post, add _K_pre to removables;
to_delete.append( Kpre_index )
elif Kpost_index != -1:
# If there was only _K_post, add _K_post to removables;
to_delete.append( Kpost_index )
# Delete found duplicates
if to_delete:
for k, j in enumerate(sorted(to_delete, reverse=True)):
# If we must preserve at least one analysis, and
# it has been found that all should be deleted, then
# keep the last one
if not allow_to_delete_all and \
analyses_count == len(to_delete) and \
k == len(to_delete) - 1:
continue
# Delete the analysis line
del mrf_lines[j]
i -= 1
# Reset the memory for each new word/token
seen_analyses = []
analyses_count = 0
to_delete = []
Kpre_index = -1
Kpost_index = -1
elif line.startswith(' '): # the line of analysis
analyses_count += 1
if line in seen_analyses:
# Remember line that has been already seen as a duplicate
to_delete.append( i )
else:
# Remember '_K pre' and '_K_ post' indices
if re.search('/_K_\s+pre\s+//', line):
Kpre_index = i
elif re.search('/_K_\s+post\s+//', line):
Kpost_index = i
# Remember that the line has already been seen
seen_analyses.append( line )
i += 1
return mrf_lines
|
python
|
def remove_duplicate_analyses( mrf_lines, allow_to_delete_all = True ):
''' Removes duplicate analysis lines from mrf_lines.
Uses special logic for handling adposition analyses ('_K_ pre' && '_K_ post')
that do not have subcategorization information:
*) If a word has both adposition analyses, removes '_K_ pre';
*) If a word has '_K_ post', removes it;
Note that '_K_ pre' and '_K_ post' with subcategorization information will
be kept.
The parameter allow_to_delete_all specifies whether it is allowed to delete
all analysis or not. If allow_to_delete_all == False, then one last analysis
won't be deleted, regardless whether it should be deleted considering the
adposition-deletion rules;
The original implementation corresponds to the settings allow_to_delete_all=True
(and this is also the default value of the parameter);
Returns the input list where the removals have been applied;
'''
i = 0
seen_analyses = []
analyses_count = 0
to_delete = []
Kpre_index = -1
Kpost_index = -1
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if not line.startswith(' '):
if Kpre_index != -1 and Kpost_index != -1:
# If there was both _K_pre and _K_post, add _K_pre to removables;
to_delete.append( Kpre_index )
elif Kpost_index != -1:
# If there was only _K_post, add _K_post to removables;
to_delete.append( Kpost_index )
# Delete found duplicates
if to_delete:
for k, j in enumerate(sorted(to_delete, reverse=True)):
# If we must preserve at least one analysis, and
# it has been found that all should be deleted, then
# keep the last one
if not allow_to_delete_all and \
analyses_count == len(to_delete) and \
k == len(to_delete) - 1:
continue
# Delete the analysis line
del mrf_lines[j]
i -= 1
# Reset the memory for each new word/token
seen_analyses = []
analyses_count = 0
to_delete = []
Kpre_index = -1
Kpost_index = -1
elif line.startswith(' '): # the line of analysis
analyses_count += 1
if line in seen_analyses:
# Remember line that has been already seen as a duplicate
to_delete.append( i )
else:
# Remember '_K pre' and '_K_ post' indices
if re.search('/_K_\s+pre\s+//', line):
Kpre_index = i
elif re.search('/_K_\s+post\s+//', line):
Kpost_index = i
# Remember that the line has already been seen
seen_analyses.append( line )
i += 1
return mrf_lines
|
[
"def",
"remove_duplicate_analyses",
"(",
"mrf_lines",
",",
"allow_to_delete_all",
"=",
"True",
")",
":",
"i",
"=",
"0",
"seen_analyses",
"=",
"[",
"]",
"analyses_count",
"=",
"0",
"to_delete",
"=",
"[",
"]",
"Kpre_index",
"=",
"-",
"1",
"Kpost_index",
"=",
"-",
"1",
"while",
"(",
"i",
"<",
"len",
"(",
"mrf_lines",
")",
")",
":",
"line",
"=",
"mrf_lines",
"[",
"i",
"]",
"if",
"not",
"line",
".",
"startswith",
"(",
"' '",
")",
":",
"if",
"Kpre_index",
"!=",
"-",
"1",
"and",
"Kpost_index",
"!=",
"-",
"1",
":",
"# If there was both _K_pre and _K_post, add _K_pre to removables;",
"to_delete",
".",
"append",
"(",
"Kpre_index",
")",
"elif",
"Kpost_index",
"!=",
"-",
"1",
":",
"# If there was only _K_post, add _K_post to removables;",
"to_delete",
".",
"append",
"(",
"Kpost_index",
")",
"# Delete found duplicates",
"if",
"to_delete",
":",
"for",
"k",
",",
"j",
"in",
"enumerate",
"(",
"sorted",
"(",
"to_delete",
",",
"reverse",
"=",
"True",
")",
")",
":",
"# If we must preserve at least one analysis, and",
"# it has been found that all should be deleted, then ",
"# keep the last one",
"if",
"not",
"allow_to_delete_all",
"and",
"analyses_count",
"==",
"len",
"(",
"to_delete",
")",
"and",
"k",
"==",
"len",
"(",
"to_delete",
")",
"-",
"1",
":",
"continue",
"# Delete the analysis line",
"del",
"mrf_lines",
"[",
"j",
"]",
"i",
"-=",
"1",
"# Reset the memory for each new word/token",
"seen_analyses",
"=",
"[",
"]",
"analyses_count",
"=",
"0",
"to_delete",
"=",
"[",
"]",
"Kpre_index",
"=",
"-",
"1",
"Kpost_index",
"=",
"-",
"1",
"elif",
"line",
".",
"startswith",
"(",
"' '",
")",
":",
"# the line of analysis ",
"analyses_count",
"+=",
"1",
"if",
"line",
"in",
"seen_analyses",
":",
"# Remember line that has been already seen as a duplicate",
"to_delete",
".",
"append",
"(",
"i",
")",
"else",
":",
"# Remember '_K pre' and '_K_ post' indices",
"if",
"re",
".",
"search",
"(",
"'/_K_\\s+pre\\s+//'",
",",
"line",
")",
":",
"Kpre_index",
"=",
"i",
"elif",
"re",
".",
"search",
"(",
"'/_K_\\s+post\\s+//'",
",",
"line",
")",
":",
"Kpost_index",
"=",
"i",
"# Remember that the line has already been seen",
"seen_analyses",
".",
"append",
"(",
"line",
")",
"i",
"+=",
"1",
"return",
"mrf_lines"
] |
Removes duplicate analysis lines from mrf_lines.
Uses special logic for handling adposition analyses ('_K_ pre' && '_K_ post')
that do not have subcategorization information:
*) If a word has both adposition analyses, removes '_K_ pre';
*) If a word has '_K_ post', removes it;
Note that '_K_ pre' and '_K_ post' with subcategorization information will
be kept.
The parameter allow_to_delete_all specifies whether it is allowed to delete
all analysis or not. If allow_to_delete_all == False, then one last analysis
won't be deleted, regardless whether it should be deleted considering the
adposition-deletion rules;
The original implementation corresponds to the settings allow_to_delete_all=True
(and this is also the default value of the parameter);
Returns the input list where the removals have been applied;
|
[
"Removes",
"duplicate",
"analysis",
"lines",
"from",
"mrf_lines",
".",
"Uses",
"special",
"logic",
"for",
"handling",
"adposition",
"analyses",
"(",
"_K_",
"pre",
"&&",
"_K_",
"post",
")",
"that",
"do",
"not",
"have",
"subcategorization",
"information",
":",
"*",
")",
"If",
"a",
"word",
"has",
"both",
"adposition",
"analyses",
"removes",
"_K_",
"pre",
";",
"*",
")",
"If",
"a",
"word",
"has",
"_K_",
"post",
"removes",
"it",
";",
"Note",
"that",
"_K_",
"pre",
"and",
"_K_",
"post",
"with",
"subcategorization",
"information",
"will",
"be",
"kept",
".",
"The",
"parameter",
"allow_to_delete_all",
"specifies",
"whether",
"it",
"is",
"allowed",
"to",
"delete",
"all",
"analysis",
"or",
"not",
".",
"If",
"allow_to_delete_all",
"==",
"False",
"then",
"one",
"last",
"analysis",
"won",
"t",
"be",
"deleted",
"regardless",
"whether",
"it",
"should",
"be",
"deleted",
"considering",
"the",
"adposition",
"-",
"deletion",
"rules",
";",
"The",
"original",
"implementation",
"corresponds",
"to",
"the",
"settings",
"allow_to_delete_all",
"=",
"True",
"(",
"and",
"this",
"is",
"also",
"the",
"default",
"value",
"of",
"the",
"parameter",
")",
";",
"Returns",
"the",
"input",
"list",
"where",
"the",
"removals",
"have",
"been",
"applied",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L528-L595
|
train
|
Removes duplicate analyses from the input list.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO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A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + chr(0b1111 + 0o42), 1545 - 1537), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(5560 - 5449) + chr(0b10010 + 0o37) + '\x30' + chr(0b110001), 23986 - 23978), nzTpIcepk0o8(chr(48) + chr(0b101011 + 0o104) + chr(0b100 + 0o56) + chr(0b100010 + 0o24) + chr(53), 20207 - 20199), nzTpIcepk0o8('\x30' + chr(0b1100 + 0o143) + '\067' + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110011) + chr(0b110100 + 0o0) + chr(212 - 161), 49864 - 49856), nzTpIcepk0o8('\060' + chr(4977 - 4866) + '\061' + '\064' + chr(52), 8430 - 8422), nzTpIcepk0o8(chr(2057 - 2009) + chr(0b0 + 0o157) + chr(307 - 253) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(1229 - 1181) + chr(0b111101 + 0o62) + chr(0b110011) + chr(53) + chr(48), ord("\x08")), nzTpIcepk0o8('\060' + chr(4648 - 4537) + chr(0b101101 + 0o5) + chr(0b10100 + 0o35), 0o10), nzTpIcepk0o8(chr(48) + chr(0b100001 + 0o116) + chr(1570 - 1520) + chr(0b110000) + chr(658 - 604), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b100011 + 0o20) + chr(0b110011) + chr(2467 - 2416), 0b1000), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b1101111) + chr(1985 - 1934) + '\063' + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(0b110100) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(544 - 496) + chr(0b1101111) + '\063' + chr(52) + chr(54), 48147 - 48139), nzTpIcepk0o8(chr(1582 - 1534) + chr(1808 - 1697) + chr(0b10000 + 0o43) + '\x34' + '\064', 26881 - 26873), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(2644 - 2533) + chr(51) + chr(55) + '\x37', 60826 - 60818), nzTpIcepk0o8(chr(48) + chr(0b100100 + 0o113) + '\x32' + '\x35' + '\x32', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\061' + '\x33' + '\065', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1100101 + 0o12) + chr(0b110001) + '\062' + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b111 + 0o150) + chr(50) + chr(0b110011) + chr(0b110 + 0o60), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110101) + chr(0b100 + 0o56), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + '\x31' + '\x32', 0b1000), nzTpIcepk0o8(chr(1216 - 1168) + chr(111) + '\062' + '\x36' + chr(51), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b1 + 0o62) + '\063', ord("\x08")), nzTpIcepk0o8('\x30' + chr(873 - 762) + '\x32' + chr(0b110110) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b10110 + 0o32) + '\x6f' + '\x36' + chr(0b1 + 0o63), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(1332 - 1279) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(992 - 944) + '\157' + chr(0b101011 + 0o10) + '\065' + '\066', 17086 - 17078), nzTpIcepk0o8(chr(2116 - 2068) + '\x6f' + '\063' + chr(0b110110) + chr(0b10101 + 0o36), 0o10), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(6072 - 5961) + chr(0b1111 + 0o47) + chr(0b100010 + 0o20), 0b1000), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(111) + chr(48), 52920 - 52912), nzTpIcepk0o8('\060' + chr(111) + chr(0b11100 + 0o26) + '\067' + '\066', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(1118 - 1063) + '\x33', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(51) + '\064' + chr(1060 - 1012), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9694 - 9583) + '\061' + '\x33' + '\061', 11814 - 11806), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b1101111) + chr(320 - 270) + '\064' + chr(1555 - 1500), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110010) + chr(0b101010 + 0o13) + '\x33', 8437 - 8429), nzTpIcepk0o8('\x30' + '\157' + '\x36' + chr(0b11110 + 0o27), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\061' + chr(0b110000) + chr(55), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b100101 + 0o112) + chr(0b110010) + chr(0b110001) + chr(0b11100 + 0o24), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(111) + '\065' + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'7'), '\144' + chr(0b1000101 + 0o40) + chr(1674 - 1575) + chr(1385 - 1274) + chr(100) + chr(1791 - 1690))('\x75' + chr(0b1110100) + chr(8102 - 8000) + chr(0b101101) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def TGKFpANNPAvo(ZOwnRpAlM0Jv, xKV139q8gprc=nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + '\x31', 0o10)):
ZlbFMSG8gCoF = nzTpIcepk0o8(chr(1217 - 1169) + '\x6f' + chr(0b110000), 8)
DQv9EZ0uCXls = []
MdsBGXh6PuwH = nzTpIcepk0o8('\060' + '\157' + chr(48), 8)
So9mLmQszRr4 = []
BpintmAq5DuQ = -nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b0 + 0o61), 8)
qeWSoBXtJICL = -nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001), 8)
while ZlbFMSG8gCoF < ftfygxgFas5X(ZOwnRpAlM0Jv):
ffiOpFBWGmZU = ZOwnRpAlM0Jv[ZlbFMSG8gCoF]
if not roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'j5\xd4J\x97\x17D\x81e\xee'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(111) + '\x64' + '\145')(chr(0b1011 + 0o152) + chr(7460 - 7344) + chr(0b1100110) + chr(106 - 61) + chr(424 - 368)))(roI3spqORKae(ES5oEprVxulp(b'9a'), '\144' + '\145' + chr(4858 - 4759) + chr(5080 - 4969) + chr(2727 - 2627) + chr(101))(chr(117) + chr(12346 - 12230) + chr(0b1100110) + '\x2d' + '\070')):
if BpintmAq5DuQ != -nzTpIcepk0o8(chr(1944 - 1896) + '\x6f' + chr(49), 8) and qeWSoBXtJICL != -nzTpIcepk0o8(chr(0b110000) + chr(0b10001 + 0o136) + chr(49), 8):
roI3spqORKae(So9mLmQszRr4, roI3spqORKae(ES5oEprVxulp(b'Q\x15\xe6\x0c\x9b\x03t\x87{\xe9\x8e\xe8'), chr(7802 - 7702) + chr(0b1100101) + chr(119 - 20) + chr(0b1101111) + chr(0b110111 + 0o55) + chr(115 - 14))('\x75' + chr(0b1110100) + '\146' + '\055' + chr(0b110111 + 0o1)))(BpintmAq5DuQ)
elif qeWSoBXtJICL != -nzTpIcepk0o8(chr(1749 - 1701) + chr(111) + chr(1575 - 1526), 8):
roI3spqORKae(So9mLmQszRr4, roI3spqORKae(ES5oEprVxulp(b'Q\x15\xe6\x0c\x9b\x03t\x87{\xe9\x8e\xe8'), chr(0b101000 + 0o74) + chr(0b1100101) + chr(0b1100011) + chr(8973 - 8862) + '\144' + '\145')(chr(0b1010100 + 0o41) + '\164' + '\146' + chr(45) + chr(190 - 134)))(qeWSoBXtJICL)
if So9mLmQszRr4:
for (B6UAF1zReOyJ, sChW4gUsXrIC) in _kV_Bomx8PZ4(V3OlOVg98A85(So9mLmQszRr4, reverse=nzTpIcepk0o8(chr(48) + '\x6f' + chr(213 - 164), 8))):
if not xKV139q8gprc and MdsBGXh6PuwH == ftfygxgFas5X(So9mLmQszRr4) and (B6UAF1zReOyJ == ftfygxgFas5X(So9mLmQszRr4) - nzTpIcepk0o8('\x30' + chr(734 - 623) + chr(0b110001), 8)):
continue
del ZOwnRpAlM0Jv[sChW4gUsXrIC]
ZlbFMSG8gCoF -= nzTpIcepk0o8(chr(48) + '\157' + '\x31', 8)
DQv9EZ0uCXls = []
MdsBGXh6PuwH = nzTpIcepk0o8('\x30' + '\x6f' + chr(467 - 419), 8)
So9mLmQszRr4 = []
BpintmAq5DuQ = -nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(508 - 459), 8)
qeWSoBXtJICL = -nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001), 8)
elif roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'j5\xd4J\x97\x17D\x81e\xee'), chr(692 - 592) + chr(8385 - 8284) + chr(0b11010 + 0o111) + chr(111) + chr(3841 - 3741) + chr(101))('\165' + chr(0b1110100) + '\x66' + '\055' + '\070'))(roI3spqORKae(ES5oEprVxulp(b'9a'), chr(100) + chr(351 - 250) + '\x63' + chr(3250 - 3139) + '\x64' + chr(0b1100101))(chr(2873 - 2756) + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b111000))):
MdsBGXh6PuwH += nzTpIcepk0o8(chr(780 - 732) + chr(0b1101111) + chr(874 - 825), 8)
if ffiOpFBWGmZU in DQv9EZ0uCXls:
roI3spqORKae(So9mLmQszRr4, roI3spqORKae(ES5oEprVxulp(b'Q\x15\xe6\x0c\x9b\x03t\x87{\xe9\x8e\xe8'), chr(3597 - 3497) + chr(3360 - 3259) + chr(548 - 449) + chr(111) + chr(100) + '\x65')('\x75' + chr(116) + '\146' + chr(0b10101 + 0o30) + '\x38'))(ZlbFMSG8gCoF)
else:
if roI3spqORKae(aoTc4YA2bs2R, roI3spqORKae(ES5oEprVxulp(b'] \xef\x00\xaa\nI\xb9v\xc0\x91\xab'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + chr(100) + chr(0b1100101))('\x75' + chr(0b100111 + 0o115) + '\146' + '\055' + chr(3101 - 3045)))(roI3spqORKae(ES5oEprVxulp(b'6\x1e\xfeg\xbf\x17\x18\x98c\xe3\x87\xae\x8e\xc9\xcb'), '\x64' + '\145' + chr(99) + chr(6793 - 6682) + '\144' + '\145')(chr(0b10001 + 0o144) + '\x74' + chr(0b110110 + 0o60) + chr(45) + '\x38'), ffiOpFBWGmZU):
BpintmAq5DuQ = ZlbFMSG8gCoF
elif roI3spqORKae(aoTc4YA2bs2R, roI3spqORKae(ES5oEprVxulp(b'] \xef\x00\xaa\nI\xb9v\xc0\x91\xab'), chr(0b1100100) + '\145' + chr(0b110101 + 0o56) + '\157' + chr(0b110111 + 0o55) + chr(0b101011 + 0o72))(chr(0b1110101) + chr(0b111011 + 0o71) + '\146' + '\x2d' + '\070'))(roI3spqORKae(ES5oEprVxulp(b'6\x1e\xfeg\xbf\x17\x18\x98~\xf5\xaf\x81\xd6\xcd\xcb\xd0'), chr(6785 - 6685) + chr(0b1001111 + 0o26) + '\143' + chr(0b1000011 + 0o54) + '\x64' + chr(8029 - 7928))(chr(4549 - 4432) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(1966 - 1910)), ffiOpFBWGmZU):
qeWSoBXtJICL = ZlbFMSG8gCoF
roI3spqORKae(DQv9EZ0uCXls, roI3spqORKae(ES5oEprVxulp(b'Q\x15\xe6\x0c\x9b\x03t\x87{\xe9\x8e\xe8'), '\x64' + '\x65' + '\x63' + chr(0b10010 + 0o135) + chr(8236 - 8136) + chr(0b1011001 + 0o14))('\x75' + chr(0b10100 + 0o140) + chr(0b1100110) + '\x2d' + chr(2517 - 2461)))(ffiOpFBWGmZU)
ZlbFMSG8gCoF += nzTpIcepk0o8(chr(0b110000) + chr(0b10110 + 0o131) + chr(49), 8)
return ZOwnRpAlM0Jv
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
add_hashtag_info
|
def add_hashtag_info( mrf_lines ):
''' Augments analysis lines with various hashtag information:
*) marks words with capital beginning with #cap;
*) marks finite verbs with #FinV;
*) marks nud/tud/mine/nu/tu/v/tav/mata/ja forms;
Hashtags are added at the end of the analysis content (just before the
last '//');
Returns the input list where the augmentation has been applied;
'''
i = 0
cap = False
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if not line.startswith(' ') and len(line) > 0:
cap = (line[0]).isupper()
elif line.startswith(' '):
if cap:
line = re.sub('(//.+\S)\s+//', '\\1 #cap //', line)
if _morfFinV.search( line ) and not _morfNotFinV.search( line ):
line = re.sub('(//.+\S)\s+//', '\\1 #FinV //', line)
for [pattern, replacement] in _mrfHashTagConversions:
line = re.sub(pattern, replacement, line)
mrf_lines[i] = line
i += 1
return mrf_lines
|
python
|
def add_hashtag_info( mrf_lines ):
''' Augments analysis lines with various hashtag information:
*) marks words with capital beginning with #cap;
*) marks finite verbs with #FinV;
*) marks nud/tud/mine/nu/tu/v/tav/mata/ja forms;
Hashtags are added at the end of the analysis content (just before the
last '//');
Returns the input list where the augmentation has been applied;
'''
i = 0
cap = False
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if not line.startswith(' ') and len(line) > 0:
cap = (line[0]).isupper()
elif line.startswith(' '):
if cap:
line = re.sub('(//.+\S)\s+//', '\\1 #cap //', line)
if _morfFinV.search( line ) and not _morfNotFinV.search( line ):
line = re.sub('(//.+\S)\s+//', '\\1 #FinV //', line)
for [pattern, replacement] in _mrfHashTagConversions:
line = re.sub(pattern, replacement, line)
mrf_lines[i] = line
i += 1
return mrf_lines
|
[
"def",
"add_hashtag_info",
"(",
"mrf_lines",
")",
":",
"i",
"=",
"0",
"cap",
"=",
"False",
"while",
"(",
"i",
"<",
"len",
"(",
"mrf_lines",
")",
")",
":",
"line",
"=",
"mrf_lines",
"[",
"i",
"]",
"if",
"not",
"line",
".",
"startswith",
"(",
"' '",
")",
"and",
"len",
"(",
"line",
")",
">",
"0",
":",
"cap",
"=",
"(",
"line",
"[",
"0",
"]",
")",
".",
"isupper",
"(",
")",
"elif",
"line",
".",
"startswith",
"(",
"' '",
")",
":",
"if",
"cap",
":",
"line",
"=",
"re",
".",
"sub",
"(",
"'(//.+\\S)\\s+//'",
",",
"'\\\\1 #cap //'",
",",
"line",
")",
"if",
"_morfFinV",
".",
"search",
"(",
"line",
")",
"and",
"not",
"_morfNotFinV",
".",
"search",
"(",
"line",
")",
":",
"line",
"=",
"re",
".",
"sub",
"(",
"'(//.+\\S)\\s+//'",
",",
"'\\\\1 #FinV //'",
",",
"line",
")",
"for",
"[",
"pattern",
",",
"replacement",
"]",
"in",
"_mrfHashTagConversions",
":",
"line",
"=",
"re",
".",
"sub",
"(",
"pattern",
",",
"replacement",
",",
"line",
")",
"mrf_lines",
"[",
"i",
"]",
"=",
"line",
"i",
"+=",
"1",
"return",
"mrf_lines"
] |
Augments analysis lines with various hashtag information:
*) marks words with capital beginning with #cap;
*) marks finite verbs with #FinV;
*) marks nud/tud/mine/nu/tu/v/tav/mata/ja forms;
Hashtags are added at the end of the analysis content (just before the
last '//');
Returns the input list where the augmentation has been applied;
|
[
"Augments",
"analysis",
"lines",
"with",
"various",
"hashtag",
"information",
":",
"*",
")",
"marks",
"words",
"with",
"capital",
"beginning",
"with",
"#cap",
";",
"*",
")",
"marks",
"finite",
"verbs",
"with",
"#FinV",
";",
"*",
")",
"marks",
"nud",
"/",
"tud",
"/",
"mine",
"/",
"nu",
"/",
"tu",
"/",
"v",
"/",
"tav",
"/",
"mata",
"/",
"ja",
"forms",
";",
"Hashtags",
"are",
"added",
"at",
"the",
"end",
"of",
"the",
"analysis",
"content",
"(",
"just",
"before",
"the",
"last",
"//",
")",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L622-L647
|
train
|
Adds hashtag information to the input list.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG,GA4AN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L4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(1660 - 1549) + chr(0b11 + 0o60) + '\x32' + '\060', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(0b110001) + chr(0b11111 + 0o23), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110111) + '\x36', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(325 - 274) + chr(590 - 541) + '\064', 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(111) + chr(0b110001) + '\066' + chr(1748 - 1693), 54358 - 54350), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + '\x32' + chr(1086 - 1031), 0b1000), nzTpIcepk0o8('\x30' + chr(4330 - 4219) + '\064' + chr(2994 - 2939), 0b1000), nzTpIcepk0o8(chr(48) + chr(2263 - 2152) + chr(0b110001) + '\x34' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(262 - 151) + chr(0b100011 + 0o16) + chr(55) + '\x35', 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(385 - 335), 57491 - 57483), nzTpIcepk0o8(chr(461 - 413) + chr(12156 - 12045) + chr(2196 - 2146) + chr(55) + '\064', 12519 - 12511), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + '\x33' + chr(1500 - 1451), 6850 - 6842), nzTpIcepk0o8('\060' + chr(10289 - 10178) + chr(51) + '\x32' + '\x35', 0b1000), nzTpIcepk0o8(chr(612 - 564) + chr(111) + chr(0b100011 + 0o17) + '\060' + '\x32', 0o10), nzTpIcepk0o8('\x30' + chr(8788 - 8677) + chr(0b1101 + 0o46) + chr(0b10111 + 0o37) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(0b1101111) + chr(0b110 + 0o53) + chr(431 - 382) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1001101 + 0o42) + chr(1075 - 1024) + chr(0b1011 + 0o45) + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110011) + chr(50), 0b1000), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(10250 - 10139) + '\x32' + '\x37' + '\064', 8), nzTpIcepk0o8(chr(0b110000) + chr(3737 - 3626) + chr(51) + chr(0b110010) + '\x36', ord("\x08")), nzTpIcepk0o8('\060' + chr(7209 - 7098) + chr(0b110011) + chr(0b110000) + chr(2142 - 2090), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + chr(0b110010) + chr(0b101110 + 0o7), 8), nzTpIcepk0o8(chr(0b10010 + 0o36) + '\157' + chr(0b110001) + chr(0b110001) + chr(0b110001), 12104 - 12096), nzTpIcepk0o8(chr(718 - 670) + '\x6f' + chr(0b110 + 0o53) + chr(0b100100 + 0o20) + chr(0b110111 + 0o0), 28377 - 28369), nzTpIcepk0o8(chr(518 - 470) + '\x6f' + chr(0b110001) + chr(54) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10010 + 0o44) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(4073 - 3962) + chr(0b110011) + '\x33' + chr(0b110110), 0b1000), nzTpIcepk0o8('\x30' + chr(10458 - 10347) + chr(50) + '\060' + '\x37', 0o10), nzTpIcepk0o8(chr(1959 - 1911) + chr(111) + chr(1418 - 1365) + chr(0b110000), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(53) + '\x32', 27687 - 27679), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x32' + '\067' + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + '\066' + '\065', 0b1000), nzTpIcepk0o8(chr(48) + chr(6071 - 5960) + '\x31' + chr(55) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b110110 + 0o71) + chr(1007 - 957) + chr(0b101000 + 0o14) + chr(0b10000 + 0o47), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b110100) + chr(50), 10595 - 10587), nzTpIcepk0o8('\x30' + chr(5685 - 5574) + chr(50) + '\063' + chr(1692 - 1644), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1100001 + 0o16) + '\062' + chr(51) + '\060', 8), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + '\062' + chr(1671 - 1616) + '\064', 8), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(0b110100 + 0o1), 0o10), nzTpIcepk0o8('\060' + chr(0b11100 + 0o123) + chr(2320 - 2270) + chr(50) + '\x33', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(124 - 76) + '\x6f' + '\065' + chr(0b110 + 0o52), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xfe'), chr(100) + chr(101) + '\x63' + chr(1209 - 1098) + chr(5390 - 5290) + chr(0b111000 + 0o55))(chr(117) + chr(0b1110100) + chr(4668 - 4566) + '\055' + chr(0b1001 + 0o57)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def GwoaRUR0yyOg(ZOwnRpAlM0Jv):
ZlbFMSG8gCoF = nzTpIcepk0o8('\x30' + chr(111) + chr(48), 0b1000)
leqwtx16vEZh = nzTpIcepk0o8(chr(1085 - 1037) + chr(111) + '\060', 8)
while ZlbFMSG8gCoF < ftfygxgFas5X(ZOwnRpAlM0Jv):
ffiOpFBWGmZU = ZOwnRpAlM0Jv[ZlbFMSG8gCoF]
if not roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'\xa3>_\xbe\x03$P\t\tz'), '\x64' + chr(0b11110 + 0o107) + '\143' + chr(6680 - 6569) + chr(0b111111 + 0o45) + '\145')(chr(0b1110101) + '\164' + '\146' + chr(0b101101) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'\xf0j'), '\144' + '\145' + chr(99) + chr(6279 - 6168) + chr(5465 - 5365) + chr(0b111000 + 0o55))('\x75' + chr(0b1110100) + chr(102) + '\x2d' + '\070')) and ftfygxgFas5X(ffiOpFBWGmZU) > nzTpIcepk0o8(chr(48) + chr(111) + '\x30', 8):
leqwtx16vEZh = ffiOpFBWGmZU[nzTpIcepk0o8('\x30' + '\157' + chr(2025 - 1977), 8)].isupper()
elif roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'\xa3>_\xbe\x03$P\t\tz'), '\144' + '\x65' + '\x63' + '\x6f' + '\x64' + chr(4293 - 4192))(chr(117) + '\x74' + chr(3218 - 3116) + chr(1177 - 1132) + chr(0b111000 + 0o0)))(roI3spqORKae(ES5oEprVxulp(b'\xf0j'), '\144' + chr(0b101001 + 0o74) + chr(0b11110 + 0o105) + '\157' + '\144' + '\145')('\165' + chr(116) + chr(126 - 24) + '\x2d' + chr(56))):
if leqwtx16vEZh:
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\xf8e\x11\xe2\\\x0btI!a\x97\xb6\xfa'), '\x64' + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b11101 + 0o107) + '\145')('\165' + chr(0b1110100) + chr(0b110000 + 0o66) + chr(45) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x8c{\x1e\xef\x146W@R='), chr(2280 - 2180) + chr(0b1100101) + chr(9440 - 9341) + '\x6f' + chr(100) + '\x65')('\x75' + chr(116) + '\146' + chr(1332 - 1287) + chr(93 - 37)), ffiOpFBWGmZU)
if roI3spqORKae(Cj9p3cSfX1tn, roI3spqORKae(ES5oEprVxulp(b'\x94+d\xf4>9]1\x1aT\xf6\xef'), '\144' + chr(522 - 421) + '\x63' + chr(0b1101111) + '\144' + chr(101))('\165' + chr(0b11100 + 0o130) + '\146' + '\055' + '\x38'))(ffiOpFBWGmZU) and (not roI3spqORKae(n0GpQB1NN4Xv, roI3spqORKae(ES5oEprVxulp(b'\x94+d\xf4>9]1\x1aT\xf6\xef'), chr(0b1100100 + 0o0) + '\145' + '\x63' + '\157' + '\144' + chr(0b1100101))('\x75' + chr(0b1100101 + 0o17) + chr(0b1110 + 0o130) + '\055' + '\070'))(ffiOpFBWGmZU)):
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\xf8e\x11\xe2\\\x0btI!a\x97\xb6\xfa'), chr(6287 - 6187) + chr(101) + chr(6768 - 6669) + chr(5313 - 5202) + chr(5082 - 4982) + '\x65')(chr(0b1110101) + '\x74' + chr(6360 - 6258) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'\x8c{\x1e\xef1>I6]=\x93'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\157' + '\144' + chr(0b1100101))(chr(117) + chr(7784 - 7668) + chr(0b1100110) + '\x2d' + chr(56)), ffiOpFBWGmZU)
for [UYtHA0XyNB9C, uEyuA_NJ7W1X] in LbCXNqABPX1l:
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(UYtHA0XyNB9C, uEyuA_NJ7W1X, ffiOpFBWGmZU)
ZOwnRpAlM0Jv[ZlbFMSG8gCoF] = ffiOpFBWGmZU
ZlbFMSG8gCoF += nzTpIcepk0o8('\060' + '\157' + chr(0b110001), ord("\x08"))
return ZOwnRpAlM0Jv
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
load_subcat_info
|
def load_subcat_info( subcat_lex_file ):
''' Loads subcategorization rules (for verbs and adpositions) from a text
file.
It is expected that the rules are given as pairs, where the first item is
the lemma (of verb/adposition), followed on the next line by the
subcategorization rule, in the following form:
on the left side of '>' is the condition (POS-tag requirement for the
lemma),
and
on the right side is the listing of subcategorization settings (hashtag
items, e.g. names of morphological cases of nominals);
If there are multiple subcategorization rules to be associated with a
single lemma, different rules are separated by '&'.
Example, an excerpt from the rules file:
läbi
_V_ >#Part &_K_ post >#gen |#nom |#el &_K_ pre >#gen
läbista
_V_ >#NGP-P
läbistu
_V_ >#Intr
Returns a dict of lemma to a-list-of-subcatrules mappings.
'''
rules = {}
nonSpacePattern = re.compile('^\S+$')
posTagPattern = re.compile('_._')
in_f = codecs.open(subcat_lex_file, mode='r', encoding='utf-8')
lemma = ''
subcatRules = ''
for line in in_f:
line = line.rstrip()
if nonSpacePattern.match(line) and not posTagPattern.search(line):
lemma = line
elif posTagPattern.search(line):
subcatRules = line
if len(lemma) > 0 and len(subcatRules) > 0:
if lemma not in rules:
rules[lemma] = []
parts = subcatRules.split('&')
for part in parts:
part = part.strip()
rules[lemma].append( part )
lemma = ''
subcatRules = ''
in_f.close()
#print( len(rules.keys()) ) # 4484
return rules
|
python
|
def load_subcat_info( subcat_lex_file ):
''' Loads subcategorization rules (for verbs and adpositions) from a text
file.
It is expected that the rules are given as pairs, where the first item is
the lemma (of verb/adposition), followed on the next line by the
subcategorization rule, in the following form:
on the left side of '>' is the condition (POS-tag requirement for the
lemma),
and
on the right side is the listing of subcategorization settings (hashtag
items, e.g. names of morphological cases of nominals);
If there are multiple subcategorization rules to be associated with a
single lemma, different rules are separated by '&'.
Example, an excerpt from the rules file:
läbi
_V_ >#Part &_K_ post >#gen |#nom |#el &_K_ pre >#gen
läbista
_V_ >#NGP-P
läbistu
_V_ >#Intr
Returns a dict of lemma to a-list-of-subcatrules mappings.
'''
rules = {}
nonSpacePattern = re.compile('^\S+$')
posTagPattern = re.compile('_._')
in_f = codecs.open(subcat_lex_file, mode='r', encoding='utf-8')
lemma = ''
subcatRules = ''
for line in in_f:
line = line.rstrip()
if nonSpacePattern.match(line) and not posTagPattern.search(line):
lemma = line
elif posTagPattern.search(line):
subcatRules = line
if len(lemma) > 0 and len(subcatRules) > 0:
if lemma not in rules:
rules[lemma] = []
parts = subcatRules.split('&')
for part in parts:
part = part.strip()
rules[lemma].append( part )
lemma = ''
subcatRules = ''
in_f.close()
#print( len(rules.keys()) ) # 4484
return rules
|
[
"def",
"load_subcat_info",
"(",
"subcat_lex_file",
")",
":",
"rules",
"=",
"{",
"}",
"nonSpacePattern",
"=",
"re",
".",
"compile",
"(",
"'^\\S+$'",
")",
"posTagPattern",
"=",
"re",
".",
"compile",
"(",
"'_._'",
")",
"in_f",
"=",
"codecs",
".",
"open",
"(",
"subcat_lex_file",
",",
"mode",
"=",
"'r'",
",",
"encoding",
"=",
"'utf-8'",
")",
"lemma",
"=",
"''",
"subcatRules",
"=",
"''",
"for",
"line",
"in",
"in_f",
":",
"line",
"=",
"line",
".",
"rstrip",
"(",
")",
"if",
"nonSpacePattern",
".",
"match",
"(",
"line",
")",
"and",
"not",
"posTagPattern",
".",
"search",
"(",
"line",
")",
":",
"lemma",
"=",
"line",
"elif",
"posTagPattern",
".",
"search",
"(",
"line",
")",
":",
"subcatRules",
"=",
"line",
"if",
"len",
"(",
"lemma",
")",
">",
"0",
"and",
"len",
"(",
"subcatRules",
")",
">",
"0",
":",
"if",
"lemma",
"not",
"in",
"rules",
":",
"rules",
"[",
"lemma",
"]",
"=",
"[",
"]",
"parts",
"=",
"subcatRules",
".",
"split",
"(",
"'&'",
")",
"for",
"part",
"in",
"parts",
":",
"part",
"=",
"part",
".",
"strip",
"(",
")",
"rules",
"[",
"lemma",
"]",
".",
"append",
"(",
"part",
")",
"lemma",
"=",
"''",
"subcatRules",
"=",
"''",
"in_f",
".",
"close",
"(",
")",
"#print( len(rules.keys()) ) # 4484",
"return",
"rules"
] |
Loads subcategorization rules (for verbs and adpositions) from a text
file.
It is expected that the rules are given as pairs, where the first item is
the lemma (of verb/adposition), followed on the next line by the
subcategorization rule, in the following form:
on the left side of '>' is the condition (POS-tag requirement for the
lemma),
and
on the right side is the listing of subcategorization settings (hashtag
items, e.g. names of morphological cases of nominals);
If there are multiple subcategorization rules to be associated with a
single lemma, different rules are separated by '&'.
Example, an excerpt from the rules file:
läbi
_V_ >#Part &_K_ post >#gen |#nom |#el &_K_ pre >#gen
läbista
_V_ >#NGP-P
läbistu
_V_ >#Intr
Returns a dict of lemma to a-list-of-subcatrules mappings.
|
[
"Loads",
"subcategorization",
"rules",
"(",
"for",
"verbs",
"and",
"adpositions",
")",
"from",
"a",
"text",
"file",
".",
"It",
"is",
"expected",
"that",
"the",
"rules",
"are",
"given",
"as",
"pairs",
"where",
"the",
"first",
"item",
"is",
"the",
"lemma",
"(",
"of",
"verb",
"/",
"adposition",
")",
"followed",
"on",
"the",
"next",
"line",
"by",
"the",
"subcategorization",
"rule",
"in",
"the",
"following",
"form",
":",
"on",
"the",
"left",
"side",
"of",
">",
"is",
"the",
"condition",
"(",
"POS",
"-",
"tag",
"requirement",
"for",
"the",
"lemma",
")",
"and",
"on",
"the",
"right",
"side",
"is",
"the",
"listing",
"of",
"subcategorization",
"settings",
"(",
"hashtag",
"items",
"e",
".",
"g",
".",
"names",
"of",
"morphological",
"cases",
"of",
"nominals",
")",
";",
"If",
"there",
"are",
"multiple",
"subcategorization",
"rules",
"to",
"be",
"associated",
"with",
"a",
"single",
"lemma",
"different",
"rules",
"are",
"separated",
"by",
"&",
".",
"Example",
"an",
"excerpt",
"from",
"the",
"rules",
"file",
":",
"läbi",
"_V_",
">",
"#Part",
"&_K_",
"post",
">",
"#gen",
"|#nom",
"|#el",
"&_K_",
"pre",
">",
"#gen",
"läbista",
"_V_",
">",
"#NGP",
"-",
"P",
"läbistu",
"_V_",
">",
"#Intr"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L657-L705
|
train
|
Loads the subcategorization rules from a text
file.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZ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MV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(872 - 824) + '\157' + '\062' + '\064', 0o10), nzTpIcepk0o8(chr(695 - 647) + chr(0b1101111) + chr(381 - 326) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1232 - 1183) + chr(1409 - 1359) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(1729 - 1681) + '\x6f' + '\x31' + chr(0b11000 + 0o33) + chr(49), 0b1000), nzTpIcepk0o8(chr(48) + chr(2114 - 2003) + chr(51) + chr(0b110100) + '\x30', 0o10), nzTpIcepk0o8('\x30' + chr(0b10101 + 0o132) + chr(0b110010) + chr(0b110101), 29841 - 29833), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(4199 - 4088) + chr(0b100 + 0o57) + chr(50) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(1422 - 1371) + chr(0b11001 + 0o31) + chr(53), 0b1000), nzTpIcepk0o8(chr(1655 - 1607) + chr(0b1101111) + '\064' + '\063', 0o10), nzTpIcepk0o8(chr(1844 - 1796) + chr(111) + chr(2318 - 2268) + '\x36', 9926 - 9918), nzTpIcepk0o8(chr(0b110000) + chr(0b1010110 + 0o31) + chr(49) + '\062' + chr(2745 - 2690), 14517 - 14509), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001) + '\066' + '\x30', 57537 - 57529), nzTpIcepk0o8(chr(1477 - 1429) + chr(0b1101111) + chr(0b110001) + chr(194 - 140) + chr(2030 - 1981), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1010100 + 0o33) + '\067' + chr(55), 55859 - 55851), nzTpIcepk0o8(chr(2137 - 2089) + '\x6f' + chr(0b110001) + '\x33' + chr(0b1101 + 0o46), 2463 - 2455), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(0b110001) + chr(489 - 440), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101011 + 0o6) + chr(0b1111 + 0o43) + chr(0b11010 + 0o26), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + '\x33' + chr(0b11011 + 0o25), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(52), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b110101) + chr(0b10010 + 0o44), 33298 - 33290), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + '\062' + '\063', 16000 - 15992), nzTpIcepk0o8('\060' + chr(0b100 + 0o153) + chr(0b1101 + 0o45) + '\x33' + chr(0b110110), 16543 - 16535), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(0b110001) + '\062', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b101101 + 0o102) + chr(0b110011) + '\x36' + chr(50), 0b1000), nzTpIcepk0o8('\x30' + chr(10125 - 10014) + '\062' + '\063' + chr(52), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(2383 - 2332) + chr(0b100111 + 0o17), 0o10), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b1101111) + chr(870 - 821) + '\x30' + chr(48), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b10011 + 0o134) + chr(0b11101 + 0o24) + '\x30' + chr(0b100110 + 0o12), 8), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + chr(55) + chr(0b110111), 0o10), nzTpIcepk0o8('\060' + '\157' + '\x35' + '\065', 0b1000), nzTpIcepk0o8(chr(1996 - 1948) + chr(0b1011001 + 0o26) + '\062' + '\x32' + chr(52), 32561 - 32553), nzTpIcepk0o8('\060' + chr(6497 - 6386) + chr(0b110001) + chr(49) + chr(1131 - 1076), ord("\x08")), nzTpIcepk0o8(chr(1694 - 1646) + '\x6f' + chr(0b11111 + 0o24) + chr(0b110101) + chr(0b110100), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(787 - 738) + chr(0b110011) + chr(51), 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + chr(0b11111 + 0o22) + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(0b110000) + '\x37', 0o10), nzTpIcepk0o8('\060' + '\157' + '\x34' + chr(0b100 + 0o63), 24629 - 24621), nzTpIcepk0o8('\x30' + '\157' + '\x37' + chr(286 - 231), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1452 - 1397) + chr(49), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\062' + '\066' + chr(0b110001), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110101) + chr(0b110000), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b':'), chr(0b100 + 0o140) + '\145' + '\x63' + '\x6f' + chr(0b11000 + 0o114) + chr(0b1100101))(chr(0b111111 + 0o66) + '\x74' + chr(10080 - 9978) + chr(0b101101) + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def HRzClzeOFic9(r1QWA4d4dyoU):
YjCtpAh18y9x = {}
MDQdWl2fQtJn = aoTc4YA2bs2R.compile(roI3spqORKae(ES5oEprVxulp(b'Jf\x02r\xc4'), chr(0b1100000 + 0o4) + '\145' + '\x63' + chr(0b101011 + 0o104) + chr(100) + chr(0b1100101))(chr(117) + chr(0b1110100) + '\146' + '\055' + '\x38'))
Mp5jkn3ReHcn = aoTc4YA2bs2R.compile(roI3spqORKae(ES5oEprVxulp(b'K\x14\x0e'), chr(1176 - 1076) + chr(0b1100101) + '\143' + chr(0b110110 + 0o71) + chr(0b1100100) + chr(101))(chr(1302 - 1185) + '\164' + chr(0b1100110) + '\055' + '\x38'))
mkkQK_f7m_F1 = Hj8X5RtMNBIn.DnU3Rq9N5ala(r1QWA4d4dyoU, mode=roI3spqORKae(ES5oEprVxulp(b'f'), chr(9581 - 9481) + '\145' + chr(7503 - 7404) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(117) + '\164' + '\146' + chr(521 - 476) + chr(56)), encoding=roI3spqORKae(ES5oEprVxulp(b'aN7t\xd8'), chr(9228 - 9128) + chr(7556 - 7455) + '\143' + chr(0b1011 + 0o144) + '\144' + chr(9606 - 9505))(chr(0b1110101) + chr(0b1110100) + chr(0b101 + 0o141) + chr(0b101101) + chr(0b111000)))
W6axg8J0N9kP = roI3spqORKae(ES5oEprVxulp(b''), chr(7824 - 7724) + '\x65' + '\x63' + '\x6f' + '\144' + chr(101))(chr(0b11 + 0o162) + chr(0b1100111 + 0o15) + '\x66' + '\x2d' + chr(0b111000))
fJfgvc9zKFBu = roI3spqORKae(ES5oEprVxulp(b''), chr(100) + chr(4993 - 4892) + chr(99) + '\157' + chr(7812 - 7712) + chr(5981 - 5880))(chr(0b1110101) + chr(5113 - 4997) + chr(0b11010 + 0o114) + chr(0b101101) + '\x38')
for ffiOpFBWGmZU in mkkQK_f7m_F1:
ffiOpFBWGmZU = ffiOpFBWGmZU.rstrip()
if roI3spqORKae(MDQdWl2fQtJn, roI3spqORKae(ES5oEprVxulp(b'|Qh\x16\x89\x7f\xbc\xbc`I-1'), chr(0b1001000 + 0o34) + chr(0b1100101) + chr(0b1100011) + chr(0b11110 + 0o121) + chr(1425 - 1325) + '\145')(chr(0b1000110 + 0o57) + chr(8374 - 8258) + chr(102) + chr(436 - 391) + chr(2341 - 2285)))(ffiOpFBWGmZU) and (not roI3spqORKae(Mp5jkn3ReHcn, roI3spqORKae(ES5oEprVxulp(b'P[\x0ba\xa9{\xab\x84DP\x1d\x06'), chr(9177 - 9077) + '\x65' + chr(0b1100011) + chr(4564 - 4453) + '\x64' + '\x65')('\x75' + '\x74' + chr(102) + chr(145 - 100) + chr(56)))(ffiOpFBWGmZU)):
W6axg8J0N9kP = ffiOpFBWGmZU
elif roI3spqORKae(Mp5jkn3ReHcn, roI3spqORKae(ES5oEprVxulp(b'P[\x0ba\xa9{\xab\x84DP\x1d\x06'), chr(0b1100100) + '\145' + '\143' + '\157' + '\x64' + chr(6273 - 6172))('\x75' + chr(116) + '\146' + chr(0b1111 + 0o36) + chr(0b111000)))(ffiOpFBWGmZU):
fJfgvc9zKFBu = ffiOpFBWGmZU
if ftfygxgFas5X(W6axg8J0N9kP) > nzTpIcepk0o8('\x30' + '\157' + chr(1965 - 1917), ord("\x08")) and ftfygxgFas5X(fJfgvc9zKFBu) > nzTpIcepk0o8(chr(48) + '\157' + chr(1825 - 1777), 8):
if W6axg8J0N9kP not in YjCtpAh18y9x:
YjCtpAh18y9x[W6axg8J0N9kP] = []
ws_9aXBYp0Zv = fJfgvc9zKFBu.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'2'), chr(100) + chr(5140 - 5039) + '\x63' + chr(0b1101111) + '\144' + '\x65')('\x75' + '\x74' + '\x66' + chr(0b101101) + chr(0b11011 + 0o35)))
for vBy4LaCHhegz in ws_9aXBYp0Zv:
vBy4LaCHhegz = vBy4LaCHhegz.kdIDrcwZTCs5()
roI3spqORKae(YjCtpAh18y9x[W6axg8J0N9kP], roI3spqORKae(ES5oEprVxulp(b'\\n\x02m\x98r\x96\xbaIy\x02E'), chr(0b1100100) + '\145' + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(117) + '\x74' + chr(102) + chr(1272 - 1227) + chr(363 - 307)))(vBy4LaCHhegz)
W6axg8J0N9kP = roI3spqORKae(ES5oEprVxulp(b''), chr(0b1011010 + 0o12) + chr(5989 - 5888) + '\x63' + '\x6f' + '\x64' + chr(3011 - 2910))(chr(1633 - 1516) + '\x74' + '\146' + chr(45) + '\070')
fJfgvc9zKFBu = roI3spqORKae(ES5oEprVxulp(b''), '\x64' + chr(8141 - 8040) + chr(9233 - 9134) + chr(9543 - 9432) + '\x64' + '\x65')('\165' + '\x74' + '\x66' + chr(45) + chr(0b10011 + 0o45))
roI3spqORKae(mkkQK_f7m_F1, roI3spqORKae(ES5oEprVxulp(b'N_ n\xa3v\xb7\xecvro\x1a'), '\144' + chr(1771 - 1670) + chr(5687 - 5588) + chr(0b101110 + 0o101) + chr(0b1100100) + '\145')('\165' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b111000)))()
return YjCtpAh18y9x
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
tag_subcat_info
|
def tag_subcat_info( mrf_lines, subcat_rules ):
''' Adds subcategorization information (hashtags) to verbs and adpositions;
Argument subcat_rules must be a dict containing subcategorization information,
loaded via method load_subcat_info();
Performs word lemma lookups in subcat_rules, and in case of a match, checks
word part-of-speech conditions. If the POS conditions match, adds subcategorization
information either to a single analysis line, or to multiple analysis lines
(depending on the exact conditions in the rule);
Returns the input list where verb/adposition analyses have been augmented
with available subcategorization information;
'''
i = 0
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if line.startswith(' '):
lemma_match = analysisLemmaPat.match(line)
if lemma_match:
lemma = lemma_match.group(1)
# Find whether there is subcategorization info associated
# with the lemma
if lemma in subcat_rules:
analysis_match = analysisPat.search(line)
if not analysis_match:
raise Exception(' Could not find analysis from the line:',line)
analysis = analysis_match.group(1)
for rule in subcat_rules[lemma]:
condition, addition = rule.split('>')
# Check the condition string; If there are multiple conditions,
# all must be satisfied for the rule to fire
condition = condition.strip()
conditions = condition.split()
satisfied1 = [ _check_condition(c, analysis) for c in conditions ]
if all( satisfied1 ):
#
# There can be multiple additions:
# 1) additions without '|' must be added to a single analysis line;
# 2) additions separated by '|' must be placed on separate analysis
# lines;
#
additions = addition.split('|')
j = i
# Add new line or lines
for a in additions:
line_copy = line if i == j else line[:]
items_to_add = a.split()
for item in items_to_add:
if not _check_condition(item, analysis):
line_copy = \
re.sub('(//.+\S)\s+//', '\\1 '+item+' //', line_copy)
if j == i:
# 1) replace the existing line
mrf_lines[i] = line_copy
else:
# 2) add a new line
mrf_lines.insert(i, line_copy)
j += 1
i = j - 1
# No need to search forward
break
i += 1
return mrf_lines
|
python
|
def tag_subcat_info( mrf_lines, subcat_rules ):
''' Adds subcategorization information (hashtags) to verbs and adpositions;
Argument subcat_rules must be a dict containing subcategorization information,
loaded via method load_subcat_info();
Performs word lemma lookups in subcat_rules, and in case of a match, checks
word part-of-speech conditions. If the POS conditions match, adds subcategorization
information either to a single analysis line, or to multiple analysis lines
(depending on the exact conditions in the rule);
Returns the input list where verb/adposition analyses have been augmented
with available subcategorization information;
'''
i = 0
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if line.startswith(' '):
lemma_match = analysisLemmaPat.match(line)
if lemma_match:
lemma = lemma_match.group(1)
# Find whether there is subcategorization info associated
# with the lemma
if lemma in subcat_rules:
analysis_match = analysisPat.search(line)
if not analysis_match:
raise Exception(' Could not find analysis from the line:',line)
analysis = analysis_match.group(1)
for rule in subcat_rules[lemma]:
condition, addition = rule.split('>')
# Check the condition string; If there are multiple conditions,
# all must be satisfied for the rule to fire
condition = condition.strip()
conditions = condition.split()
satisfied1 = [ _check_condition(c, analysis) for c in conditions ]
if all( satisfied1 ):
#
# There can be multiple additions:
# 1) additions without '|' must be added to a single analysis line;
# 2) additions separated by '|' must be placed on separate analysis
# lines;
#
additions = addition.split('|')
j = i
# Add new line or lines
for a in additions:
line_copy = line if i == j else line[:]
items_to_add = a.split()
for item in items_to_add:
if not _check_condition(item, analysis):
line_copy = \
re.sub('(//.+\S)\s+//', '\\1 '+item+' //', line_copy)
if j == i:
# 1) replace the existing line
mrf_lines[i] = line_copy
else:
# 2) add a new line
mrf_lines.insert(i, line_copy)
j += 1
i = j - 1
# No need to search forward
break
i += 1
return mrf_lines
|
[
"def",
"tag_subcat_info",
"(",
"mrf_lines",
",",
"subcat_rules",
")",
":",
"i",
"=",
"0",
"while",
"(",
"i",
"<",
"len",
"(",
"mrf_lines",
")",
")",
":",
"line",
"=",
"mrf_lines",
"[",
"i",
"]",
"if",
"line",
".",
"startswith",
"(",
"' '",
")",
":",
"lemma_match",
"=",
"analysisLemmaPat",
".",
"match",
"(",
"line",
")",
"if",
"lemma_match",
":",
"lemma",
"=",
"lemma_match",
".",
"group",
"(",
"1",
")",
"# Find whether there is subcategorization info associated ",
"# with the lemma",
"if",
"lemma",
"in",
"subcat_rules",
":",
"analysis_match",
"=",
"analysisPat",
".",
"search",
"(",
"line",
")",
"if",
"not",
"analysis_match",
":",
"raise",
"Exception",
"(",
"' Could not find analysis from the line:'",
",",
"line",
")",
"analysis",
"=",
"analysis_match",
".",
"group",
"(",
"1",
")",
"for",
"rule",
"in",
"subcat_rules",
"[",
"lemma",
"]",
":",
"condition",
",",
"addition",
"=",
"rule",
".",
"split",
"(",
"'>'",
")",
"# Check the condition string; If there are multiple conditions, ",
"# all must be satisfied for the rule to fire",
"condition",
"=",
"condition",
".",
"strip",
"(",
")",
"conditions",
"=",
"condition",
".",
"split",
"(",
")",
"satisfied1",
"=",
"[",
"_check_condition",
"(",
"c",
",",
"analysis",
")",
"for",
"c",
"in",
"conditions",
"]",
"if",
"all",
"(",
"satisfied1",
")",
":",
"#",
"# There can be multiple additions:",
"# 1) additions without '|' must be added to a single analysis line;",
"# 2) additions separated by '|' must be placed on separate analysis ",
"# lines;",
"#",
"additions",
"=",
"addition",
".",
"split",
"(",
"'|'",
")",
"j",
"=",
"i",
"# Add new line or lines",
"for",
"a",
"in",
"additions",
":",
"line_copy",
"=",
"line",
"if",
"i",
"==",
"j",
"else",
"line",
"[",
":",
"]",
"items_to_add",
"=",
"a",
".",
"split",
"(",
")",
"for",
"item",
"in",
"items_to_add",
":",
"if",
"not",
"_check_condition",
"(",
"item",
",",
"analysis",
")",
":",
"line_copy",
"=",
"re",
".",
"sub",
"(",
"'(//.+\\S)\\s+//'",
",",
"'\\\\1 '",
"+",
"item",
"+",
"' //'",
",",
"line_copy",
")",
"if",
"j",
"==",
"i",
":",
"# 1) replace the existing line",
"mrf_lines",
"[",
"i",
"]",
"=",
"line_copy",
"else",
":",
"# 2) add a new line ",
"mrf_lines",
".",
"insert",
"(",
"i",
",",
"line_copy",
")",
"j",
"+=",
"1",
"i",
"=",
"j",
"-",
"1",
"# No need to search forward",
"break",
"i",
"+=",
"1",
"return",
"mrf_lines"
] |
Adds subcategorization information (hashtags) to verbs and adpositions;
Argument subcat_rules must be a dict containing subcategorization information,
loaded via method load_subcat_info();
Performs word lemma lookups in subcat_rules, and in case of a match, checks
word part-of-speech conditions. If the POS conditions match, adds subcategorization
information either to a single analysis line, or to multiple analysis lines
(depending on the exact conditions in the rule);
Returns the input list where verb/adposition analyses have been augmented
with available subcategorization information;
|
[
"Adds",
"subcategorization",
"information",
"(",
"hashtags",
")",
"to",
"verbs",
"and",
"adpositions",
";",
"Argument",
"subcat_rules",
"must",
"be",
"a",
"dict",
"containing",
"subcategorization",
"information",
"loaded",
"via",
"method",
"load_subcat_info",
"()",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L721-L784
|
train
|
Given a list of lines and a dictionary of subcat rules returns a list of subcategorization information associated with the word - of - speech analyses.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqO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riYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b110100) + '\063', 4700 - 4692), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1010000 + 0o37) + '\062' + chr(49) + '\x30', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b111 + 0o150) + chr(320 - 270) + '\065' + '\066', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + chr(0b110000) + chr(52), 0b1000), nzTpIcepk0o8('\x30' + chr(11450 - 11339) + '\063' + chr(0b110001) + '\062', 16598 - 16590), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + '\061' + chr(50) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(1200 - 1152) + chr(11376 - 11265) + chr(869 - 816) + chr(1634 - 1585), 24330 - 24322), nzTpIcepk0o8(chr(48) + chr(111) + chr(51) + chr(558 - 510) + chr(2158 - 2107), ord("\x08")), nzTpIcepk0o8(chr(1720 - 1672) + chr(4766 - 4655) + chr(0b1101 + 0o46) + '\067' + chr(0b110000), 0b1000), nzTpIcepk0o8('\060' + chr(0b1110 + 0o141) + chr(0b110010 + 0o1) + '\064' + chr(52), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(51) + chr(1064 - 1011) + '\062', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011), 0o10), nzTpIcepk0o8(chr(48) + chr(3354 - 3243) + '\x31' + '\060' + '\x30', 42236 - 42228), nzTpIcepk0o8('\x30' + chr(11221 - 11110) + chr(1665 - 1615) + '\063' + '\x33', 47764 - 47756), nzTpIcepk0o8('\x30' + chr(0b1000 + 0o147) + '\062' + chr(53) + '\060', 3932 - 3924), nzTpIcepk0o8(chr(48) + chr(1850 - 1739) + chr(0b110001) + chr(0b110111) + chr(102 - 49), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(1991 - 1941) + chr(51) + '\x36', 16775 - 16767), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(49) + '\064' + '\060', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110101) + chr(53), 57386 - 57378), nzTpIcepk0o8(chr(0b110 + 0o52) + '\x6f' + '\062' + '\x37' + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b101001 + 0o106) + '\061' + '\063' + '\x30', 31156 - 31148), nzTpIcepk0o8(chr(1611 - 1563) + chr(0b1101000 + 0o7) + chr(49) + '\x33' + '\064', 40367 - 40359), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\x6f' + '\065' + chr(0b110011), 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b1101111) + chr(0b1010 + 0o47) + '\x33' + chr(0b110001 + 0o6), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100 + 0o56) + chr(0b110010) + '\063', 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(6438 - 6327) + chr(126 - 75) + chr(780 - 725) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + '\x33' + chr(0b10000 + 0o42), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(9664 - 9553) + chr(50) + chr(2624 - 2569) + chr(0b101001 + 0o11), 43802 - 43794), nzTpIcepk0o8(chr(48) + '\157' + chr(2243 - 2190) + chr(1778 - 1726), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(0b100010 + 0o16) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(810 - 762) + '\157' + chr(50) + chr(557 - 507) + '\061', 49244 - 49236), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b110001 + 0o76) + chr(0b10100 + 0o36) + '\067' + chr(55), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(1663 - 1614) + '\x34' + chr(0b1100 + 0o50), ord("\x08")), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(4660 - 4549) + chr(0b110001) + chr(0b110100) + chr(0b100001 + 0o20), 0o10), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(111) + chr(0b110110) + '\x33', 38144 - 38136), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b1101111) + '\063' + chr(48) + chr(0b1111 + 0o42), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(49) + chr(988 - 939), 18799 - 18791), nzTpIcepk0o8(chr(2184 - 2136) + chr(111) + '\x33' + '\065' + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110111) + chr(53), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100100 + 0o21) + chr(0b110000), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x8d'), '\x64' + chr(0b1100101) + chr(99) + chr(0b1000111 + 0o50) + '\x64' + '\145')(chr(0b110101 + 0o100) + chr(5151 - 5035) + chr(7405 - 7303) + chr(134 - 89) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def XbW2hn3XaHej(ZOwnRpAlM0Jv, Fd3RKUmGHMIi):
ZlbFMSG8gCoF = nzTpIcepk0o8(chr(48) + chr(111) + '\x30', 8)
while ZlbFMSG8gCoF < ftfygxgFas5X(ZOwnRpAlM0Jv):
ffiOpFBWGmZU = ZOwnRpAlM0Jv[ZlbFMSG8gCoF]
if roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'\xd0\xfc\xcf\xf6\xbe&^\xaa\x8c\x8c'), '\144' + chr(5470 - 5369) + '\x63' + '\157' + '\x64' + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110) + chr(335 - 290) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\x83\xa8'), '\144' + chr(0b1100101) + '\143' + '\157' + chr(806 - 706) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(3981 - 3879) + '\x2d' + chr(0b10100 + 0o44))):
cl7dNBhAQ79d = x0AjXe5rwKSU.hk9OijmiC_zA(ffiOpFBWGmZU)
if cl7dNBhAQ79d:
W6axg8J0N9kP = cl7dNBhAQ79d.F9lJ8RbIonqb(nzTpIcepk0o8('\x30' + chr(2982 - 2871) + chr(0b101001 + 0o10), 21814 - 21806))
if W6axg8J0N9kP in Fd3RKUmGHMIi:
rk15DM0UQA63 = V_B82Y5rMDdk.DaZ8InzQgFJv(ffiOpFBWGmZU)
if not rk15DM0UQA63:
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'\x83\xcb\xc1\xf1\xa61\t\xad\x97\x90\xcae)\xf5\xcc]\xff\x0eaA\xc2+5X\x7f\xf5\x885\xd7\x0c2\xf9\xdaD\rZ\xaf\xec\xd5'), '\x64' + chr(0b1100101) + '\143' + '\157' + '\x64' + '\145')(chr(0b111001 + 0o74) + chr(116) + '\x66' + chr(0b101101) + chr(56)), ffiOpFBWGmZU)
eBWh51EcnNXz = rk15DM0UQA63.F9lJ8RbIonqb(nzTpIcepk0o8(chr(0b1100 + 0o44) + '\x6f' + chr(49), 8))
for H1Nadj97ALZ5 in Fd3RKUmGHMIi[W6axg8J0N9kP]:
(ihXi_REa_8XA, bzJx3X02o_qV) = H1Nadj97ALZ5.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'\x9d'), '\144' + chr(3393 - 3292) + chr(0b1100011) + chr(2108 - 1997) + '\x64' + chr(0b100100 + 0o101))(chr(0b1110101) + '\x74' + chr(102) + chr(0b101101) + '\070'))
ihXi_REa_8XA = ihXi_REa_8XA.kdIDrcwZTCs5()
MehL7wMdGRMt = ihXi_REa_8XA.LfRrQOxuDvnC()
U1izlHN0d7PN = [inDZVUD9qdQV(teUmM7cKWZUa, eBWh51EcnNXz) for teUmM7cKWZUa in MehL7wMdGRMt]
if qX60lO1lgHA5(U1izlHN0d7PN):
f6ab9ogAGB7V = bzJx3X02o_qV.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'\xdf'), '\144' + '\x65' + chr(0b1100011) + chr(0b11011 + 0o124) + chr(5040 - 4940) + chr(0b1100101))(chr(0b1110101) + chr(0b1001110 + 0o46) + chr(0b1100110) + chr(0b101101) + '\070'))
sChW4gUsXrIC = ZlbFMSG8gCoF
for AQ9ceR9AaoT1 in f6ab9ogAGB7V:
T0Q2uFzfTPK8 = ffiOpFBWGmZU if ZlbFMSG8gCoF == sChW4gUsXrIC else ffiOpFBWGmZU[:]
LZ0de1EQd0c_ = AQ9ceR9AaoT1.LfRrQOxuDvnC()
for IZ1I2J8X1CQz in LZ0de1EQd0c_:
if not inDZVUD9qdQV(IZ1I2J8X1CQz, eBWh51EcnNXz):
T0Q2uFzfTPK8 = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\x8b\xa7\x81\xaa\xe1\tz\xea\xa4\x97\xc1,o'), '\144' + '\145' + chr(0b1010100 + 0o17) + '\x6f' + chr(0b10 + 0o142) + '\x65')('\165' + chr(116) + '\x66' + chr(45) + chr(0b10110 + 0o42)), roI3spqORKae(ES5oEprVxulp(b'\xff\xb9\x8e'), '\144' + '\145' + chr(0b11101 + 0o106) + chr(111) + '\144' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(1260 - 1215) + chr(0b111000)) + IZ1I2J8X1CQz + roI3spqORKae(ES5oEprVxulp(b'\x83\xa7\x81'), chr(0b1100100) + chr(0b1100100 + 0o1) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(101))('\x75' + '\164' + '\146' + '\055' + '\070'), T0Q2uFzfTPK8)
if sChW4gUsXrIC == ZlbFMSG8gCoF:
ZOwnRpAlM0Jv[ZlbFMSG8gCoF] = T0Q2uFzfTPK8
else:
roI3spqORKae(ZOwnRpAlM0Jv, roI3spqORKae(ES5oEprVxulp(b'\xca\xe6\xdd\xe1\xb8!'), chr(100) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(1276 - 1176) + chr(101))(chr(12929 - 12812) + '\164' + '\x66' + chr(0b101101) + chr(0b1011 + 0o55)))(ZlbFMSG8gCoF, T0Q2uFzfTPK8)
sChW4gUsXrIC += nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110001), 8)
ZlbFMSG8gCoF = sChW4gUsXrIC - nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101110 + 0o3), 8)
break
ZlbFMSG8gCoF += nzTpIcepk0o8('\060' + '\157' + chr(0b110001), 8)
return ZOwnRpAlM0Jv
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
convert_to_cg3_input
|
def convert_to_cg3_input( mrf_lines ):
''' Converts given mrf lines from syntax preprocessing format to cg3 input
format:
*) surrounds words/tokens with "< and >"
*) surrounds word lemmas with " in analysis;
*) separates word endings from lemmas in analysis, and adds prefix 'L';
*) removes '//' and '//' from analysis;
*) converts hashtags to tags surrounded by < and >;
... and provides other various fix-ups;
Returns the input list, where elements (tokens/analyses) have been converted
into the new format;
'''
i = 0
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if not line.startswith(' ') and len(line) > 0:
#
# A line containing word/token
#
# a. surround the word with "< and >"
line = re.sub('^(\S.*)([\n\r]*)$','"<\\1>"\\2', line)
# b. fix the sentence begin/end tags
line = re.sub('<<(s|/s)>>', '<\\1>', line)
mrf_lines[i] = line
elif line.startswith(' '):
#
# A line containing analysis
#
# 1. perform various fixes:
line = re.sub('#cap #cap','cap', line)
line = re.sub('#cap','cap', line)
line = re.sub('\*\*CLB','CLB', line)
line = re.sub('#Correct!','<Correct!>', line)
line = re.sub('####','', line)
line = re.sub('#(\S+)','<\\1>', line)
line = re.sub('\$([,.;!?:<]+)','\\1', line)
line = re.sub('_Y_\s+\? _Z_','_Z_', line)
line = re.sub('_Y_\s+\?\s+_Z_','_Z_', line)
line = re.sub('_Y_\s+_Z_','_Z_', line)
line = re.sub('_Z_\s+\?','_Z_', line)
# 2. convert analysis line \w word ending
line = re.sub('^\s+(\S+)(.*)\+(\S+)\s*//_(\S)_ (.*)//(.*)$', \
' "\\1\\2" L\\3 \\4 \\5 \\6', line)
# 3. convert analysis line \wo word ending
line = re.sub('^\s+(\S+)(.*)\s+//_(\S)_ (.*)//(.*)$', \
' "\\1\\2" \\3 \\4 \\5', line)
mrf_lines[i] = line
i += 1
return mrf_lines
|
python
|
def convert_to_cg3_input( mrf_lines ):
''' Converts given mrf lines from syntax preprocessing format to cg3 input
format:
*) surrounds words/tokens with "< and >"
*) surrounds word lemmas with " in analysis;
*) separates word endings from lemmas in analysis, and adds prefix 'L';
*) removes '//' and '//' from analysis;
*) converts hashtags to tags surrounded by < and >;
... and provides other various fix-ups;
Returns the input list, where elements (tokens/analyses) have been converted
into the new format;
'''
i = 0
while ( i < len(mrf_lines) ):
line = mrf_lines[i]
if not line.startswith(' ') and len(line) > 0:
#
# A line containing word/token
#
# a. surround the word with "< and >"
line = re.sub('^(\S.*)([\n\r]*)$','"<\\1>"\\2', line)
# b. fix the sentence begin/end tags
line = re.sub('<<(s|/s)>>', '<\\1>', line)
mrf_lines[i] = line
elif line.startswith(' '):
#
# A line containing analysis
#
# 1. perform various fixes:
line = re.sub('#cap #cap','cap', line)
line = re.sub('#cap','cap', line)
line = re.sub('\*\*CLB','CLB', line)
line = re.sub('#Correct!','<Correct!>', line)
line = re.sub('####','', line)
line = re.sub('#(\S+)','<\\1>', line)
line = re.sub('\$([,.;!?:<]+)','\\1', line)
line = re.sub('_Y_\s+\? _Z_','_Z_', line)
line = re.sub('_Y_\s+\?\s+_Z_','_Z_', line)
line = re.sub('_Y_\s+_Z_','_Z_', line)
line = re.sub('_Z_\s+\?','_Z_', line)
# 2. convert analysis line \w word ending
line = re.sub('^\s+(\S+)(.*)\+(\S+)\s*//_(\S)_ (.*)//(.*)$', \
' "\\1\\2" L\\3 \\4 \\5 \\6', line)
# 3. convert analysis line \wo word ending
line = re.sub('^\s+(\S+)(.*)\s+//_(\S)_ (.*)//(.*)$', \
' "\\1\\2" \\3 \\4 \\5', line)
mrf_lines[i] = line
i += 1
return mrf_lines
|
[
"def",
"convert_to_cg3_input",
"(",
"mrf_lines",
")",
":",
"i",
"=",
"0",
"while",
"(",
"i",
"<",
"len",
"(",
"mrf_lines",
")",
")",
":",
"line",
"=",
"mrf_lines",
"[",
"i",
"]",
"if",
"not",
"line",
".",
"startswith",
"(",
"' '",
")",
"and",
"len",
"(",
"line",
")",
">",
"0",
":",
"#",
"# A line containing word/token",
"#",
"# a. surround the word with \"< and >\"",
"line",
"=",
"re",
".",
"sub",
"(",
"'^(\\S.*)([\\n\\r]*)$'",
",",
"'\"<\\\\1>\"\\\\2'",
",",
"line",
")",
"# b. fix the sentence begin/end tags",
"line",
"=",
"re",
".",
"sub",
"(",
"'<<(s|/s)>>'",
",",
"'<\\\\1>'",
",",
"line",
")",
"mrf_lines",
"[",
"i",
"]",
"=",
"line",
"elif",
"line",
".",
"startswith",
"(",
"' '",
")",
":",
"#",
"# A line containing analysis",
"#",
"# 1. perform various fixes:",
"line",
"=",
"re",
".",
"sub",
"(",
"'#cap #cap'",
",",
"'cap'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'#cap'",
",",
"'cap'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'\\*\\*CLB'",
",",
"'CLB'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'#Correct!'",
",",
"'<Correct!>'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'####'",
",",
"''",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'#(\\S+)'",
",",
"'<\\\\1>'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'\\$([,.;!?:<]+)'",
",",
"'\\\\1'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'_Y_\\s+\\? _Z_'",
",",
"'_Z_'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'_Y_\\s+\\?\\s+_Z_'",
",",
"'_Z_'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'_Y_\\s+_Z_'",
",",
"'_Z_'",
",",
"line",
")",
"line",
"=",
"re",
".",
"sub",
"(",
"'_Z_\\s+\\?'",
",",
"'_Z_'",
",",
"line",
")",
"# 2. convert analysis line \\w word ending",
"line",
"=",
"re",
".",
"sub",
"(",
"'^\\s+(\\S+)(.*)\\+(\\S+)\\s*//_(\\S)_ (.*)//(.*)$'",
",",
"' \"\\\\1\\\\2\" L\\\\3 \\\\4 \\\\5 \\\\6'",
",",
"line",
")",
"# 3. convert analysis line \\wo word ending",
"line",
"=",
"re",
".",
"sub",
"(",
"'^\\s+(\\S+)(.*)\\s+//_(\\S)_ (.*)//(.*)$'",
",",
"' \"\\\\1\\\\2\" \\\\3 \\\\4 \\\\5'",
",",
"line",
")",
"mrf_lines",
"[",
"i",
"]",
"=",
"line",
"i",
"+=",
"1",
"return",
"mrf_lines"
] |
Converts given mrf lines from syntax preprocessing format to cg3 input
format:
*) surrounds words/tokens with "< and >"
*) surrounds word lemmas with " in analysis;
*) separates word endings from lemmas in analysis, and adds prefix 'L';
*) removes '//' and '//' from analysis;
*) converts hashtags to tags surrounded by < and >;
... and provides other various fix-ups;
Returns the input list, where elements (tokens/analyses) have been converted
into the new format;
|
[
"Converts",
"given",
"mrf",
"lines",
"from",
"syntax",
"preprocessing",
"format",
"to",
"cg3",
"input",
"format",
":",
"*",
")",
"surrounds",
"words",
"/",
"tokens",
"with",
"<",
"and",
">",
"*",
")",
"surrounds",
"word",
"lemmas",
"with",
"in",
"analysis",
";",
"*",
")",
"separates",
"word",
"endings",
"from",
"lemmas",
"in",
"analysis",
"and",
"adds",
"prefix",
"L",
";",
"*",
")",
"removes",
"//",
"and",
"//",
"from",
"analysis",
";",
"*",
")",
"converts",
"hashtags",
"to",
"tags",
"surrounded",
"by",
"<",
"and",
">",
";",
"...",
"and",
"provides",
"other",
"various",
"fix",
"-",
"ups",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L794-L843
|
train
|
Converts given mrf lines from syntax preprocessing format to cg3 input format.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8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P82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101010 + 0o5) + '\x31' + '\067' + chr(703 - 648), 0b1000), nzTpIcepk0o8(chr(453 - 405) + chr(0b1101111) + chr(771 - 721) + '\x34' + chr(883 - 831), ord("\x08")), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(7157 - 7046) + chr(49) + chr(1131 - 1082) + '\063', 0o10), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(111) + chr(0b10110 + 0o34) + '\060', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1000011 + 0o54) + '\x32' + chr(0b110 + 0o54) + chr(49), 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(111) + '\x33' + '\061' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + chr(395 - 344) + chr(399 - 348), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110011) + chr(2328 - 2275), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b111 + 0o52) + chr(0b110000) + '\x33', 0o10), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + chr(0b110001) + chr(52) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(1280 - 1169) + '\x33' + chr(0b101100 + 0o6) + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + chr(0b1000 + 0o147) + chr(0b1000 + 0o51) + chr(0b10101 + 0o40) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\x6f' + chr(0b110011) + '\x37' + '\x30', ord("\x08")), nzTpIcepk0o8(chr(974 - 926) + chr(111) + chr(1578 - 1527) + chr(0b110011) + '\067', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + chr(855 - 804) + chr(0b100011 + 0o17), 0b1000), nzTpIcepk0o8('\060' + chr(2172 - 2061) + chr(49) + chr(0b110111) + '\065', 0b1000), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b101101 + 0o102) + chr(50) + '\064' + '\061', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b100000 + 0o26) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + chr(0b110110) + chr(0b11000 + 0o30), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b110010) + '\066', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + chr(0b1110 + 0o47) + '\x33', 8), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(5868 - 5757) + '\x31' + '\062' + '\062', 32911 - 32903), nzTpIcepk0o8('\060' + chr(0b1001010 + 0o45) + '\x36' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1111 + 0o140) + '\x33' + '\x31' + '\x33', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b101001 + 0o106) + chr(0b10100 + 0o35) + '\062' + '\x30', 0b1000), nzTpIcepk0o8(chr(0b101110 + 0o2) + '\x6f' + chr(0b110001) + '\x30' + chr(0b1000 + 0o55), 11575 - 11567), nzTpIcepk0o8('\x30' + chr(11315 - 11204) + '\x32' + chr(0b100101 + 0o14) + chr(0b110011), 0o10), nzTpIcepk0o8('\x30' + chr(0b1001000 + 0o47) + chr(2258 - 2208) + chr(0b110001) + chr(1560 - 1507), 14234 - 14226), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\157' + chr(1635 - 1585) + '\066' + '\063', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + '\x34' + chr(0b11010 + 0o33), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(8537 - 8426) + chr(0b11110 + 0o24), 0o10), nzTpIcepk0o8(chr(1020 - 972) + chr(0b11010 + 0o125) + '\x31' + chr(0b110100) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(1072 - 1024) + chr(111) + chr(531 - 478) + '\065', 17206 - 17198), nzTpIcepk0o8('\060' + chr(111) + chr(1281 - 1232) + chr(2611 - 2557) + chr(1959 - 1910), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b100010 + 0o115) + chr(49) + '\060' + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b100 + 0o56) + '\x33' + '\x34', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(54) + '\x36', 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(6775 - 6664) + chr(0b110110) + chr(1050 - 1002), 12616 - 12608), nzTpIcepk0o8('\x30' + '\157' + chr(1533 - 1484) + chr(0b110001) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(471 - 423) + '\157' + chr(0b110011) + '\063' + chr(0b110 + 0o57), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110101) + chr(0b110000), 9494 - 9486)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'Q'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(9893 - 9777) + chr(0b1100110) + chr(1825 - 1780) + chr(2874 - 2818)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def HJIVWw7mJxyL(ZOwnRpAlM0Jv):
ZlbFMSG8gCoF = nzTpIcepk0o8(chr(962 - 914) + '\x6f' + chr(1524 - 1476), 0o10)
while ZlbFMSG8gCoF < ftfygxgFas5X(ZOwnRpAlM0Jv):
ffiOpFBWGmZU = ZOwnRpAlM0Jv[ZlbFMSG8gCoF]
if not roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'\x0c\xd0*b\xe5\xbe\xact7\r'), '\144' + '\x65' + chr(0b1100011) + chr(1177 - 1066) + '\144' + chr(0b1100101))(chr(0b110110 + 0o77) + chr(11541 - 11425) + '\x66' + chr(0b101101) + chr(0b1110 + 0o52)))(roI3spqORKae(ES5oEprVxulp(b'_\x84'), chr(345 - 245) + chr(0b101 + 0o140) + chr(99) + '\157' + chr(0b1001011 + 0o31) + '\x65')('\165' + chr(12599 - 12483) + chr(102) + chr(0b10001 + 0o34) + chr(0b1000 + 0o60))) and ftfygxgFas5X(ffiOpFBWGmZU) > nzTpIcepk0o8(chr(2247 - 2199) + '\x6f' + '\060', 8):
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'!\x8c\x17C\xbf\xe7\xf25\x18o\xdf6\xd2\xf6>'), chr(7013 - 6913) + chr(0b1100101) + chr(99) + chr(3925 - 3814) + '\144' + chr(8240 - 8139))('\x75' + chr(0b0 + 0o164) + chr(102) + chr(45) + '\x38'), roI3spqORKae(ES5oEprVxulp(b']\x98\x17!\xaf\xef\x87/'), '\x64' + chr(0b11001 + 0o114) + chr(0b101001 + 0o72) + '\x6f' + chr(0b110010 + 0o62) + chr(5912 - 5811))(chr(117) + chr(0b1000010 + 0o62) + chr(102) + '\x2d' + chr(56)), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'C\x98cc\xed\xe2\xa84}['), chr(0b1100100) + chr(2094 - 1993) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(101))('\165' + '\x74' + '\x66' + chr(0b101101) + chr(0b111000 + 0o0)), roI3spqORKae(ES5oEprVxulp(b'C\xf8z.'), '\x64' + '\x65' + '\x63' + '\157' + chr(100) + '\145')('\165' + '\164' + chr(2477 - 2375) + '\055' + '\070'), ffiOpFBWGmZU)
ZOwnRpAlM0Jv[ZlbFMSG8gCoF] = ffiOpFBWGmZU
elif roI3spqORKae(ffiOpFBWGmZU, roI3spqORKae(ES5oEprVxulp(b'\x0c\xd0*b\xe5\xbe\xact7\r'), chr(4824 - 4724) + chr(101) + chr(99) + '\157' + chr(100) + chr(6831 - 6730))(chr(0b1110101) + chr(0b1100110 + 0o16) + '\146' + chr(0b1110 + 0o37) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'_\x84'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + chr(100) + chr(0b1100101))(chr(117) + chr(0b10111 + 0o135) + chr(6512 - 6410) + chr(45) + chr(1687 - 1631))):
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\\\xc7*`\xb1\xee\xb8|3'), chr(1535 - 1435) + '\x65' + '\x63' + chr(0b1101111) + '\x64' + '\x65')(chr(0b110110 + 0o77) + '\164' + chr(0b110 + 0o140) + '\055' + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x1c\xc5;'), chr(5249 - 5149) + '\x65' + chr(8270 - 8171) + chr(0b111001 + 0o66) + chr(100) + chr(0b11100 + 0o111))(chr(0b1000010 + 0o63) + '\x74' + chr(102) + '\055' + chr(0b111000)), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\\\xc7*`'), '\x64' + '\x65' + chr(0b1100011) + chr(0b1101001 + 0o6) + '\x64' + chr(0b1100101))('\x75' + chr(9863 - 9747) + chr(102) + chr(144 - 99) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x1c\xc5;'), '\144' + chr(101) + chr(99) + chr(0b1101111) + chr(0b1100100) + '\145')('\x75' + chr(116) + chr(102) + chr(1984 - 1939) + chr(56)), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'#\x8e\x17:\xd2\x81\x99'), '\x64' + '\145' + chr(0b10 + 0o141) + '\x6f' + '\144' + '\x65')('\165' + chr(0b1011100 + 0o30) + chr(102) + chr(0b10110 + 0o27) + chr(1511 - 1455)), roI3spqORKae(ES5oEprVxulp(b'<\xe8\t'), chr(0b1100100) + chr(0b1100101) + chr(0b100011 + 0o100) + chr(0b111011 + 0o64) + chr(4120 - 4020) + '\145')(chr(0b1111 + 0o146) + chr(12621 - 12505) + '\x66' + chr(0b111 + 0o46) + chr(0b111000)), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\\\xe7$b\xe3\xa8\xb8ib'), chr(4135 - 4035) + '\145' + '\143' + '\x6f' + chr(0b1000000 + 0o44) + chr(0b1010010 + 0o23))('\165' + chr(0b1110100) + chr(0b1011100 + 0o12) + chr(45) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'C\xe7$b\xe3\xa8\xb8ib['), '\x64' + chr(0b1100101) + chr(0b110111 + 0o54) + chr(0b111 + 0o150) + chr(100) + chr(6101 - 6000))(chr(0b1000000 + 0o65) + '\164' + '\146' + '\055' + chr(56)), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\\\x87h3'), '\144' + chr(0b11110 + 0o107) + '\143' + chr(7187 - 7076) + chr(100) + chr(0b1000001 + 0o44))(chr(117) + chr(0b10101 + 0o137) + chr(0b1001001 + 0o35) + '\x2d' + chr(1068 - 1012)), roI3spqORKae(ES5oEprVxulp(b''), chr(605 - 505) + '\145' + '\143' + '\157' + chr(0b1100100) + '\145')(chr(0b1110101) + '\164' + '\x66' + '\055' + '\x38'), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'\\\x8c\x17C\xba\xe4'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(111) + chr(100) + '\145')(chr(117) + '\x74' + chr(102) + chr(45) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'C\xf8z.'), chr(0b1000011 + 0o41) + chr(0b1010000 + 0o25) + '\x63' + chr(0b1001011 + 0o44) + '\x64' + chr(0b1110 + 0o127))('\x75' + chr(0b11001 + 0o133) + chr(102) + '\055' + '\070'), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'#\x80cK\xbd\xe3\xe0<|_\xee6\xd3\xf6'), '\x64' + chr(2201 - 2100) + chr(0b1100011) + '\x6f' + chr(0b101011 + 0o71) + chr(1435 - 1334))('\165' + '\x74' + chr(0b1110 + 0o130) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b'#\x95'), chr(100) + chr(0b100010 + 0o103) + chr(4521 - 4422) + chr(111) + chr(0b1100100) + '\x65')(chr(0b1001001 + 0o54) + '\164' + '\146' + chr(557 - 512) + chr(56)), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b' \xfd\x14L\xe2\xe6\x87"c:\x884'), chr(100) + '\x65' + '\143' + chr(0b1101110 + 0o1) + chr(0b110100 + 0o60) + chr(101))(chr(0b1110101) + '\164' + chr(0b1011111 + 0o7) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b' \xfe\x14'), '\144' + chr(774 - 673) + chr(1168 - 1069) + chr(0b1101000 + 0o7) + chr(0b1100100) + chr(4048 - 3947))(chr(13373 - 13256) + chr(0b1110100) + chr(0b1100110) + chr(0b1100 + 0o41) + chr(56)), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b' \xfd\x14L\xe2\xe6\x87"\x1f\x16\xf94\xa2\x80'), chr(5209 - 5109) + '\x65' + chr(5163 - 5064) + '\x6f' + '\144' + chr(0b1100101))(chr(0b1101001 + 0o14) + chr(0b111 + 0o155) + chr(772 - 670) + chr(245 - 200) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b' \xfe\x14'), chr(100) + '\145' + chr(6094 - 5995) + chr(0b101 + 0o152) + chr(100) + '\x65')('\x75' + '\x74' + chr(102) + chr(0b10111 + 0o26) + '\x38'), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b' \xfd\x14L\xe2\xe6\x84G\x1c'), '\x64' + chr(101) + chr(0b100010 + 0o101) + chr(111) + chr(100) + chr(101))(chr(117) + '\164' + chr(102) + chr(385 - 340) + chr(0b100000 + 0o30)), roI3spqORKae(ES5oEprVxulp(b' \xfe\x14'), '\144' + '\145' + chr(0b10111 + 0o114) + '\x6f' + chr(0b1100100) + chr(8997 - 8896))('\165' + '\164' + '\x66' + chr(0b101101) + '\x38'), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b' \xfe\x14L\xe2\xe6\x87"'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + '\144' + chr(3679 - 3578))('\x75' + chr(116) + chr(9681 - 9579) + '\x2d' + chr(3044 - 2988)), roI3spqORKae(ES5oEprVxulp(b' \xfe\x14'), chr(0b101 + 0o137) + chr(101) + chr(99) + chr(0b1001110 + 0o41) + chr(100) + chr(0b1100101))(chr(10100 - 9983) + chr(0b1110100) + chr(0b1100101 + 0o1) + chr(45) + chr(0b111000)), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'!\xf88;\xb9\x91\x886jM\xfcA\xd1\x831U\xfdg\x9b\xbf7!\x1c\xe4\x7f\x1a\xa3\xd1\xe0\x8c]F\x05_m\xb5Y\x1fd\xf3U\x8do'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(5071 - 4960) + chr(8955 - 8855) + chr(101))(chr(0b10001 + 0o144) + chr(0b1110100) + chr(0b1100110) + chr(0b1101 + 0o40) + chr(56)), roI3spqORKae(ES5oEprVxulp(b"_\x84k0\xb3\x91\xeaAqG\xf2'\xa4\xec:!\x95\x14\xec\xa3K\x0e\x00"), '\x64' + chr(101) + chr(0b1100011) + '\157' + '\x64' + '\145')(chr(13156 - 13039) + chr(0b1110100) + '\x66' + '\055' + '\070'), ffiOpFBWGmZU)
ffiOpFBWGmZU = aoTc4YA2bs2R._zPndKq6xMgp(roI3spqORKae(ES5oEprVxulp(b'!\xf88;\xb9\x91\x886jM\xfcA\xd1\x83iV\x8e\x1b\xef\xbe7\x01\x1f\x94pm\xa5\xa7\x9a\x8a-N\x03[n\xb8'), '\x64' + '\145' + '\143' + '\157' + '\144' + '\145')(chr(0b1010100 + 0o41) + chr(4727 - 4611) + chr(0b1011101 + 0o11) + chr(45) + '\070'), roI3spqORKae(ES5oEprVxulp(b'_\x84k0\xb3\x91\xeaAqG\xf27\xcb\xffFI\x81h\x85'), chr(8340 - 8240) + chr(6442 - 6341) + chr(3146 - 3047) + '\157' + chr(100) + chr(101))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(45) + '\070'), ffiOpFBWGmZU)
ZOwnRpAlM0Jv[ZlbFMSG8gCoF] = ffiOpFBWGmZU
ZlbFMSG8gCoF += nzTpIcepk0o8(chr(1868 - 1820) + chr(111) + '\x31', ord("\x08"))
return ZOwnRpAlM0Jv
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
SyntaxPreprocessing.process_vm_json
|
def process_vm_json( self, json_dict, **kwargs ):
''' Executes the preprocessing pipeline on vabamorf's JSON, given as a dict;
Returns a list: lines of analyses in the VISL CG3 input format;
'''
mrf_lines = convert_vm_json_to_mrf( json_dict )
return self.process_mrf_lines( mrf_lines, **kwargs )
|
python
|
def process_vm_json( self, json_dict, **kwargs ):
''' Executes the preprocessing pipeline on vabamorf's JSON, given as a dict;
Returns a list: lines of analyses in the VISL CG3 input format;
'''
mrf_lines = convert_vm_json_to_mrf( json_dict )
return self.process_mrf_lines( mrf_lines, **kwargs )
|
[
"def",
"process_vm_json",
"(",
"self",
",",
"json_dict",
",",
"*",
"*",
"kwargs",
")",
":",
"mrf_lines",
"=",
"convert_vm_json_to_mrf",
"(",
"json_dict",
")",
"return",
"self",
".",
"process_mrf_lines",
"(",
"mrf_lines",
",",
"*",
"*",
"kwargs",
")"
] |
Executes the preprocessing pipeline on vabamorf's JSON, given as a dict;
Returns a list: lines of analyses in the VISL CG3 input format;
|
[
"Executes",
"the",
"preprocessing",
"pipeline",
"on",
"vabamorf",
"s",
"JSON",
"given",
"as",
"a",
"dict",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L945-L951
|
train
|
Executes the preprocessing pipeline on the JSON given as a dict ; returns a list of lines of analyses in the VISL CG3 input format ;
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT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06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + '\067' + '\060', 0b1000), nzTpIcepk0o8(chr(48) + chr(11944 - 11833) + '\062' + '\062' + chr(0b10010 + 0o44), 43215 - 43207), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(52) + chr(53), 58415 - 58407), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + chr(0b101100 + 0o10) + '\061', 36767 - 36759), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b11110 + 0o121) + chr(0b10 + 0o61) + chr(0b110110) + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b1100 + 0o53) + chr(48), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b101101 + 0o6) + chr(0b110110) + '\066', 0b1000), nzTpIcepk0o8(chr(512 - 464) + '\x6f' + chr(0b110001) + '\x32' + chr(55), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(750 - 699) + chr(48) + chr(1951 - 1901), ord("\x08")), nzTpIcepk0o8(chr(617 - 569) + chr(111) + chr(0b110011) + chr(55) + chr(52), 0b1000), nzTpIcepk0o8(chr(858 - 810) + '\157' + chr(0b11000 + 0o33) + '\060' + chr(0b110010 + 0o0), 8), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(98 - 48) + chr(48) + chr(2331 - 2279), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\066' + chr(982 - 934), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1963 - 1912) + '\x31' + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(399 - 349) + chr(0b110101) + chr(0b0 + 0o65), 0o10), nzTpIcepk0o8('\060' + chr(0b1001111 + 0o40) + '\x31' + chr(99 - 49) + '\061', 18707 - 18699), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x31' + '\x36' + chr(48), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(9472 - 9361) + chr(49) + '\061' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b100 + 0o54) + '\x6f' + chr(50) + chr(51) + chr(2354 - 2300), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + '\x33' + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + '\x32' + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2090 - 2040) + chr(0b110110) + '\x35', 3242 - 3234), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + chr(0b110011) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(871 - 823) + chr(0b1101111) + chr(1565 - 1516) + chr(2559 - 2507) + chr(1970 - 1920), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x34' + chr(0b10001 + 0o44), 8), nzTpIcepk0o8(chr(48) + '\157' + '\061' + chr(2078 - 2029), 36971 - 36963), nzTpIcepk0o8(chr(684 - 636) + '\x6f' + '\x31' + '\060' + chr(990 - 941), 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(49) + chr(2652 - 2599) + chr(0b1101 + 0o46), 2193 - 2185), nzTpIcepk0o8('\060' + chr(11011 - 10900) + chr(0b1110 + 0o43) + chr(0b110111) + chr(512 - 459), 2356 - 2348), nzTpIcepk0o8(chr(0b110000) + chr(5723 - 5612) + chr(0b110001) + chr(0b11000 + 0o36) + '\062', 0o10), nzTpIcepk0o8('\060' + chr(111) + '\x31' + chr(0b11111 + 0o21) + chr(1957 - 1906), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(49) + chr(0b110110) + chr(0b100011 + 0o23), 0b1000), nzTpIcepk0o8(chr(163 - 115) + chr(0b1101100 + 0o3) + chr(0b100101 + 0o14) + chr(0b1010 + 0o50) + chr(0b110001), 8), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1010110 + 0o31) + chr(0b11000 + 0o33) + '\061' + chr(0b101 + 0o61), 0o10), nzTpIcepk0o8(chr(2239 - 2191) + chr(7086 - 6975) + '\061' + '\067' + chr(0b100011 + 0o23), 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + '\157' + '\x33' + '\x32' + chr(0b1111 + 0o50), 0b1000), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b1101111) + '\063' + chr(52) + '\066', 14993 - 14985), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(5975 - 5864) + chr(53) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(12287 - 12176) + '\x32' + chr(0b100101 + 0o17) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2342 - 2293) + '\x36' + chr(0b110110), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b1101 + 0o142) + chr(53) + chr(0b101100 + 0o4), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x16'), chr(100) + '\145' + chr(0b11101 + 0o106) + chr(111) + chr(0b1011011 + 0o11) + chr(5178 - 5077))('\x75' + chr(0b1110100) + chr(8277 - 8175) + '\055' + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def kTqP4TY8j4Qe(hXMPsSrOQzbh, qwEkx3DPq_Ra, **q5n0sHDDTy90):
ZOwnRpAlM0Jv = JWIVqrqiSdLL(qwEkx3DPq_Ra)
return roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'H\xe4J\x82\x96\xcb\x85\x08\xaf\x8e\xa4\xdb\\\xa4\xc34\x03'), chr(0b1011000 + 0o14) + chr(101) + chr(0b1000001 + 0o42) + chr(0b11001 + 0o126) + chr(8387 - 8287) + chr(0b1100101))(chr(11639 - 11522) + '\x74' + '\146' + chr(0b10 + 0o53) + '\070'))(ZOwnRpAlM0Jv, **q5n0sHDDTy90)
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
SyntaxPreprocessing.process_Text
|
def process_Text( self, text, **kwargs ):
''' Executes the preprocessing pipeline on estnltk's Text object.
Returns a list: lines of analyses in the VISL CG3 input format;
'''
mrf_lines = convert_Text_to_mrf( text )
return self.process_mrf_lines( mrf_lines, **kwargs )
|
python
|
def process_Text( self, text, **kwargs ):
''' Executes the preprocessing pipeline on estnltk's Text object.
Returns a list: lines of analyses in the VISL CG3 input format;
'''
mrf_lines = convert_Text_to_mrf( text )
return self.process_mrf_lines( mrf_lines, **kwargs )
|
[
"def",
"process_Text",
"(",
"self",
",",
"text",
",",
"*",
"*",
"kwargs",
")",
":",
"mrf_lines",
"=",
"convert_Text_to_mrf",
"(",
"text",
")",
"return",
"self",
".",
"process_mrf_lines",
"(",
"mrf_lines",
",",
"*",
"*",
"kwargs",
")"
] |
Executes the preprocessing pipeline on estnltk's Text object.
Returns a list: lines of analyses in the VISL CG3 input format;
|
[
"Executes",
"the",
"preprocessing",
"pipeline",
"on",
"estnltk",
"s",
"Text",
"object",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L954-L960
|
train
|
Executes the preprocessing pipeline on the estnltk s Text object.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jf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ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(0b1101111) + chr(0b110100) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(377 - 329) + chr(0b1101111) + '\063' + chr(1903 - 1849) + '\065', 0o10), nzTpIcepk0o8(chr(1887 - 1839) + chr(0b1101010 + 0o5) + chr(0b10010 + 0o40) + '\x30' + chr(1541 - 1489), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b101000 + 0o107) + chr(51) + '\x34' + '\063', 52524 - 52516), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + chr(0b110101 + 0o0) + chr(0b11100 + 0o33), 0o10), nzTpIcepk0o8('\060' + chr(7275 - 7164) + chr(50) + chr(0b110010) + chr(0b11111 + 0o30), 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\x6f' + '\x36' + chr(0b10001 + 0o42), 30260 - 30252), nzTpIcepk0o8(chr(0b11 + 0o55) + '\x6f' + chr(0b10011 + 0o36) + chr(915 - 867) + chr(2240 - 2189), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b11010 + 0o30) + '\061' + '\064', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51) + '\061' + chr(2808 - 2753), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b11 + 0o154) + '\061' + chr(0b101101 + 0o4) + chr(298 - 249), 0o10), nzTpIcepk0o8(chr(2025 - 1977) + '\x6f' + '\x31' + chr(818 - 770) + chr(0b110011 + 0o4), ord("\x08")), nzTpIcepk0o8(chr(1295 - 1247) + chr(111) + chr(0b1110 + 0o43) + chr(51) + chr(0b11010 + 0o26), 25245 - 25237), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + '\x36' + chr(50), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110010) + '\x34' + chr(2110 - 2059), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1011100 + 0o23) + chr(1690 - 1640) + '\065' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1011111 + 0o20) + chr(0b110010) + chr(50) + '\x31', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + '\x32' + chr(0b100010 + 0o21), 0o10), nzTpIcepk0o8(chr(2060 - 2012) + chr(2834 - 2723) + chr(934 - 883) + chr(54) + chr(55), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(55) + chr(1284 - 1232), 0o10), nzTpIcepk0o8(chr(1133 - 1085) + chr(111) + chr(0b110010) + chr(54) + chr(0b10100 + 0o37), 493 - 485), nzTpIcepk0o8(chr(48) + chr(583 - 472) + '\065' + '\x31', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b11000 + 0o127) + chr(51) + chr(0b11 + 0o64) + chr(0b1001 + 0o55), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\x33' + chr(1892 - 1841) + chr(1048 - 997), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(11975 - 11864) + chr(0b11100 + 0o27) + chr(0b100100 + 0o23), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(9054 - 8943) + chr(574 - 524) + chr(50) + '\064', ord("\x08")), nzTpIcepk0o8(chr(2292 - 2244) + '\x6f' + chr(0b10010 + 0o41) + '\067' + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(52) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b101101 + 0o11) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110111) + '\x30', 58302 - 58294), nzTpIcepk0o8('\x30' + chr(1346 - 1235) + chr(0b110110) + chr(0b110111), 8), nzTpIcepk0o8('\060' + chr(10542 - 10431) + '\x31' + chr(48) + chr(0b10011 + 0o42), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + '\061' + chr(54), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + '\066' + chr(0b101010 + 0o12), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101101 + 0o2) + '\062' + chr(256 - 203) + '\x30', ord("\x08")), nzTpIcepk0o8(chr(581 - 533) + chr(0b1101111) + chr(0b110001) + chr(0b1100 + 0o53) + '\062', 0b1000), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b1101111) + '\x32' + chr(55) + '\064', ord("\x08")), nzTpIcepk0o8(chr(1860 - 1812) + chr(0b1101111) + chr(1384 - 1335) + chr(0b110010) + chr(0b101010 + 0o14), 14785 - 14777), nzTpIcepk0o8(chr(87 - 39) + chr(111) + '\x34' + '\x34', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b1100 + 0o51) + '\x30', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x0b'), chr(100) + chr(0b1000011 + 0o42) + chr(323 - 224) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(11581 - 11464) + chr(4276 - 4160) + '\146' + chr(745 - 700) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def qouDV7Jz1baB(hXMPsSrOQzbh, cpStk7cY1TJd, **q5n0sHDDTy90):
ZOwnRpAlM0Jv = xQLLh3X5MXnv(cpStk7cY1TJd)
return roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'U\x87\xeb\x80\n\xe4@\x1c\xe1\xbd/\x184\x9b\xcd\xcc\xe2'), chr(0b1100100) + '\x65' + chr(5949 - 5850) + chr(9218 - 9107) + chr(100) + chr(4481 - 4380))(chr(0b1100111 + 0o16) + '\x74' + '\x66' + chr(836 - 791) + '\x38'))(ZOwnRpAlM0Jv, **q5n0sHDDTy90)
|
estnltk/estnltk
|
estnltk/syntax/syntax_preprocessing.py
|
SyntaxPreprocessing.process_mrf_lines
|
def process_mrf_lines( self, mrf_lines, **kwargs ):
''' Executes the preprocessing pipeline on mrf_lines.
The input should be an analysis of the text in Filosoft's old mrf format;
Returns the input list, where elements (tokens/analyses) have been converted
into the new format;
'''
converted1 = convert_mrf_to_syntax_mrf( mrf_lines, self.fs_to_synt_rules )
converted2 = convert_pronouns( converted1 )
converted3 = remove_duplicate_analyses( converted2, allow_to_delete_all=self.allow_to_remove_all )
converted4 = add_hashtag_info( converted3 )
converted5 = tag_subcat_info( converted4, self.subcat_rules )
converted6 = remove_duplicate_analyses( converted5, allow_to_delete_all=self.allow_to_remove_all )
converted7 = convert_to_cg3_input( converted6 )
return converted7
|
python
|
def process_mrf_lines( self, mrf_lines, **kwargs ):
''' Executes the preprocessing pipeline on mrf_lines.
The input should be an analysis of the text in Filosoft's old mrf format;
Returns the input list, where elements (tokens/analyses) have been converted
into the new format;
'''
converted1 = convert_mrf_to_syntax_mrf( mrf_lines, self.fs_to_synt_rules )
converted2 = convert_pronouns( converted1 )
converted3 = remove_duplicate_analyses( converted2, allow_to_delete_all=self.allow_to_remove_all )
converted4 = add_hashtag_info( converted3 )
converted5 = tag_subcat_info( converted4, self.subcat_rules )
converted6 = remove_duplicate_analyses( converted5, allow_to_delete_all=self.allow_to_remove_all )
converted7 = convert_to_cg3_input( converted6 )
return converted7
|
[
"def",
"process_mrf_lines",
"(",
"self",
",",
"mrf_lines",
",",
"*",
"*",
"kwargs",
")",
":",
"converted1",
"=",
"convert_mrf_to_syntax_mrf",
"(",
"mrf_lines",
",",
"self",
".",
"fs_to_synt_rules",
")",
"converted2",
"=",
"convert_pronouns",
"(",
"converted1",
")",
"converted3",
"=",
"remove_duplicate_analyses",
"(",
"converted2",
",",
"allow_to_delete_all",
"=",
"self",
".",
"allow_to_remove_all",
")",
"converted4",
"=",
"add_hashtag_info",
"(",
"converted3",
")",
"converted5",
"=",
"tag_subcat_info",
"(",
"converted4",
",",
"self",
".",
"subcat_rules",
")",
"converted6",
"=",
"remove_duplicate_analyses",
"(",
"converted5",
",",
"allow_to_delete_all",
"=",
"self",
".",
"allow_to_remove_all",
")",
"converted7",
"=",
"convert_to_cg3_input",
"(",
"converted6",
")",
"return",
"converted7"
] |
Executes the preprocessing pipeline on mrf_lines.
The input should be an analysis of the text in Filosoft's old mrf format;
Returns the input list, where elements (tokens/analyses) have been converted
into the new format;
|
[
"Executes",
"the",
"preprocessing",
"pipeline",
"on",
"mrf_lines",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/syntax_preprocessing.py#L963-L978
|
train
|
Executes the preprocessing pipeline on mrf_lines.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYH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uc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(4832 - 4721) + '\061' + chr(48) + chr(0b110011), 27593 - 27585), nzTpIcepk0o8('\060' + chr(0b1110 + 0o141) + chr(0b10101 + 0o35) + chr(0b10101 + 0o34) + '\067', 25050 - 25042), nzTpIcepk0o8(chr(349 - 301) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + chr(52), 64283 - 64275), nzTpIcepk0o8('\x30' + '\157' + chr(49) + '\060' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(2217 - 2169) + chr(8205 - 8094) + chr(1662 - 1612) + chr(1262 - 1209) + chr(0b11110 + 0o27), 0o10), nzTpIcepk0o8(chr(254 - 206) + chr(111) + chr(0b110 + 0o56) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(2631 - 2520) + '\062' + chr(2327 - 2273) + chr(48), ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(0b11011 + 0o27) + '\x30' + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(1716 - 1668) + chr(0b1101111) + chr(52) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(1519 - 1471) + chr(111) + chr(0b110010) + chr(1179 - 1130) + chr(0b110110), 33936 - 33928), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(0b110 + 0o60) + chr(889 - 840), 31884 - 31876), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(0b1011000 + 0o27) + chr(0b11 + 0o57) + chr(0b0 + 0o65) + chr(0b110111), 0b1000), nzTpIcepk0o8('\060' + chr(6137 - 6026) + chr(0b110 + 0o54) + chr(0b110011) + '\x30', 9723 - 9715), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + '\067' + chr(0b100011 + 0o22), 0b1000), nzTpIcepk0o8('\x30' + chr(0b11110 + 0o121) + '\061' + chr(55) + chr(0b10111 + 0o34), 20635 - 20627), nzTpIcepk0o8('\x30' + chr(0b1011010 + 0o25) + chr(0b110011) + '\x33' + '\x31', 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b10100 + 0o42) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b1101111) + '\064' + '\060', 8), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + '\064' + chr(48), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(49) + chr(0b110111) + '\067', 3640 - 3632), nzTpIcepk0o8('\x30' + chr(1550 - 1439) + chr(792 - 743) + chr(0b110111) + chr(851 - 800), 8), nzTpIcepk0o8('\060' + chr(111) + chr(1920 - 1871) + chr(0b110100) + chr(0b1100 + 0o47), 31998 - 31990), nzTpIcepk0o8(chr(1120 - 1072) + chr(111) + chr(0b1000 + 0o53) + '\066' + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(1881 - 1833) + '\x6f' + '\061' + '\066' + chr(0b1010 + 0o47), 54415 - 54407), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(2786 - 2675) + chr(0b1000 + 0o53) + '\x33' + chr(0b10 + 0o56), 0b1000), nzTpIcepk0o8(chr(329 - 281) + chr(0b1000110 + 0o51) + '\063' + '\x31' + chr(0b100000 + 0o26), 0b1000), nzTpIcepk0o8(chr(1454 - 1406) + chr(111) + chr(538 - 488) + chr(0b101 + 0o61) + chr(54), 0o10), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\x6f' + '\062' + chr(0b110010) + chr(0b110100), 63400 - 63392), nzTpIcepk0o8(chr(1089 - 1041) + chr(2197 - 2086) + chr(0b100101 + 0o14) + chr(0b1000 + 0o50) + chr(1283 - 1234), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(2232 - 2183) + '\x31' + '\064', 1179 - 1171), nzTpIcepk0o8(chr(48) + chr(111) + chr(2124 - 2073) + chr(0b10111 + 0o31) + '\x34', 0o10), nzTpIcepk0o8(chr(1790 - 1742) + chr(0b1011001 + 0o26) + '\x33' + '\x35' + '\x33', 0b1000), nzTpIcepk0o8(chr(150 - 102) + chr(0b1101111) + chr(0b100011 + 0o17) + chr(0b100001 + 0o22) + chr(0b110011), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + chr(0b10100 + 0o36) + chr(0b110011), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(2408 - 2356) + chr(1664 - 1611), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1100110 + 0o11) + '\061' + '\060' + chr(55), 8), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(0b110 + 0o53) + chr(0b110011), 0o10), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(51) + chr(55), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b100110 + 0o13) + chr(2088 - 2034) + chr(0b10100 + 0o34), 0b1000), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(111) + chr(0b110010) + chr(53) + chr(0b110 + 0o53), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b10 + 0o56) + '\157' + '\x35' + chr(0b11000 + 0o30), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'm'), chr(100) + chr(101) + chr(0b1100011) + chr(545 - 434) + chr(0b1100100) + chr(0b1100101))('\165' + chr(12015 - 11899) + chr(0b10111 + 0o117) + chr(45) + chr(0b100111 + 0o21)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Y6U7jzrpO9A_(hXMPsSrOQzbh, ZOwnRpAlM0Jv, **q5n0sHDDTy90):
EcdMFEs17wKX = qQyUzg5TKmNB(ZOwnRpAlM0Jv, hXMPsSrOQzbh.fs_to_synt_rules)
qh8pn3FBN_YG = YD8fEtW3ZEcS(EcdMFEs17wKX)
SKH2OCzLI7Ya = TGKFpANNPAvo(qh8pn3FBN_YG, allow_to_delete_all=hXMPsSrOQzbh.allow_to_remove_all)
Zjv5ZO1TURDi = GwoaRUR0yyOg(SKH2OCzLI7Ya)
F2Sgt5hkLUx3 = XbW2hn3XaHej(Zjv5ZO1TURDi, hXMPsSrOQzbh.subcat_rules)
hy_Jgt7ak_AC = TGKFpANNPAvo(F2Sgt5hkLUx3, allow_to_delete_all=hXMPsSrOQzbh.allow_to_remove_all)
pRErYB36bhPi = HJIVWw7mJxyL(hy_Jgt7ak_AC)
return pRErYB36bhPi
|
estnltk/estnltk
|
setup.py
|
get_sources
|
def get_sources(src_dir='src', ending='.cpp'):
"""Function to get a list of files ending with `ending` in `src_dir`."""
return [os.path.join(src_dir, fnm) for fnm in os.listdir(src_dir) if fnm.endswith(ending)]
|
python
|
def get_sources(src_dir='src', ending='.cpp'):
"""Function to get a list of files ending with `ending` in `src_dir`."""
return [os.path.join(src_dir, fnm) for fnm in os.listdir(src_dir) if fnm.endswith(ending)]
|
[
"def",
"get_sources",
"(",
"src_dir",
"=",
"'src'",
",",
"ending",
"=",
"'.cpp'",
")",
":",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"src_dir",
",",
"fnm",
")",
"for",
"fnm",
"in",
"os",
".",
"listdir",
"(",
"src_dir",
")",
"if",
"fnm",
".",
"endswith",
"(",
"ending",
")",
"]"
] |
Function to get a list of files ending with `ending` in `src_dir`.
|
[
"Function",
"to",
"get",
"a",
"list",
"of",
"files",
"ending",
"with",
"ending",
"in",
"src_dir",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/setup.py#L14-L16
|
train
|
Function to get a list of files ending with ending in src_dir.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9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0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(5557 - 5446) + chr(50) + chr(0b110111) + chr(52), 58382 - 58374), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b11101 + 0o24) + chr(55) + chr(1415 - 1367), 6909 - 6901), nzTpIcepk0o8(chr(1583 - 1535) + '\157' + chr(49) + chr(419 - 365) + '\067', 49993 - 49985), nzTpIcepk0o8(chr(104 - 56) + '\x6f' + '\x31' + chr(119 - 65) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + '\066' + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(2238 - 2190) + chr(111) + chr(0b11011 + 0o26) + '\062' + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(323 - 275) + chr(0b1101111) + chr(0b10111 + 0o32) + chr(0b110011) + chr(50), 12087 - 12079), nzTpIcepk0o8('\060' + chr(111) + '\063' + chr(0b110001) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b10110 + 0o32) + chr(111) + '\063' + '\x31' + chr(49), 8), nzTpIcepk0o8('\060' + chr(0b1101110 + 0o1) + chr(0b110001) + chr(49) + chr(0b110011), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(51) + '\064' + chr(1770 - 1722), 0o10), nzTpIcepk0o8(chr(0b10101 + 0o33) + '\x6f' + chr(0b110011) + chr(0b100100 + 0o14) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\063' + chr(50) + chr(48), 50333 - 50325), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b100010 + 0o22) + '\061', 0o10), nzTpIcepk0o8('\060' + chr(4205 - 4094) + chr(0b110011) + '\060' + chr(1551 - 1498), 0b1000), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(111) + chr(513 - 461) + chr(0b101011 + 0o6), ord("\x08")), nzTpIcepk0o8(chr(2098 - 2050) + chr(111) + '\x31' + chr(55) + chr(2188 - 2138), 9573 - 9565), nzTpIcepk0o8(chr(48) + chr(0b1011 + 0o144) + chr(0b110011) + chr(0b10101 + 0o33), ord("\x08")), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b1000010 + 0o55) + chr(0b110001) + '\064' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b111 + 0o51) + '\157' + chr(0b11011 + 0o27) + chr(1539 - 1487), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1000000 + 0o57) + '\x33' + chr(0b110000) + chr(0b1000 + 0o53), 8), nzTpIcepk0o8('\060' + chr(111) + '\x33' + chr(0b110111) + chr(48), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(0b110101) + '\x31', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101010 + 0o5) + chr(51) + chr(1936 - 1882) + chr(0b110110 + 0o0), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(3915 - 3804) + chr(49) + chr(0b110111) + '\064', 0o10), nzTpIcepk0o8('\x30' + chr(7743 - 7632) + chr(51) + chr(0b110001) + '\x37', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(1213 - 1161), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + '\x35' + chr(2245 - 2197), 0o10), nzTpIcepk0o8('\x30' + chr(0b1100111 + 0o10) + chr(0b110101) + chr(0b1111 + 0o42), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b101010 + 0o7) + chr(53) + chr(0b110 + 0o53), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x33' + chr(0b110101) + chr(1446 - 1397), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b10001 + 0o41) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b1110 + 0o42) + '\157' + chr(902 - 853) + chr(0b110100) + '\x34', 42391 - 42383), nzTpIcepk0o8(chr(48) + chr(4171 - 4060) + '\061' + chr(51) + chr(0b110 + 0o53), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b11011 + 0o26) + chr(1728 - 1679) + '\x30', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(51) + '\064', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b100110 + 0o111) + chr(1851 - 1802) + chr(2285 - 2236) + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(0b1011 + 0o54) + chr(0b110111), 0o10), nzTpIcepk0o8('\x30' + chr(8180 - 8069) + '\061' + '\x30' + '\060', 60508 - 60500), nzTpIcepk0o8('\060' + chr(5666 - 5555) + chr(49) + '\x37' + chr(1048 - 994), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + '\157' + '\x35' + chr(2275 - 2227), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x92'), chr(100) + chr(0b1100101) + chr(6283 - 6184) + '\x6f' + chr(7001 - 6901) + '\x65')(chr(0b11 + 0o162) + '\x74' + chr(102) + chr(1653 - 1608) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def ewPx5FwQWlNp(zgBFj9gT640a=roI3spqORKae(ES5oEprVxulp(b'\xcf\n\x14'), chr(0b1100100) + chr(0b1010101 + 0o20) + '\143' + chr(0b101100 + 0o103) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(12712 - 12596) + '\146' + chr(45) + chr(56)), gGWNbYJDKZ1z=roI3spqORKae(ES5oEprVxulp(b'\x92\x1b\x07\x01'), '\x64' + '\145' + chr(0b1101 + 0o126) + chr(0b1101111) + '\x64' + chr(602 - 501))(chr(9035 - 8918) + chr(0b1110100) + chr(0b11011 + 0o113) + '\x2d' + chr(0b101010 + 0o16))):
return [roI3spqORKae(aHUqKstZLeS6.path, roI3spqORKae(ES5oEprVxulp(b'\xe5L\x0e<\x8d\x139\xaf\x9d\x08\xae\xb2'), '\144' + chr(0b1100101) + chr(0b1000111 + 0o34) + '\157' + '\144' + chr(101))(chr(0b110101 + 0o100) + chr(1279 - 1163) + '\146' + chr(45) + chr(0b111000)))(zgBFj9gT640a, bTRPjBR7GViM) for bTRPjBR7GViM in roI3spqORKae(aHUqKstZLeS6, roI3spqORKae(ES5oEprVxulp(b'\xd0\x11\x04\x05\xd08('), chr(100) + '\x65' + chr(99) + chr(0b1101111) + chr(0b110011 + 0o61) + '\145')('\165' + chr(0b1110100) + chr(0b110100 + 0o62) + '\055' + chr(0b111000)))(zgBFj9gT640a) if roI3spqORKae(bTRPjBR7GViM, roI3spqORKae(ES5oEprVxulp(b'\xf5A\x11:\xfd\x12\x1b\x85\xa8>\xaa\xb1'), chr(100) + '\x65' + '\143' + '\157' + chr(100) + chr(0b10001 + 0o124))(chr(117) + chr(0b1110100) + '\x66' + chr(721 - 676) + chr(0b111000)))(gGWNbYJDKZ1z)]
|
estnltk/estnltk
|
estnltk/prettyprinter/terminalprettyprinter.py
|
_get_ANSI_colored_font
|
def _get_ANSI_colored_font( color ):
''' Returns an ANSI escape code (a string) corresponding to switching the font
to given color, or None, if the given color could not be associated with
the available colors.
See also:
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
'''
color = (color.replace('-','')).lower()
#
# Bright colors:
#
if color == 'white':
return '\033[97m'
elif color in ['cyan', 'aqua']:
return '\033[96m'
elif color in ['purple', 'magneta', 'fuchsia']:
return '\033[95m'
elif color == 'blue':
return '\033[94m'
elif color in ['yellow', 'gold']:
return '\033[93m'
elif color in ['green', 'lime']:
return '\033[92m'
elif color == 'red':
return '\033[91m'
#
# Dark colors:
#
elif color in ['grey', 'gray', 'silver']:
return '\033[37m'
elif color in ['darkcyan', 'teal']:
return '\033[36m'
elif color in ['darkpurple', 'darkmagneta']:
return '\033[35m'
elif color in ['darkblue', 'navy']:
return '\033[34m'
elif color in ['darkyellow', 'olive']:
return '\033[33m'
elif color == 'darkgreen':
return '\033[32m'
elif color in ['darkred', 'maroon']:
return '\033[31m'
return None
|
python
|
def _get_ANSI_colored_font( color ):
''' Returns an ANSI escape code (a string) corresponding to switching the font
to given color, or None, if the given color could not be associated with
the available colors.
See also:
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
'''
color = (color.replace('-','')).lower()
#
# Bright colors:
#
if color == 'white':
return '\033[97m'
elif color in ['cyan', 'aqua']:
return '\033[96m'
elif color in ['purple', 'magneta', 'fuchsia']:
return '\033[95m'
elif color == 'blue':
return '\033[94m'
elif color in ['yellow', 'gold']:
return '\033[93m'
elif color in ['green', 'lime']:
return '\033[92m'
elif color == 'red':
return '\033[91m'
#
# Dark colors:
#
elif color in ['grey', 'gray', 'silver']:
return '\033[37m'
elif color in ['darkcyan', 'teal']:
return '\033[36m'
elif color in ['darkpurple', 'darkmagneta']:
return '\033[35m'
elif color in ['darkblue', 'navy']:
return '\033[34m'
elif color in ['darkyellow', 'olive']:
return '\033[33m'
elif color == 'darkgreen':
return '\033[32m'
elif color in ['darkred', 'maroon']:
return '\033[31m'
return None
|
[
"def",
"_get_ANSI_colored_font",
"(",
"color",
")",
":",
"color",
"=",
"(",
"color",
".",
"replace",
"(",
"'-'",
",",
"''",
")",
")",
".",
"lower",
"(",
")",
"#\r",
"# Bright colors:\r",
"#\r",
"if",
"color",
"==",
"'white'",
":",
"return",
"'\\033[97m'",
"elif",
"color",
"in",
"[",
"'cyan'",
",",
"'aqua'",
"]",
":",
"return",
"'\\033[96m'",
"elif",
"color",
"in",
"[",
"'purple'",
",",
"'magneta'",
",",
"'fuchsia'",
"]",
":",
"return",
"'\\033[95m'",
"elif",
"color",
"==",
"'blue'",
":",
"return",
"'\\033[94m'",
"elif",
"color",
"in",
"[",
"'yellow'",
",",
"'gold'",
"]",
":",
"return",
"'\\033[93m'",
"elif",
"color",
"in",
"[",
"'green'",
",",
"'lime'",
"]",
":",
"return",
"'\\033[92m'",
"elif",
"color",
"==",
"'red'",
":",
"return",
"'\\033[91m'",
"#\r",
"# Dark colors:\r",
"#\r",
"elif",
"color",
"in",
"[",
"'grey'",
",",
"'gray'",
",",
"'silver'",
"]",
":",
"return",
"'\\033[37m'",
"elif",
"color",
"in",
"[",
"'darkcyan'",
",",
"'teal'",
"]",
":",
"return",
"'\\033[36m'",
"elif",
"color",
"in",
"[",
"'darkpurple'",
",",
"'darkmagneta'",
"]",
":",
"return",
"'\\033[35m'",
"elif",
"color",
"in",
"[",
"'darkblue'",
",",
"'navy'",
"]",
":",
"return",
"'\\033[34m'",
"elif",
"color",
"in",
"[",
"'darkyellow'",
",",
"'olive'",
"]",
":",
"return",
"'\\033[33m'",
"elif",
"color",
"==",
"'darkgreen'",
":",
"return",
"'\\033[32m'",
"elif",
"color",
"in",
"[",
"'darkred'",
",",
"'maroon'",
"]",
":",
"return",
"'\\033[31m'",
"return",
"None"
] |
Returns an ANSI escape code (a string) corresponding to switching the font
to given color, or None, if the given color could not be associated with
the available colors.
See also:
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
|
[
"Returns",
"an",
"ANSI",
"escape",
"code",
"(",
"a",
"string",
")",
"corresponding",
"to",
"switching",
"the",
"font",
"to",
"given",
"color",
"or",
"None",
"if",
"the",
"given",
"color",
"could",
"not",
"be",
"associated",
"with",
"the",
"available",
"colors",
".",
"See",
"also",
":",
"https",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"ANSI_escape_code#Colors",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"287871",
"/",
"print",
"-",
"in",
"-",
"terminal",
"-",
"with",
"-",
"colors",
"-",
"using",
"-",
"python"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/terminalprettyprinter.py#L34-L78
|
train
|
Returns ANSI escape code corresponding to switching the font
to given color.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n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,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(9005 - 8894) + chr(1637 - 1588) + '\067' + '\x36', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + '\067' + '\065', 0b1000), nzTpIcepk0o8(chr(598 - 550) + chr(111) + chr(207 - 157) + chr(0b110011 + 0o1) + chr(53), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101001 + 0o6) + chr(0b100001 + 0o25) + '\062', 39291 - 39283), nzTpIcepk0o8(chr(459 - 411) + chr(111) + '\062' + '\063' + chr(2391 - 2338), 0b1000), nzTpIcepk0o8(chr(120 - 72) + '\x6f' + chr(2486 - 2436) + chr(55) + '\067', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + '\x34' + chr(0b1111 + 0o50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + '\x30' + chr(0b110100), 35575 - 35567), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(1780 - 1730) + chr(0b110100) + chr(1648 - 1598), 40979 - 40971), nzTpIcepk0o8(chr(0b110000) + chr(0b100111 + 0o110) + '\062' + chr(0b110010) + '\065', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + chr(53) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(11827 - 11716) + chr(2282 - 2231) + '\062' + chr(0b1001 + 0o51), 2011 - 2003), nzTpIcepk0o8('\x30' + chr(111) + chr(49), 0o10), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\x6f' + chr(0b0 + 0o62) + '\065' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(2675 - 2623) + '\x33', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + '\x34' + chr(54), 0o10), nzTpIcepk0o8(chr(2154 - 2106) + '\157' + chr(0b10000 + 0o42) + chr(0b10111 + 0o37) + '\062', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101110 + 0o1) + '\x32' + chr(0b110110), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1010110 + 0o31) + '\x31' + '\060' + '\060', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + chr(51) + chr(0b11100 + 0o33), 0b1000), nzTpIcepk0o8(chr(0b10 + 0o56) + chr(0b1101111) + chr(0b110011) + chr(0b110001) + chr(2037 - 1982), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(6850 - 6739) + '\x32' + '\x36' + chr(0b10001 + 0o37), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(1963 - 1852) + '\061' + '\x30' + chr(48), 8), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b111011 + 0o64) + '\061' + chr(0b110010) + chr(0b100000 + 0o27), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1011100 + 0o23) + chr(0b110001) + '\065' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(0b110111) + chr(49), 17407 - 17399), nzTpIcepk0o8(chr(269 - 221) + chr(0b1101111) + chr(0b110011) + '\x33' + chr(1068 - 1019), 0b1000), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1010001 + 0o36) + chr(537 - 487) + chr(0b110100) + '\062', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b11101 + 0o122) + '\061' + chr(640 - 586) + chr(0b101111 + 0o4), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\063' + '\x33' + chr(50), 61890 - 61882), nzTpIcepk0o8(chr(0b110000) + chr(0b1010110 + 0o31) + '\x33' + chr(51) + chr(0b10111 + 0o40), 10182 - 10174), nzTpIcepk0o8('\x30' + chr(111) + chr(0b10111 + 0o37) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(1489 - 1441) + '\x6f' + chr(469 - 420) + '\066' + chr(0b110001), 0b1000), nzTpIcepk0o8('\x30' + chr(0b100101 + 0o112) + chr(0b110010) + chr(0b10000 + 0o42) + chr(51), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(1120 - 1071) + chr(52) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(2092 - 2044) + chr(0b1101111) + chr(0b110011) + chr(0b110000 + 0o6) + chr(0b11010 + 0o35), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + '\063' + chr(55), 8), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100011 + 0o20) + '\064' + chr(0b110010), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + chr(2193 - 2142) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(9918 - 9807) + '\062' + chr(0b101110 + 0o3) + '\x36', 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(12175 - 12064) + chr(0b11011 + 0o32) + chr(0b110000), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'P'), chr(385 - 285) + chr(3189 - 3088) + chr(0b1011101 + 0o6) + chr(0b1101111) + chr(100) + chr(101))('\165' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b0 + 0o70)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def s2a6wcBNGAp1(s93qyRHd7l1y):
s93qyRHd7l1y = s93qyRHd7l1y.replace(roI3spqORKae(ES5oEprVxulp(b'S'), chr(0b1100100) + '\145' + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))(chr(0b1000000 + 0o65) + chr(116) + '\146' + chr(45) + '\070'), roI3spqORKae(ES5oEprVxulp(b''), '\144' + chr(0b1011111 + 0o6) + '\x63' + '\x6f' + chr(7863 - 7763) + chr(0b1101 + 0o130))(chr(117) + chr(8446 - 8330) + chr(102) + chr(0b101101) + chr(56))).Xn8ENWMZdIRt()
if s93qyRHd7l1y == roI3spqORKae(ES5oEprVxulp(b'\t\x15\xccF\xf8'), '\144' + chr(0b1000001 + 0o44) + chr(0b111010 + 0o51) + chr(0b1010001 + 0o36) + chr(100) + chr(0b1100101))(chr(0b10110 + 0o137) + '\164' + chr(2876 - 2774) + chr(0b101101) + '\070'):
return roI3spqORKae(ES5oEprVxulp(b'e&\x9c\x05\xf0'), '\x64' + chr(8490 - 8389) + '\143' + '\157' + chr(100) + chr(10114 - 10013))(chr(0b1110101) + chr(116) + '\146' + chr(0b101101) + chr(2064 - 2008))
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x1d\x04\xc4\\'), chr(0b1001101 + 0o27) + '\x65' + chr(99) + '\157' + chr(0b10110 + 0o116) + chr(1081 - 980))(chr(0b1110101) + '\164' + chr(8148 - 8046) + '\055' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\x1f\x0c\xd0S'), chr(3384 - 3284) + chr(0b101011 + 0o72) + chr(1596 - 1497) + '\x6f' + chr(100) + chr(101))('\x75' + chr(4775 - 4659) + chr(102) + chr(0b101101) + chr(0b111000))]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x9c\x04\xf0'), chr(100) + chr(0b111110 + 0o47) + chr(0b11111 + 0o104) + chr(0b11100 + 0o123) + '\144' + chr(0b10010 + 0o123))(chr(0b1011001 + 0o34) + chr(0b1100011 + 0o21) + '\146' + chr(45) + chr(56))
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x0e\x08\xd7B\xf1\xda'), '\144' + '\145' + chr(99) + chr(111) + chr(100) + chr(7031 - 6930))(chr(10784 - 10667) + '\x74' + '\x66' + chr(45) + chr(0b100 + 0o64)), roI3spqORKae(ES5oEprVxulp(b'\x13\x1c\xc2\\\xf8\xcbF'), chr(4957 - 4857) + '\x65' + chr(0b1010110 + 0o15) + '\157' + chr(841 - 741) + chr(7281 - 7180))(chr(117) + chr(0b1110100) + chr(7025 - 6923) + chr(185 - 140) + '\070'), roI3spqORKae(ES5oEprVxulp(b'\x18\x08\xc6Z\xee\xd6F'), chr(0b1001000 + 0o34) + chr(101) + chr(99) + '\157' + chr(8502 - 8402) + '\145')(chr(117) + '\x74' + chr(0b1100110) + chr(0b1110 + 0o37) + chr(0b111000 + 0o0))]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x9c\x07\xf0'), chr(0b1100100) + '\x65' + chr(6655 - 6556) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b100001 + 0o123) + chr(0b1101 + 0o131) + chr(1483 - 1438) + chr(2733 - 2677))
elif s93qyRHd7l1y == roI3spqORKae(ES5oEprVxulp(b'\x1c\x11\xd0W'), chr(1750 - 1650) + '\145' + chr(5930 - 5831) + chr(111) + chr(5300 - 5200) + chr(0b1010 + 0o133))('\165' + '\164' + chr(0b1011111 + 0o7) + chr(0b11010 + 0o23) + chr(0b11000 + 0o40)):
return roI3spqORKae(ES5oEprVxulp(b'e&\x9c\x06\xf0'), chr(100) + chr(0b1101 + 0o130) + chr(0b1100011) + chr(0b1101111) + chr(8920 - 8820) + chr(101))('\165' + chr(11936 - 11820) + chr(4500 - 4398) + '\055' + chr(0b110110 + 0o2))
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x07\x18\xc9^\xf2\xc8'), '\144' + '\x65' + chr(3497 - 3398) + chr(9287 - 9176) + '\144' + chr(101))('\x75' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\x19\x12\xc9V'), chr(100) + chr(2795 - 2694) + '\x63' + chr(0b1101101 + 0o2) + '\144' + chr(2486 - 2385))(chr(117) + chr(8122 - 8006) + '\146' + chr(0b101101 + 0o0) + chr(0b111000))]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x9c\x01\xf0'), '\144' + chr(101) + '\x63' + chr(0b1101111) + chr(100) + chr(7780 - 7679))(chr(0b10 + 0o163) + chr(116) + '\x66' + '\055' + '\070')
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x19\x0f\xc0W\xf3'), chr(2504 - 2404) + chr(0b1001010 + 0o33) + chr(6270 - 6171) + '\x6f' + '\144' + '\x65')('\x75' + chr(4348 - 4232) + chr(7455 - 7353) + chr(0b101101) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x12\x14\xc8W'), '\144' + '\x65' + chr(8480 - 8381) + '\x6f' + chr(0b1000101 + 0o37) + chr(10100 - 9999))(chr(117) + '\x74' + '\146' + chr(45) + chr(1915 - 1859))]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x9c\x00\xf0'), chr(0b1011000 + 0o14) + '\x65' + chr(8133 - 8034) + '\157' + chr(100) + chr(0b1011001 + 0o14))(chr(117) + chr(0b111110 + 0o66) + chr(102) + chr(0b101010 + 0o3) + '\070')
elif s93qyRHd7l1y == roI3spqORKae(ES5oEprVxulp(b'\x0c\x18\xc1'), chr(0b111110 + 0o46) + '\x65' + chr(99) + chr(0b110011 + 0o74) + '\144' + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(640 - 595) + chr(0b11 + 0o65)):
return roI3spqORKae(ES5oEprVxulp(b'e&\x9c\x03\xf0'), chr(0b1100100) + chr(7780 - 7679) + chr(0b1100011) + chr(9337 - 9226) + '\144' + chr(215 - 114))(chr(0b1110101) + chr(116) + chr(5258 - 5156) + chr(1746 - 1701) + chr(2455 - 2399))
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x19\x0f\xc0K'), '\x64' + chr(101) + chr(99) + chr(0b1100110 + 0o11) + chr(0b0 + 0o144) + chr(0b100100 + 0o101))(chr(0b110110 + 0o77) + chr(0b1110100) + chr(0b110110 + 0o60) + '\x2d' + chr(0b10 + 0o66)), roI3spqORKae(ES5oEprVxulp(b'\x19\x0f\xc4K'), chr(6593 - 6493) + chr(101) + chr(0b10100 + 0o117) + '\157' + chr(336 - 236) + chr(8356 - 8255))(chr(0b1110101) + chr(0b1 + 0o163) + '\146' + chr(45) + chr(0b101001 + 0o17)), roI3spqORKae(ES5oEprVxulp(b'\r\x14\xc9D\xf8\xcd'), '\x64' + '\145' + chr(99) + chr(111) + chr(0b1100100) + chr(0b10001 + 0o124))(chr(0b1110101) + chr(116) + '\146' + chr(0b100001 + 0o14) + chr(660 - 604))]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x96\x05\xf0'), chr(7363 - 7263) + chr(2263 - 2162) + chr(7091 - 6992) + chr(5622 - 5511) + chr(0b1100100) + '\x65')('\165' + '\x74' + '\x66' + '\055' + chr(0b11111 + 0o31))
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x1a\x1c\xd7Y\xfe\xc6F\xea'), chr(0b1100100) + chr(0b1000001 + 0o44) + chr(0b1011110 + 0o5) + chr(0b1001101 + 0o42) + '\144' + '\145')(chr(117) + chr(0b110101 + 0o77) + chr(0b1100110) + chr(1013 - 968) + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\n\x18\xc4^'), chr(0b100000 + 0o104) + chr(5491 - 5390) + chr(0b100010 + 0o101) + '\x6f' + chr(100) + chr(0b101011 + 0o72))('\x75' + chr(0b1110100) + '\x66' + chr(0b101101) + chr(2872 - 2816))]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x96\x04\xf0'), chr(100) + chr(7867 - 7766) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(0b110001 + 0o104) + chr(116) + chr(102) + chr(0b101101) + chr(0b110100 + 0o4))
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x1a\x1c\xd7Y\xed\xcaU\xf4\xce\xf0'), chr(0b1000101 + 0o37) + chr(101) + chr(0b10011 + 0o120) + chr(111) + chr(0b1100100) + chr(0b1010101 + 0o20))(chr(117) + '\164' + chr(2049 - 1947) + '\055' + '\070'), roI3spqORKae(ES5oEprVxulp(b'\x1a\x1c\xd7Y\xf0\xde@\xea\xc7\xe1\x0c'), '\x64' + chr(0b10111 + 0o116) + '\x63' + chr(111) + chr(100) + '\x65')(chr(791 - 674) + chr(0b1101111 + 0o5) + chr(6936 - 6834) + chr(0b101101) + chr(0b110111 + 0o1))]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x96\x07\xf0'), '\x64' + chr(0b111 + 0o136) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(0b1100101))('\165' + chr(0b1110100) + chr(0b10111 + 0o117) + chr(45) + chr(56))
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x1a\x1c\xd7Y\xff\xd3R\xe1'), chr(7197 - 7097) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(0b0 + 0o145))(chr(0b1110101) + '\x74' + '\x66' + chr(0b10010 + 0o33) + chr(2122 - 2066)), roI3spqORKae(ES5oEprVxulp(b'\x10\x1c\xd3K'), '\x64' + '\x65' + chr(99) + '\157' + '\x64' + '\x65')(chr(8723 - 8606) + chr(3624 - 3508) + chr(102) + '\055' + '\x38')]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x96\x06\xf0'), '\144' + chr(101) + '\x63' + chr(0b1010110 + 0o31) + chr(6231 - 6131) + chr(1730 - 1629))(chr(1008 - 891) + '\164' + chr(0b1100110) + chr(45) + chr(0b100011 + 0o25))
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x1a\x1c\xd7Y\xe4\xdaK\xe8\xcd\xe2'), chr(100) + '\145' + '\143' + '\157' + chr(0b111 + 0o135) + chr(0b1100101))(chr(0b1110101) + chr(116) + '\146' + chr(45) + chr(0b0 + 0o70)), roI3spqORKae(ES5oEprVxulp(b'\x11\x11\xccD\xf8'), '\x64' + '\x65' + chr(99) + chr(0b1001110 + 0o41) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(3118 - 3002) + chr(0b1100110) + chr(0b101101) + '\x38')]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x96\x01\xf0'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b1101111) + '\144' + chr(4714 - 4613))(chr(0b1000101 + 0o60) + '\164' + '\146' + '\055' + '\070')
elif s93qyRHd7l1y == roI3spqORKae(ES5oEprVxulp(b'\x1a\x1c\xd7Y\xfa\xcdB\xe1\xcc'), chr(100) + chr(0b101000 + 0o75) + chr(99) + chr(111) + chr(0b1111 + 0o125) + chr(0b1010000 + 0o25))(chr(117) + '\164' + chr(0b1100110) + chr(0b100101 + 0o10) + '\070'):
return roI3spqORKae(ES5oEprVxulp(b'e&\x96\x00\xf0'), '\x64' + chr(0b11 + 0o142) + chr(99) + chr(0b1101111) + '\144' + chr(0b1100101))('\x75' + chr(116) + '\146' + chr(45) + '\x38')
elif s93qyRHd7l1y in [roI3spqORKae(ES5oEprVxulp(b'\x1a\x1c\xd7Y\xef\xdaC'), chr(2434 - 2334) + chr(101) + '\143' + '\x6f' + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\x66' + '\055' + chr(0b111000)), roI3spqORKae(ES5oEprVxulp(b'\x13\x1c\xd7]\xf2\xd1'), chr(0b1100100) + chr(2420 - 2319) + chr(2761 - 2662) + chr(7592 - 7481) + '\144' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1100110) + '\x2d' + chr(0b111000))]:
return roI3spqORKae(ES5oEprVxulp(b'e&\x96\x03\xf0'), chr(0b1100100) + chr(6195 - 6094) + chr(99) + chr(7415 - 7304) + '\x64' + chr(0b1100101))(chr(10015 - 9898) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(56))
return None
|
estnltk/estnltk
|
estnltk/prettyprinter/terminalprettyprinter.py
|
_construct_start_index
|
def _construct_start_index(text, layer, markup_settings, spansStartingFrom=None):
''' Creates an index which stores all annotations of given text layer,
indexed by the start position of the annotation (annotation[START]).
Alternatively, if the index spansStartingFrom is already provided
as an input argument, obtains annotation information from the given
text layer, and stores into the index;
The method also creates an ( ANSI-terminal compatible ) mark-up of
the annotations (generates start and end tags), following the
specification in markup_settings. The markup_settings should be a
dict, setting at least one of the following visualisation options:
* 'bracket' : True -- annotations will be surrounded with brackets;
This works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in
an ANSI compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color;
this works in an ANSI
compatible terminal;
Each start position (in the index) is associated with a list of
annotation objects (annotations starting from that position).
An annotation object is a list containing the following information:
*) START position (of the annotation),
*) END position (of the annotation),
*) layer (name),
*) startTags -- graphic or textual formatting of the start tag,
*) endTags -- graphic or textual formatting of the end tag,
*) graphicFormatting -- boolean (whether graphic formatting was used?),
*) bracketing -- boolean (whether bracketing was used?),
Multiple annotation objects starting from the same position are sorted by
their length: longer annotations preceding the shorter ones;
The method returns created (or augmented) index (a dict object indexed
by START positions);
'''
if not markup_settings or not isinstance(markup_settings, dict):
raise Exception('Error: markup_settings should be a dict containing markup specification;')
# ----------------------------
# 1) Construct start and end tags, considering the formatting settings
startTags = ''
endTags = ''
graphicFormatting = False
bracketing = False
# -- Underlining
if ('u' in markup_settings and markup_settings['u']) or \
('underline' in markup_settings and markup_settings['underline']):
startTags += '\033[4m'
endTags += '\033[0m'
graphicFormatting = True
colorName = markup_settings['c'] if 'c' in markup_settings else None
colorName = markup_settings['color'] if 'color' in markup_settings else colorName
# -- Coloring
if colorName:
color = _get_ANSI_colored_font( colorName )
if color:
startTags += color
endTags += '\033[0m'
graphicFormatting = True
else:
raise Exception('Unknown color:', colorName)
# -- Bracketing
if ('b' in markup_settings and markup_settings['b']) or \
('bracket' in markup_settings and markup_settings['bracket']):
startTags += '['
# Add ending bracket before graphics ends (otherwise the
# graphics have no effect on the ending bracket)
endTags = ']'+endTags
bracketing = True
# Hack: if both bracketing and graphic formatting are used, add graphic
# formatting before the closing bracket of the endTag (to ensure
# that graphic formatting of the ending bracket is not overwritten
# mistakenly);
if graphicFormatting and bracketing:
startTags2 = startTags.rstrip('[')
endTags = startTags2+endTags
# ----------------------------
# 2) Get extractor for the elements of given layer
# >>> The following code borrows from estnltk.prettyprinter.marker :
# decide which extractor to use
# first just assume we need to use a multi layer text extractor
extractor = lambda t: texts_multi(t, layer)
# if user has specified his/her own callable, use it
if hasattr(layer, '__call__'):
extractor = layer
elif text.is_simple(layer):
# the given layer is simple, so use simple text extractor
extractor = lambda t: texts_simple(t, layer)
# >>>
# ----------------------------
# 3) Store an annotation for each span of given layer
if not spansStartingFrom:
spansStartingFrom = {}
for elem in extractor(text):
if elem[START] not in spansStartingFrom:
spansStartingFrom[elem[START]] = []
span1 = [elem[START], elem[END], layer, startTags, endTags, graphicFormatting, bracketing]
# Insert the span into the index
if not spansStartingFrom[elem[START]]:
spansStartingFrom[elem[START]].append( span1 )
else:
# Make sure that spans are inserted in the order of decreasing length:
# longer spans preceding the shorter ones;
inserted = False
for i in range( len(spansStartingFrom[elem[START]]) ):
span2 = spansStartingFrom[elem[START]][i]
# If an existing span is shorter than the current span, insert the
# current span before the existing span ...
if span1[1] > span2[1]:
spansStartingFrom[elem[START]].insert( i, span1 )
inserted = True
break
elif span1[1] == span2[1] and span1[2] < span2[2]:
# If both spans have equal length, order the spans in the alphabetical
# order of layer names:
spansStartingFrom[elem[START]].insert( i, span1 )
inserted = True
break
if not inserted:
spansStartingFrom[elem[START]].append(span1)
return spansStartingFrom
|
python
|
def _construct_start_index(text, layer, markup_settings, spansStartingFrom=None):
''' Creates an index which stores all annotations of given text layer,
indexed by the start position of the annotation (annotation[START]).
Alternatively, if the index spansStartingFrom is already provided
as an input argument, obtains annotation information from the given
text layer, and stores into the index;
The method also creates an ( ANSI-terminal compatible ) mark-up of
the annotations (generates start and end tags), following the
specification in markup_settings. The markup_settings should be a
dict, setting at least one of the following visualisation options:
* 'bracket' : True -- annotations will be surrounded with brackets;
This works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in
an ANSI compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color;
this works in an ANSI
compatible terminal;
Each start position (in the index) is associated with a list of
annotation objects (annotations starting from that position).
An annotation object is a list containing the following information:
*) START position (of the annotation),
*) END position (of the annotation),
*) layer (name),
*) startTags -- graphic or textual formatting of the start tag,
*) endTags -- graphic or textual formatting of the end tag,
*) graphicFormatting -- boolean (whether graphic formatting was used?),
*) bracketing -- boolean (whether bracketing was used?),
Multiple annotation objects starting from the same position are sorted by
their length: longer annotations preceding the shorter ones;
The method returns created (or augmented) index (a dict object indexed
by START positions);
'''
if not markup_settings or not isinstance(markup_settings, dict):
raise Exception('Error: markup_settings should be a dict containing markup specification;')
# ----------------------------
# 1) Construct start and end tags, considering the formatting settings
startTags = ''
endTags = ''
graphicFormatting = False
bracketing = False
# -- Underlining
if ('u' in markup_settings and markup_settings['u']) or \
('underline' in markup_settings and markup_settings['underline']):
startTags += '\033[4m'
endTags += '\033[0m'
graphicFormatting = True
colorName = markup_settings['c'] if 'c' in markup_settings else None
colorName = markup_settings['color'] if 'color' in markup_settings else colorName
# -- Coloring
if colorName:
color = _get_ANSI_colored_font( colorName )
if color:
startTags += color
endTags += '\033[0m'
graphicFormatting = True
else:
raise Exception('Unknown color:', colorName)
# -- Bracketing
if ('b' in markup_settings and markup_settings['b']) or \
('bracket' in markup_settings and markup_settings['bracket']):
startTags += '['
# Add ending bracket before graphics ends (otherwise the
# graphics have no effect on the ending bracket)
endTags = ']'+endTags
bracketing = True
# Hack: if both bracketing and graphic formatting are used, add graphic
# formatting before the closing bracket of the endTag (to ensure
# that graphic formatting of the ending bracket is not overwritten
# mistakenly);
if graphicFormatting and bracketing:
startTags2 = startTags.rstrip('[')
endTags = startTags2+endTags
# ----------------------------
# 2) Get extractor for the elements of given layer
# >>> The following code borrows from estnltk.prettyprinter.marker :
# decide which extractor to use
# first just assume we need to use a multi layer text extractor
extractor = lambda t: texts_multi(t, layer)
# if user has specified his/her own callable, use it
if hasattr(layer, '__call__'):
extractor = layer
elif text.is_simple(layer):
# the given layer is simple, so use simple text extractor
extractor = lambda t: texts_simple(t, layer)
# >>>
# ----------------------------
# 3) Store an annotation for each span of given layer
if not spansStartingFrom:
spansStartingFrom = {}
for elem in extractor(text):
if elem[START] not in spansStartingFrom:
spansStartingFrom[elem[START]] = []
span1 = [elem[START], elem[END], layer, startTags, endTags, graphicFormatting, bracketing]
# Insert the span into the index
if not spansStartingFrom[elem[START]]:
spansStartingFrom[elem[START]].append( span1 )
else:
# Make sure that spans are inserted in the order of decreasing length:
# longer spans preceding the shorter ones;
inserted = False
for i in range( len(spansStartingFrom[elem[START]]) ):
span2 = spansStartingFrom[elem[START]][i]
# If an existing span is shorter than the current span, insert the
# current span before the existing span ...
if span1[1] > span2[1]:
spansStartingFrom[elem[START]].insert( i, span1 )
inserted = True
break
elif span1[1] == span2[1] and span1[2] < span2[2]:
# If both spans have equal length, order the spans in the alphabetical
# order of layer names:
spansStartingFrom[elem[START]].insert( i, span1 )
inserted = True
break
if not inserted:
spansStartingFrom[elem[START]].append(span1)
return spansStartingFrom
|
[
"def",
"_construct_start_index",
"(",
"text",
",",
"layer",
",",
"markup_settings",
",",
"spansStartingFrom",
"=",
"None",
")",
":",
"if",
"not",
"markup_settings",
"or",
"not",
"isinstance",
"(",
"markup_settings",
",",
"dict",
")",
":",
"raise",
"Exception",
"(",
"'Error: markup_settings should be a dict containing markup specification;'",
")",
"# ----------------------------\r",
"# 1) Construct start and end tags, considering the formatting settings\r",
"startTags",
"=",
"''",
"endTags",
"=",
"''",
"graphicFormatting",
"=",
"False",
"bracketing",
"=",
"False",
"# -- Underlining\r",
"if",
"(",
"'u'",
"in",
"markup_settings",
"and",
"markup_settings",
"[",
"'u'",
"]",
")",
"or",
"(",
"'underline'",
"in",
"markup_settings",
"and",
"markup_settings",
"[",
"'underline'",
"]",
")",
":",
"startTags",
"+=",
"'\\033[4m'",
"endTags",
"+=",
"'\\033[0m'",
"graphicFormatting",
"=",
"True",
"colorName",
"=",
"markup_settings",
"[",
"'c'",
"]",
"if",
"'c'",
"in",
"markup_settings",
"else",
"None",
"colorName",
"=",
"markup_settings",
"[",
"'color'",
"]",
"if",
"'color'",
"in",
"markup_settings",
"else",
"colorName",
"# -- Coloring\r",
"if",
"colorName",
":",
"color",
"=",
"_get_ANSI_colored_font",
"(",
"colorName",
")",
"if",
"color",
":",
"startTags",
"+=",
"color",
"endTags",
"+=",
"'\\033[0m'",
"graphicFormatting",
"=",
"True",
"else",
":",
"raise",
"Exception",
"(",
"'Unknown color:'",
",",
"colorName",
")",
"# -- Bracketing\r",
"if",
"(",
"'b'",
"in",
"markup_settings",
"and",
"markup_settings",
"[",
"'b'",
"]",
")",
"or",
"(",
"'bracket'",
"in",
"markup_settings",
"and",
"markup_settings",
"[",
"'bracket'",
"]",
")",
":",
"startTags",
"+=",
"'['",
"# Add ending bracket before graphics ends (otherwise the \r",
"# graphics have no effect on the ending bracket)\r",
"endTags",
"=",
"']'",
"+",
"endTags",
"bracketing",
"=",
"True",
"# Hack: if both bracketing and graphic formatting are used, add graphic\r",
"# formatting before the closing bracket of the endTag (to ensure\r",
"# that graphic formatting of the ending bracket is not overwritten\r",
"# mistakenly);\r",
"if",
"graphicFormatting",
"and",
"bracketing",
":",
"startTags2",
"=",
"startTags",
".",
"rstrip",
"(",
"'['",
")",
"endTags",
"=",
"startTags2",
"+",
"endTags",
"# ----------------------------\r",
"# 2) Get extractor for the elements of given layer\r",
"# >>> The following code borrows from estnltk.prettyprinter.marker :\r",
"# decide which extractor to use\r",
"# first just assume we need to use a multi layer text extractor\r",
"extractor",
"=",
"lambda",
"t",
":",
"texts_multi",
"(",
"t",
",",
"layer",
")",
"# if user has specified his/her own callable, use it\r",
"if",
"hasattr",
"(",
"layer",
",",
"'__call__'",
")",
":",
"extractor",
"=",
"layer",
"elif",
"text",
".",
"is_simple",
"(",
"layer",
")",
":",
"# the given layer is simple, so use simple text extractor\r",
"extractor",
"=",
"lambda",
"t",
":",
"texts_simple",
"(",
"t",
",",
"layer",
")",
"# >>>\r",
"# ----------------------------\r",
"# 3) Store an annotation for each span of given layer\r",
"if",
"not",
"spansStartingFrom",
":",
"spansStartingFrom",
"=",
"{",
"}",
"for",
"elem",
"in",
"extractor",
"(",
"text",
")",
":",
"if",
"elem",
"[",
"START",
"]",
"not",
"in",
"spansStartingFrom",
":",
"spansStartingFrom",
"[",
"elem",
"[",
"START",
"]",
"]",
"=",
"[",
"]",
"span1",
"=",
"[",
"elem",
"[",
"START",
"]",
",",
"elem",
"[",
"END",
"]",
",",
"layer",
",",
"startTags",
",",
"endTags",
",",
"graphicFormatting",
",",
"bracketing",
"]",
"# Insert the span into the index\r",
"if",
"not",
"spansStartingFrom",
"[",
"elem",
"[",
"START",
"]",
"]",
":",
"spansStartingFrom",
"[",
"elem",
"[",
"START",
"]",
"]",
".",
"append",
"(",
"span1",
")",
"else",
":",
"# Make sure that spans are inserted in the order of decreasing length: \r",
"# longer spans preceding the shorter ones;\r",
"inserted",
"=",
"False",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"spansStartingFrom",
"[",
"elem",
"[",
"START",
"]",
"]",
")",
")",
":",
"span2",
"=",
"spansStartingFrom",
"[",
"elem",
"[",
"START",
"]",
"]",
"[",
"i",
"]",
"# If an existing span is shorter than the current span, insert the\r",
"# current span before the existing span ...\r",
"if",
"span1",
"[",
"1",
"]",
">",
"span2",
"[",
"1",
"]",
":",
"spansStartingFrom",
"[",
"elem",
"[",
"START",
"]",
"]",
".",
"insert",
"(",
"i",
",",
"span1",
")",
"inserted",
"=",
"True",
"break",
"elif",
"span1",
"[",
"1",
"]",
"==",
"span2",
"[",
"1",
"]",
"and",
"span1",
"[",
"2",
"]",
"<",
"span2",
"[",
"2",
"]",
":",
"# If both spans have equal length, order the spans in the alphabetical\r",
"# order of layer names:\r",
"spansStartingFrom",
"[",
"elem",
"[",
"START",
"]",
"]",
".",
"insert",
"(",
"i",
",",
"span1",
")",
"inserted",
"=",
"True",
"break",
"if",
"not",
"inserted",
":",
"spansStartingFrom",
"[",
"elem",
"[",
"START",
"]",
"]",
".",
"append",
"(",
"span1",
")",
"return",
"spansStartingFrom"
] |
Creates an index which stores all annotations of given text layer,
indexed by the start position of the annotation (annotation[START]).
Alternatively, if the index spansStartingFrom is already provided
as an input argument, obtains annotation information from the given
text layer, and stores into the index;
The method also creates an ( ANSI-terminal compatible ) mark-up of
the annotations (generates start and end tags), following the
specification in markup_settings. The markup_settings should be a
dict, setting at least one of the following visualisation options:
* 'bracket' : True -- annotations will be surrounded with brackets;
This works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in
an ANSI compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color;
this works in an ANSI
compatible terminal;
Each start position (in the index) is associated with a list of
annotation objects (annotations starting from that position).
An annotation object is a list containing the following information:
*) START position (of the annotation),
*) END position (of the annotation),
*) layer (name),
*) startTags -- graphic or textual formatting of the start tag,
*) endTags -- graphic or textual formatting of the end tag,
*) graphicFormatting -- boolean (whether graphic formatting was used?),
*) bracketing -- boolean (whether bracketing was used?),
Multiple annotation objects starting from the same position are sorted by
their length: longer annotations preceding the shorter ones;
The method returns created (or augmented) index (a dict object indexed
by START positions);
|
[
"Creates",
"an",
"index",
"which",
"stores",
"all",
"annotations",
"of",
"given",
"text",
"layer",
"indexed",
"by",
"the",
"start",
"position",
"of",
"the",
"annotation",
"(",
"annotation",
"[",
"START",
"]",
")",
".",
"Alternatively",
"if",
"the",
"index",
"spansStartingFrom",
"is",
"already",
"provided",
"as",
"an",
"input",
"argument",
"obtains",
"annotation",
"information",
"from",
"the",
"given",
"text",
"layer",
"and",
"stores",
"into",
"the",
"index",
";",
"The",
"method",
"also",
"creates",
"an",
"(",
"ANSI",
"-",
"terminal",
"compatible",
")",
"mark",
"-",
"up",
"of",
"the",
"annotations",
"(",
"generates",
"start",
"and",
"end",
"tags",
")",
"following",
"the",
"specification",
"in",
"markup_settings",
".",
"The",
"markup_settings",
"should",
"be",
"a",
"dict",
"setting",
"at",
"least",
"one",
"of",
"the",
"following",
"visualisation",
"options",
":",
"*",
"bracket",
":",
"True",
"--",
"annotations",
"will",
"be",
"surrounded",
"with",
"brackets",
";",
"This",
"works",
"in",
"any",
"terminal",
";",
"*",
"underline",
":",
"True",
"--",
"annotations",
"will",
"be",
"underlined",
";",
"This",
"works",
"in",
"an",
"ANSI",
"compatible",
"terminal",
";",
"*",
"color",
":",
"(",
"red",
"green",
"blue",
"etc",
".",
")",
"--",
"annotated",
"text",
"will",
"be",
"displayed",
"in",
"given",
"color",
";",
"this",
"works",
"in",
"an",
"ANSI",
"compatible",
"terminal",
";",
"Each",
"start",
"position",
"(",
"in",
"the",
"index",
")",
"is",
"associated",
"with",
"a",
"list",
"of",
"annotation",
"objects",
"(",
"annotations",
"starting",
"from",
"that",
"position",
")",
".",
"An",
"annotation",
"object",
"is",
"a",
"list",
"containing",
"the",
"following",
"information",
":",
"*",
")",
"START",
"position",
"(",
"of",
"the",
"annotation",
")",
"*",
")",
"END",
"position",
"(",
"of",
"the",
"annotation",
")",
"*",
")",
"layer",
"(",
"name",
")",
"*",
")",
"startTags",
"--",
"graphic",
"or",
"textual",
"formatting",
"of",
"the",
"start",
"tag",
"*",
")",
"endTags",
"--",
"graphic",
"or",
"textual",
"formatting",
"of",
"the",
"end",
"tag",
"*",
")",
"graphicFormatting",
"--",
"boolean",
"(",
"whether",
"graphic",
"formatting",
"was",
"used?",
")",
"*",
")",
"bracketing",
"--",
"boolean",
"(",
"whether",
"bracketing",
"was",
"used?",
")",
"Multiple",
"annotation",
"objects",
"starting",
"from",
"the",
"same",
"position",
"are",
"sorted",
"by",
"their",
"length",
":",
"longer",
"annotations",
"preceding",
"the",
"shorter",
"ones",
";",
"The",
"method",
"returns",
"created",
"(",
"or",
"augmented",
")",
"index",
"(",
"a",
"dict",
"object",
"indexed",
"by",
"START",
"positions",
")",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/terminalprettyprinter.py#L84-L207
|
train
|
Constructs an index that stores all annotations starting from the given text layer and stores them into the given index.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,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qaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + '\060' + chr(2342 - 2289), 0o10), nzTpIcepk0o8(chr(581 - 533) + chr(111) + chr(51) + '\064' + chr(0b110111), 54923 - 54915), nzTpIcepk0o8('\x30' + chr(3232 - 3121) + chr(0b101001 + 0o13) + chr(0b101 + 0o60), 0b1000), nzTpIcepk0o8(chr(972 - 924) + chr(0b1101111) + chr(49) + '\x33' + '\065', 0b1000), nzTpIcepk0o8('\060' + chr(0b1111 + 0o140) + chr(0b10010 + 0o41) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(10580 - 10469) + '\063' + chr(2784 - 2731) + chr(287 - 235), 0o10), nzTpIcepk0o8('\x30' + chr(0b1010010 + 0o35) + chr(0b110010) + chr(2335 - 2285) + chr(0b101010 + 0o10), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\062' + chr(1655 - 1602) + chr(0b101000 + 0o11), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32', ord("\x08")), nzTpIcepk0o8('\060' + chr(7389 - 7278) + chr(0b10100 + 0o37) + chr(54) + chr(53), 44745 - 44737), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\157' + '\062' + '\x30' + chr(0b100100 + 0o20), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1040 - 989) + chr(0b110101), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(0b110011) + chr(0b1110 + 0o50), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b101101 + 0o5) + chr(2217 - 2169) + '\x33', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b101111 + 0o2) + '\063' + chr(973 - 924), 19625 - 19617), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\157' + '\063' + chr(50), 0b1000), nzTpIcepk0o8(chr(1401 - 1353) + chr(886 - 775) + chr(0b110001) + chr(48) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1000011 + 0o54) + chr(0b110010) + chr(0b110000) + chr(0b110000 + 0o6), 0o10), nzTpIcepk0o8('\060' + chr(0b1010111 + 0o30) + chr(0b100001 + 0o20) + chr(1903 - 1853), ord("\x08")), nzTpIcepk0o8(chr(816 - 768) + chr(0b1110 + 0o141) + '\063' + chr(0b110000) + chr(55), 0o10), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1101111) + chr(329 - 280) + chr(0b11001 + 0o27), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110100) + '\x32', 58732 - 58724), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\x6f' + chr(0b110010) + chr(50) + chr(0b100011 + 0o23), 27447 - 27439), nzTpIcepk0o8(chr(48) + '\157' + '\063' + chr(0b110100) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\157' + chr(49) + '\061' + chr(49), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b100110 + 0o14) + chr(1805 - 1754) + '\067', 23775 - 23767), nzTpIcepk0o8(chr(0b110000) + chr(5938 - 5827) + '\x32' + chr(51) + chr(1925 - 1877), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110111) + chr(0b10010 + 0o42), 0b1000), nzTpIcepk0o8(chr(48) + chr(6996 - 6885) + '\063' + chr(0b1100 + 0o50) + '\x33', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + '\x32' + chr(0b1000 + 0o55), 55275 - 55267), nzTpIcepk0o8(chr(0b110000) + chr(0b110100 + 0o73) + chr(928 - 879) + chr(0b110100) + '\x35', 33981 - 33973), nzTpIcepk0o8('\x30' + '\x6f' + '\061' + chr(2101 - 2047) + '\062', 0o10), nzTpIcepk0o8('\x30' + chr(3912 - 3801) + chr(0b110010) + chr(0b110110) + '\x35', 0o10), nzTpIcepk0o8('\x30' + chr(0b100000 + 0o117) + chr(50) + '\x35' + chr(2695 - 2643), 0b1000), nzTpIcepk0o8(chr(0b11001 + 0o27) + '\157' + '\x34' + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49) + chr(54) + chr(52), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b110001 + 0o76) + '\x33' + chr(54) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\065' + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1100111 + 0o10) + chr(886 - 837) + chr(54) + chr(643 - 591), 8), nzTpIcepk0o8(chr(48) + chr(10937 - 10826) + '\061' + '\x32' + chr(0b110001), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + '\x35' + chr(2025 - 1977), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xab'), '\144' + '\145' + '\143' + chr(0b1101111) + chr(100) + '\145')('\x75' + '\x74' + chr(0b1001111 + 0o27) + chr(1986 - 1941) + chr(2888 - 2832)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def hjAy_Efhrb_Y(cpStk7cY1TJd, GHz9Ad9ZLlU5, z29Q35YDgq4u, zDDta06N6DAG=None):
if not z29Q35YDgq4u or not suIjIS24Zkqw(z29Q35YDgq4u, znjnJWK64FDT):
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'\xc0\x95W2n\xd6\xb2\xc4c\x87\xefh\xee\xdc*\x7f1\xf2c\xa9oQ\xb6\x92!\xf0\xedP\x87\xf5\x07\x17\x95\xcd\x00\x10\x98H\x00q\xe6\x88K)}\x85\xfc\xc0l\x92\xa4p\xff\xf12o5\xa6y\xb7mA\xff\x87 \xfc\xf9H\x8a\xba\x0bI'), chr(0b1100100) + chr(101) + chr(0b101 + 0o136) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(0b1101011 + 0o12) + chr(0b101000 + 0o114) + chr(102) + chr(580 - 535) + chr(0b111000)))
_iA03ia5iDt0 = roI3spqORKae(ES5oEprVxulp(b''), '\x64' + chr(0b1100101) + chr(0b11010 + 0o111) + '\157' + chr(7171 - 7071) + chr(101))(chr(0b101110 + 0o107) + chr(0b1110100) + chr(102) + chr(0b100 + 0o51) + chr(1315 - 1259))
oIGkTtH81yq4 = roI3spqORKae(ES5oEprVxulp(b''), '\x64' + chr(8506 - 8405) + '\143' + '\157' + chr(0b1100100) + chr(9912 - 9811))(chr(0b1001101 + 0o50) + chr(116) + chr(3397 - 3295) + chr(45) + '\x38')
GLouK_chw3Ff = nzTpIcepk0o8(chr(48) + chr(6544 - 6433) + chr(0b11111 + 0o21), 10038 - 10030)
zgRp1DmnP9og = nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1110 + 0o42), 8)
if roI3spqORKae(ES5oEprVxulp(b'\xf0'), chr(5567 - 5467) + chr(0b1100101) + '\x63' + '\x6f' + chr(3168 - 3068) + '\x65')(chr(5149 - 5032) + '\x74' + chr(0b1100110) + chr(0b101101) + '\x38') in z29Q35YDgq4u and z29Q35YDgq4u[roI3spqORKae(ES5oEprVxulp(b'\xf0'), chr(5116 - 5016) + '\x65' + '\143' + '\157' + '\x64' + chr(101))(chr(0b110010 + 0o103) + chr(0b1110100) + chr(102) + '\055' + '\070')] or (roI3spqORKae(ES5oEprVxulp(b'\xf0\x89A8n\x80\xfb\xc7g'), chr(8759 - 8659) + chr(0b1100101) + '\x63' + chr(0b1101010 + 0o5) + chr(100) + '\145')('\x75' + chr(0b1011111 + 0o25) + chr(2569 - 2467) + chr(822 - 777) + chr(56)) in z29Q35YDgq4u and z29Q35YDgq4u[roI3spqORKae(ES5oEprVxulp(b'\xf0\x89A8n\x80\xfb\xc7g'), chr(0b1001111 + 0o25) + chr(0b1100 + 0o131) + chr(99) + '\157' + '\144' + chr(101))(chr(117) + chr(5777 - 5661) + chr(0b1100110) + '\055' + '\x38')]):
_iA03ia5iDt0 += roI3spqORKae(ES5oEprVxulp(b'\x9e\xbc\x110'), chr(100) + chr(422 - 321) + chr(99) + chr(0b1101111) + chr(8207 - 8107) + chr(0b1100101))('\x75' + chr(0b100010 + 0o122) + '\146' + chr(139 - 94) + '\070')
oIGkTtH81yq4 += roI3spqORKae(ES5oEprVxulp(b'\x9e\xbc\x150'), '\x64' + chr(0b1100010 + 0o3) + chr(0b1000101 + 0o36) + chr(3176 - 3065) + '\144' + chr(0b110011 + 0o62))(chr(0b1110101) + '\x74' + chr(9799 - 9697) + chr(0b101001 + 0o4) + chr(684 - 628))
GLouK_chw3Ff = nzTpIcepk0o8('\060' + chr(7935 - 7824) + chr(0b11 + 0o56), 27173 - 27165)
CBCjN0Qu1XMj = z29Q35YDgq4u[roI3spqORKae(ES5oEprVxulp(b'\xe6'), '\x64' + chr(101) + chr(0b1100011) + '\157' + chr(100) + chr(0b11100 + 0o111))(chr(0b10010 + 0o143) + '\x74' + chr(10093 - 9991) + '\055' + chr(1143 - 1087))] if roI3spqORKae(ES5oEprVxulp(b'\xe6'), '\144' + '\x65' + '\143' + chr(0b1011011 + 0o24) + '\x64' + '\x65')(chr(117) + '\x74' + chr(0b1 + 0o145) + chr(511 - 466) + chr(0b111000)) in z29Q35YDgq4u else None
CBCjN0Qu1XMj = z29Q35YDgq4u[roI3spqORKae(ES5oEprVxulp(b'\xe6\x88I2n'), '\144' + '\145' + '\x63' + chr(111) + chr(100) + '\x65')('\165' + chr(116) + chr(102) + chr(0b101101) + chr(0b101010 + 0o16))] if roI3spqORKae(ES5oEprVxulp(b'\xe6\x88I2n'), chr(100) + chr(0b1000000 + 0o45) + '\x63' + chr(0b1101111) + '\x64' + chr(10103 - 10002))(chr(0b10000 + 0o145) + chr(0b1100100 + 0o20) + '\x66' + chr(45) + chr(470 - 414)) in z29Q35YDgq4u else CBCjN0Qu1XMj
if CBCjN0Qu1XMj:
s93qyRHd7l1y = s2a6wcBNGAp1(CBCjN0Qu1XMj)
if s93qyRHd7l1y:
_iA03ia5iDt0 += s93qyRHd7l1y
oIGkTtH81yq4 += roI3spqORKae(ES5oEprVxulp(b'\x9e\xbc\x150'), chr(100) + '\145' + chr(99) + chr(0b0 + 0o157) + '\x64' + chr(101))(chr(117) + '\x74' + chr(0b1000011 + 0o43) + '\055' + chr(56))
GLouK_chw3Ff = nzTpIcepk0o8('\060' + '\157' + '\x31', 8)
else:
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'\xd0\x89N3s\x9b\xfc\x89a\x9a\xe8r\xec\xb9'), '\144' + '\x65' + chr(0b1100011) + chr(0b1100101 + 0o12) + chr(0b1100100) + '\x65')('\x75' + '\164' + chr(0b1100110) + chr(45) + chr(0b111000)), CBCjN0Qu1XMj)
if roI3spqORKae(ES5oEprVxulp(b'\xe7'), chr(671 - 571) + chr(550 - 449) + chr(0b1100011) + chr(0b1100000 + 0o17) + chr(100) + '\145')(chr(3290 - 3173) + chr(485 - 369) + '\x66' + '\x2d' + chr(0b110101 + 0o3)) in z29Q35YDgq4u and z29Q35YDgq4u[roI3spqORKae(ES5oEprVxulp(b'\xe7'), chr(4097 - 3997) + chr(0b1100101) + chr(8828 - 8729) + chr(0b1101111) + chr(0b10001 + 0o123) + chr(0b1100101))(chr(7132 - 7015) + chr(0b11 + 0o161) + '\146' + chr(633 - 588) + chr(621 - 565))] or (roI3spqORKae(ES5oEprVxulp(b'\xe7\x95D>w\x89\xe6'), chr(4782 - 4682) + '\145' + chr(99) + '\x6f' + '\144' + '\145')(chr(117) + chr(4442 - 4326) + '\146' + chr(45) + chr(56)) in z29Q35YDgq4u and z29Q35YDgq4u[roI3spqORKae(ES5oEprVxulp(b'\xe7\x95D>w\x89\xe6'), chr(5421 - 5321) + '\x65' + chr(0b1100001 + 0o2) + chr(5625 - 5514) + chr(0b110110 + 0o56) + '\x65')(chr(117) + chr(116) + chr(0b1100110) + chr(45) + '\070')]):
_iA03ia5iDt0 += roI3spqORKae(ES5oEprVxulp(b'\xde'), '\144' + chr(101) + chr(0b1001110 + 0o25) + chr(0b1010 + 0o145) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(3328 - 3212) + '\x66' + '\055' + chr(0b1001 + 0o57))
oIGkTtH81yq4 = roI3spqORKae(ES5oEprVxulp(b'\xd8'), chr(837 - 737) + '\x65' + '\143' + '\157' + chr(100) + '\x65')(chr(7244 - 7127) + '\164' + '\x66' + chr(0b1101 + 0o40) + chr(0b101000 + 0o20)) + oIGkTtH81yq4
zgRp1DmnP9og = nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49), 8)
if GLouK_chw3Ff and zgRp1DmnP9og:
SKh0fad4LopT = _iA03ia5iDt0.rstrip(roI3spqORKae(ES5oEprVxulp(b'\xde'), '\144' + '\145' + '\143' + chr(5751 - 5640) + chr(6174 - 6074) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(0b111 + 0o137) + '\055' + chr(0b111000)))
oIGkTtH81yq4 = SKh0fad4LopT + oIGkTtH81yq4
def Sc5_ZljaM4Vn(h3Vc_4wxEbgd):
return MugeQzpO53_G(h3Vc_4wxEbgd, GHz9Ad9ZLlU5)
if dRKdVnHPFq7C(GHz9Ad9ZLlU5, roI3spqORKae(ES5oEprVxulp(b'\xda\xb8F<p\x80\xcd\xf6'), chr(0b1100100) + '\x65' + '\143' + chr(111) + chr(100) + chr(0b1100101))('\165' + chr(116) + chr(0b1100110) + '\055' + '\x38')):
Sc5_ZljaM4Vn = GHz9Ad9ZLlU5
elif roI3spqORKae(cpStk7cY1TJd, roI3spqORKae(ES5oEprVxulp(b'\xec\x94z.u\x81\xe2\xc5g'), chr(100) + chr(7076 - 6975) + chr(7873 - 7774) + '\x6f' + '\144' + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(56)))(GHz9Ad9ZLlU5):
def Sc5_ZljaM4Vn(h3Vc_4wxEbgd):
return tJR_dwdy_ihh(h3Vc_4wxEbgd, GHz9Ad9ZLlU5)
if not zDDta06N6DAG:
zDDta06N6DAG = {}
for Ge7qqaux3bQW in Sc5_ZljaM4Vn(cpStk7cY1TJd):
if Ge7qqaux3bQW[tMRCl49SUV2c] not in zDDta06N6DAG:
zDDta06N6DAG[Ge7qqaux3bQW[tMRCl49SUV2c]] = []
prb0Dn7yGbpq = [Ge7qqaux3bQW[tMRCl49SUV2c], Ge7qqaux3bQW[rJed2cvrh1UW], GHz9Ad9ZLlU5, _iA03ia5iDt0, oIGkTtH81yq4, GLouK_chw3Ff, zgRp1DmnP9og]
if not zDDta06N6DAG[Ge7qqaux3bQW[tMRCl49SUV2c]]:
roI3spqORKae(zDDta06N6DAG[Ge7qqaux3bQW[tMRCl49SUV2c]], roI3spqORKae(ES5oEprVxulp(b'\xcd\xb3vid\x8b\xd5\xc6h\x9a\xd1('), chr(100) + '\145' + chr(0b110101 + 0o56) + chr(0b10010 + 0o135) + '\144' + '\x65')('\x75' + '\164' + chr(102) + chr(973 - 928) + chr(0b10110 + 0o42)))(prb0Dn7yGbpq)
else:
PkBZ_DUDTDT8 = nzTpIcepk0o8(chr(0b111 + 0o51) + chr(0b1000011 + 0o54) + '\x30', 8)
for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(zDDta06N6DAG[Ge7qqaux3bQW[tMRCl49SUV2c]])):
l2kgRlYa9rts = zDDta06N6DAG[Ge7qqaux3bQW[tMRCl49SUV2c]][ZlbFMSG8gCoF]
if prb0Dn7yGbpq[nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31', 8)] > l2kgRlYa9rts[nzTpIcepk0o8(chr(0b110000) + '\157' + chr(764 - 715), 8)]:
roI3spqORKae(zDDta06N6DAG[Ge7qqaux3bQW[tMRCl49SUV2c]], roI3spqORKae(ES5oEprVxulp(b'\xec\x89V8n\x98'), '\144' + '\145' + chr(0b1100011) + chr(111) + chr(303 - 203) + chr(101))('\165' + chr(0b1110100) + chr(0b1100100 + 0o2) + chr(1022 - 977) + '\x38'))(ZlbFMSG8gCoF, prb0Dn7yGbpq)
PkBZ_DUDTDT8 = nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49), 8)
break
elif prb0Dn7yGbpq[nzTpIcepk0o8(chr(48) + '\157' + chr(49), 8)] == l2kgRlYa9rts[nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31', 8)] and prb0Dn7yGbpq[nzTpIcepk0o8(chr(665 - 617) + chr(5459 - 5348) + '\x32', 8)] < l2kgRlYa9rts[nzTpIcepk0o8('\060' + '\157' + '\x32', 8)]:
roI3spqORKae(zDDta06N6DAG[Ge7qqaux3bQW[tMRCl49SUV2c]], roI3spqORKae(ES5oEprVxulp(b'\xec\x89V8n\x98'), chr(0b1000110 + 0o36) + chr(101) + chr(99) + '\157' + chr(9751 - 9651) + chr(101))(chr(0b11110 + 0o127) + chr(0b1011011 + 0o31) + chr(0b1100110) + '\055' + '\070'))(ZlbFMSG8gCoF, prb0Dn7yGbpq)
PkBZ_DUDTDT8 = nzTpIcepk0o8('\x30' + chr(0b11010 + 0o125) + chr(0b1000 + 0o51), 8)
break
if not PkBZ_DUDTDT8:
roI3spqORKae(zDDta06N6DAG[Ge7qqaux3bQW[tMRCl49SUV2c]], roI3spqORKae(ES5oEprVxulp(b'\xcd\xb3vid\x8b\xd5\xc6h\x9a\xd1('), '\144' + chr(0b1100101) + '\143' + chr(111) + chr(0b1100100 + 0o0) + chr(0b1100101))(chr(117) + chr(116) + '\146' + '\x2d' + '\070'))(prb0Dn7yGbpq)
return zDDta06N6DAG
|
estnltk/estnltk
|
estnltk/prettyprinter/terminalprettyprinter.py
|
_construct_end_index
|
def _construct_end_index( spansStartingFrom ):
''' Creates an index which stores all annotations (from spansStartingFrom)
by their end position in text (annotation[END]).
Each start position (in the index) is associated with a list of
annotation objects (annotations ending at that position).
An annotation object is also a list containing the following information:
*) endTags -- graphic or textual formatting of the end tag,
*) START position (of the annotation);
*) layer name;
Multiple annotation objects ending at the same position are sorted by
their length: shorter annotations preceding the longer ones;
'''
endIndex = {}
for i in spansStartingFrom:
for span1 in spansStartingFrom[i]:
# keep the record of endTags, start positions (for determining the length)
# and layer names
endSpan1 = [ span1[4], span1[0], span1[2] ]
endLoc1 = span1[1]
if endLoc1 not in endIndex:
endIndex[endLoc1] = []
endIndex[endLoc1].append( endSpan1 )
else:
# Make sure that spans are inserted in the order of increasing length:
# shorter spans preceding the longer ones;
inserted = False
for i in range( len(endIndex[endLoc1]) ):
endSpan2 = endIndex[endLoc1][i]
# If an existing span is longer than the current span, insert the
# current span before the existing span ...
if endSpan2[1] < endSpan1[1]:
endIndex[endLoc1].insert( i, endSpan1 )
inserted = True
break
elif endSpan2[1] == endSpan1[1] and endSpan2[2] < endSpan1[2]:
# If both spans have equal length, order the spans in the
# alphabetical order of layer names:
endIndex[endLoc1].insert( i, endSpan1 )
inserted = True
break
if not inserted:
endIndex[endLoc1].append( endSpan1 )
return endIndex
|
python
|
def _construct_end_index( spansStartingFrom ):
''' Creates an index which stores all annotations (from spansStartingFrom)
by their end position in text (annotation[END]).
Each start position (in the index) is associated with a list of
annotation objects (annotations ending at that position).
An annotation object is also a list containing the following information:
*) endTags -- graphic or textual formatting of the end tag,
*) START position (of the annotation);
*) layer name;
Multiple annotation objects ending at the same position are sorted by
their length: shorter annotations preceding the longer ones;
'''
endIndex = {}
for i in spansStartingFrom:
for span1 in spansStartingFrom[i]:
# keep the record of endTags, start positions (for determining the length)
# and layer names
endSpan1 = [ span1[4], span1[0], span1[2] ]
endLoc1 = span1[1]
if endLoc1 not in endIndex:
endIndex[endLoc1] = []
endIndex[endLoc1].append( endSpan1 )
else:
# Make sure that spans are inserted in the order of increasing length:
# shorter spans preceding the longer ones;
inserted = False
for i in range( len(endIndex[endLoc1]) ):
endSpan2 = endIndex[endLoc1][i]
# If an existing span is longer than the current span, insert the
# current span before the existing span ...
if endSpan2[1] < endSpan1[1]:
endIndex[endLoc1].insert( i, endSpan1 )
inserted = True
break
elif endSpan2[1] == endSpan1[1] and endSpan2[2] < endSpan1[2]:
# If both spans have equal length, order the spans in the
# alphabetical order of layer names:
endIndex[endLoc1].insert( i, endSpan1 )
inserted = True
break
if not inserted:
endIndex[endLoc1].append( endSpan1 )
return endIndex
|
[
"def",
"_construct_end_index",
"(",
"spansStartingFrom",
")",
":",
"endIndex",
"=",
"{",
"}",
"for",
"i",
"in",
"spansStartingFrom",
":",
"for",
"span1",
"in",
"spansStartingFrom",
"[",
"i",
"]",
":",
"# keep the record of endTags, start positions (for determining the length)\r",
"# and layer names\r",
"endSpan1",
"=",
"[",
"span1",
"[",
"4",
"]",
",",
"span1",
"[",
"0",
"]",
",",
"span1",
"[",
"2",
"]",
"]",
"endLoc1",
"=",
"span1",
"[",
"1",
"]",
"if",
"endLoc1",
"not",
"in",
"endIndex",
":",
"endIndex",
"[",
"endLoc1",
"]",
"=",
"[",
"]",
"endIndex",
"[",
"endLoc1",
"]",
".",
"append",
"(",
"endSpan1",
")",
"else",
":",
"# Make sure that spans are inserted in the order of increasing length: \r",
"# shorter spans preceding the longer ones;\r",
"inserted",
"=",
"False",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"endIndex",
"[",
"endLoc1",
"]",
")",
")",
":",
"endSpan2",
"=",
"endIndex",
"[",
"endLoc1",
"]",
"[",
"i",
"]",
"# If an existing span is longer than the current span, insert the\r",
"# current span before the existing span ...\r",
"if",
"endSpan2",
"[",
"1",
"]",
"<",
"endSpan1",
"[",
"1",
"]",
":",
"endIndex",
"[",
"endLoc1",
"]",
".",
"insert",
"(",
"i",
",",
"endSpan1",
")",
"inserted",
"=",
"True",
"break",
"elif",
"endSpan2",
"[",
"1",
"]",
"==",
"endSpan1",
"[",
"1",
"]",
"and",
"endSpan2",
"[",
"2",
"]",
"<",
"endSpan1",
"[",
"2",
"]",
":",
"# If both spans have equal length, order the spans in the \r",
"# alphabetical order of layer names:\r",
"endIndex",
"[",
"endLoc1",
"]",
".",
"insert",
"(",
"i",
",",
"endSpan1",
")",
"inserted",
"=",
"True",
"break",
"if",
"not",
"inserted",
":",
"endIndex",
"[",
"endLoc1",
"]",
".",
"append",
"(",
"endSpan1",
")",
"return",
"endIndex"
] |
Creates an index which stores all annotations (from spansStartingFrom)
by their end position in text (annotation[END]).
Each start position (in the index) is associated with a list of
annotation objects (annotations ending at that position).
An annotation object is also a list containing the following information:
*) endTags -- graphic or textual formatting of the end tag,
*) START position (of the annotation);
*) layer name;
Multiple annotation objects ending at the same position are sorted by
their length: shorter annotations preceding the longer ones;
|
[
"Creates",
"an",
"index",
"which",
"stores",
"all",
"annotations",
"(",
"from",
"spansStartingFrom",
")",
"by",
"their",
"end",
"position",
"in",
"text",
"(",
"annotation",
"[",
"END",
"]",
")",
".",
"Each",
"start",
"position",
"(",
"in",
"the",
"index",
")",
"is",
"associated",
"with",
"a",
"list",
"of",
"annotation",
"objects",
"(",
"annotations",
"ending",
"at",
"that",
"position",
")",
".",
"An",
"annotation",
"object",
"is",
"also",
"a",
"list",
"containing",
"the",
"following",
"information",
":",
"*",
")",
"endTags",
"--",
"graphic",
"or",
"textual",
"formatting",
"of",
"the",
"end",
"tag",
"*",
")",
"START",
"position",
"(",
"of",
"the",
"annotation",
")",
";",
"*",
")",
"layer",
"name",
";",
"Multiple",
"annotation",
"objects",
"ending",
"at",
"the",
"same",
"position",
"are",
"sorted",
"by",
"their",
"length",
":",
"shorter",
"annotations",
"preceding",
"the",
"longer",
"ones",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/terminalprettyprinter.py#L210-L254
|
train
|
Constructs an index that stores all the annotations ending at the given position.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG,GA4ANb_Tki5v,LdFlJR2ssk3y,gCu7Qd75URN1,yfEeqQiUoqWT,zG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Phm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(111) + chr(0b10010 + 0o37), 10548 - 10540), nzTpIcepk0o8('\060' + chr(0b1010100 + 0o33) + chr(50) + '\x36' + '\x32', 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(2411 - 2357) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101111) + chr(2411 - 2360) + '\x33' + chr(0b10111 + 0o40), 0o10), nzTpIcepk0o8(chr(1047 - 999) + '\157' + '\x31' + chr(54) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(111) + chr(51) + chr(2294 - 2244) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(10334 - 10223) + chr(0b110001) + '\x34' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1100010 + 0o15) + chr(0b10110 + 0o35) + chr(0b110 + 0o60) + chr(0b10000 + 0o41), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(1729 - 1618) + chr(0b110011) + '\x33' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1101111) + '\062' + '\061' + '\x33', 0o10), nzTpIcepk0o8(chr(1382 - 1334) + '\x6f' + chr(50) + '\061' + '\064', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(115 - 65) + chr(0b110111) + '\065', 24028 - 24020), nzTpIcepk0o8('\060' + chr(11851 - 11740) + chr(50) + chr(334 - 286) + chr(55), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + '\x36', ord("\x08")), nzTpIcepk0o8('\x30' + chr(6677 - 6566) + '\061' + chr(0b110101) + '\x37', 29351 - 29343), nzTpIcepk0o8('\060' + chr(111) + '\x32' + '\x35' + chr(53), 0b1000), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1101111) + chr(0b110010) + '\x31', 9613 - 9605), nzTpIcepk0o8('\060' + chr(0b1010100 + 0o33) + chr(0b110001) + '\x37' + chr(1841 - 1793), 18822 - 18814), nzTpIcepk0o8('\060' + chr(0b11110 + 0o121) + chr(2208 - 2159) + chr(639 - 587) + chr(2325 - 2270), 0b1000), nzTpIcepk0o8('\060' + chr(111) + '\062' + chr(0b110100) + '\x35', 0o10), nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(48) + chr(54), 0b1000), nzTpIcepk0o8(chr(376 - 328) + chr(0b1101111) + chr(0b110001) + '\x30', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1110 + 0o45) + chr(52), ord("\x08")), nzTpIcepk0o8('\060' + chr(12166 - 12055) + '\063' + chr(143 - 95) + '\x33', 32662 - 32654), nzTpIcepk0o8('\060' + chr(111) + '\062' + '\x32' + chr(395 - 347), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + chr(0b110111) + chr(487 - 437), 39272 - 39264), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + '\060' + chr(52), 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(5743 - 5632) + chr(0b110011) + chr(1824 - 1775) + '\x37', ord("\x08")), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(9680 - 9569) + chr(0b110011) + chr(2373 - 2324) + chr(260 - 210), 0b1000), nzTpIcepk0o8(chr(1790 - 1742) + '\157' + '\061' + '\064' + chr(1551 - 1497), ord("\x08")), nzTpIcepk0o8(chr(1832 - 1784) + chr(0b1011111 + 0o20) + chr(0b10110 + 0o35) + chr(0b11010 + 0o33) + '\x33', 61790 - 61782), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\x35' + '\066', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + '\061' + chr(51), 65432 - 65424), nzTpIcepk0o8(chr(0b110000) + chr(0b1010011 + 0o34) + chr(50) + chr(52) + '\064', 0o10), nzTpIcepk0o8(chr(1281 - 1233) + '\157' + chr(0b110011) + chr(2283 - 2230) + chr(50), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1010100 + 0o33) + chr(2260 - 2211) + chr(1939 - 1887) + '\060', 51421 - 51413), nzTpIcepk0o8('\x30' + chr(5597 - 5486) + chr(0b11001 + 0o30) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x32' + chr(0b110010) + chr(0b10 + 0o61), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(54) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b101101 + 0o3) + '\x6f' + '\x36' + chr(0b110000), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1100 + 0o143) + '\065' + chr(0b110000), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'/'), chr(2973 - 2873) + chr(0b1100101) + chr(99) + '\157' + chr(0b1010000 + 0o24) + chr(101))(chr(0b110100 + 0o101) + '\164' + chr(4498 - 4396) + chr(104 - 59) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def MGsGxYlbESax(zDDta06N6DAG):
jOH_xLUPLo54 = {}
for ZlbFMSG8gCoF in zDDta06N6DAG:
for prb0Dn7yGbpq in zDDta06N6DAG[ZlbFMSG8gCoF]:
DfHNq_TQ8eKD = [prb0Dn7yGbpq[nzTpIcepk0o8('\060' + chr(5339 - 5228) + '\x34', ord("\x08"))], prb0Dn7yGbpq[nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(11208 - 11097) + chr(48), 62173 - 62165)], prb0Dn7yGbpq[nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x32', 0b1000)]]
_9geoGcnIrQ_ = prb0Dn7yGbpq[nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b100010 + 0o115) + chr(1767 - 1718), 8)]
if _9geoGcnIrQ_ not in jOH_xLUPLo54:
jOH_xLUPLo54[_9geoGcnIrQ_] = []
roI3spqORKae(jOH_xLUPLo54[_9geoGcnIrQ_], roI3spqORKae(ES5oEprVxulp(b'I\xe6"\xeb\x0f\xb3"\x9e\xb3\xe4\xd9\x88'), '\144' + chr(0b1000001 + 0o44) + chr(7549 - 7450) + chr(0b1101111) + chr(100) + chr(6823 - 6722))(chr(0b1110101) + chr(0b10110 + 0o136) + chr(0b1000001 + 0o45) + chr(45) + chr(56)))(DfHNq_TQ8eKD)
else:
PkBZ_DUDTDT8 = nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(817 - 769), 8)
for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(jOH_xLUPLo54[_9geoGcnIrQ_])):
fW87nYwGs7V5 = jOH_xLUPLo54[_9geoGcnIrQ_][ZlbFMSG8gCoF]
if fW87nYwGs7V5[nzTpIcepk0o8('\060' + chr(0b1101111) + chr(2323 - 2274), 8)] < DfHNq_TQ8eKD[nzTpIcepk0o8(chr(48) + chr(111) + chr(49), 8)]:
roI3spqORKae(jOH_xLUPLo54[_9geoGcnIrQ_], roI3spqORKae(ES5oEprVxulp(b'h\xdc\x02\xba\x05\xa0'), chr(0b11111 + 0o105) + chr(0b1100101) + '\143' + chr(0b101000 + 0o107) + chr(0b11111 + 0o105) + chr(0b1100 + 0o131))(chr(834 - 717) + chr(116) + chr(0b1100110) + chr(0b101010 + 0o3) + chr(0b1000 + 0o60)))(ZlbFMSG8gCoF, DfHNq_TQ8eKD)
PkBZ_DUDTDT8 = nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49), 8)
break
elif fW87nYwGs7V5[nzTpIcepk0o8('\060' + chr(0b1101111) + chr(101 - 52), 8)] == DfHNq_TQ8eKD[nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1303 - 1254), 8)] and fW87nYwGs7V5[nzTpIcepk0o8('\060' + chr(111) + chr(0b110010), 8)] < DfHNq_TQ8eKD[nzTpIcepk0o8(chr(0b100 + 0o54) + chr(111) + '\x32', 8)]:
roI3spqORKae(jOH_xLUPLo54[_9geoGcnIrQ_], roI3spqORKae(ES5oEprVxulp(b'h\xdc\x02\xba\x05\xa0'), chr(100) + chr(0b1100101) + chr(0b1011000 + 0o13) + chr(0b110010 + 0o75) + chr(0b1100100) + chr(101))('\x75' + chr(116) + chr(6422 - 6320) + chr(45) + chr(56)))(ZlbFMSG8gCoF, DfHNq_TQ8eKD)
PkBZ_DUDTDT8 = nzTpIcepk0o8(chr(0b10 + 0o56) + '\x6f' + '\061', 8)
break
if not PkBZ_DUDTDT8:
roI3spqORKae(jOH_xLUPLo54[_9geoGcnIrQ_], roI3spqORKae(ES5oEprVxulp(b'I\xe6"\xeb\x0f\xb3"\x9e\xb3\xe4\xd9\x88'), chr(100) + chr(5777 - 5676) + chr(0b111001 + 0o52) + chr(0b1101111) + chr(100) + chr(2808 - 2707))(chr(2640 - 2523) + chr(0b1110010 + 0o2) + '\146' + chr(0b101101) + chr(0b111000)))(DfHNq_TQ8eKD)
return jOH_xLUPLo54
|
estnltk/estnltk
|
estnltk/prettyprinter/terminalprettyprinter.py
|
_fix_overlapping_graphics
|
def _fix_overlapping_graphics( spansStartingFrom ):
''' Provides a fix for overlapping annotations that are formatted graphically
(underlined or printed in non-default color).
If two graphically formatted annotations overlap, and if one annotation,
say A, ends within another annotation, say B, then ending of graphics of A
also causes graphics of B to end, and so, the end of A should restart the
the graphics of B for a continuous visualisation;
This method modifies ending tags in a way that annotations ending within
other annotations will also contain restarts of the corresponding (super)-
annotations, so that a continuous formatting is ensured.
'''
for startIndex in sorted( spansStartingFrom.keys() ):
for span1 in spansStartingFrom[startIndex]:
# If the span is not graphic, we don't have no worries - we can just skip it
if not span1[5]:
continue
# Otherwise: check for other graphic spans that overlap with the given span
span1Start = span1[0]
span1End = span1[1]
for i in range( span1Start, span1End ):
if i in spansStartingFrom:
for span2 in spansStartingFrom[i]:
span2Start = span2[0]
span2End = span2[1]
# If the spans are not the same, and the span2 is graphic
if span2 != span1 and span2[5]:
# if the overlapping graphic span ends before the current span,
# we have to restart the graphic formatting of given span after
# the end of the overlapping span
if span2End <= span1End:
if not span1[6]:
# If span1 is not bracketed, just add it at the end of
# the overlapping span
span2[4] += span1[3]
else:
# If span1 is bracketed, add it at the end of the
# overlapping span without brackets
wb = span1[3].rstrip('[')
span2[4] += wb
|
python
|
def _fix_overlapping_graphics( spansStartingFrom ):
''' Provides a fix for overlapping annotations that are formatted graphically
(underlined or printed in non-default color).
If two graphically formatted annotations overlap, and if one annotation,
say A, ends within another annotation, say B, then ending of graphics of A
also causes graphics of B to end, and so, the end of A should restart the
the graphics of B for a continuous visualisation;
This method modifies ending tags in a way that annotations ending within
other annotations will also contain restarts of the corresponding (super)-
annotations, so that a continuous formatting is ensured.
'''
for startIndex in sorted( spansStartingFrom.keys() ):
for span1 in spansStartingFrom[startIndex]:
# If the span is not graphic, we don't have no worries - we can just skip it
if not span1[5]:
continue
# Otherwise: check for other graphic spans that overlap with the given span
span1Start = span1[0]
span1End = span1[1]
for i in range( span1Start, span1End ):
if i in spansStartingFrom:
for span2 in spansStartingFrom[i]:
span2Start = span2[0]
span2End = span2[1]
# If the spans are not the same, and the span2 is graphic
if span2 != span1 and span2[5]:
# if the overlapping graphic span ends before the current span,
# we have to restart the graphic formatting of given span after
# the end of the overlapping span
if span2End <= span1End:
if not span1[6]:
# If span1 is not bracketed, just add it at the end of
# the overlapping span
span2[4] += span1[3]
else:
# If span1 is bracketed, add it at the end of the
# overlapping span without brackets
wb = span1[3].rstrip('[')
span2[4] += wb
|
[
"def",
"_fix_overlapping_graphics",
"(",
"spansStartingFrom",
")",
":",
"for",
"startIndex",
"in",
"sorted",
"(",
"spansStartingFrom",
".",
"keys",
"(",
")",
")",
":",
"for",
"span1",
"in",
"spansStartingFrom",
"[",
"startIndex",
"]",
":",
"# If the span is not graphic, we don't have no worries - we can just skip it\r",
"if",
"not",
"span1",
"[",
"5",
"]",
":",
"continue",
"# Otherwise: check for other graphic spans that overlap with the given span\r",
"span1Start",
"=",
"span1",
"[",
"0",
"]",
"span1End",
"=",
"span1",
"[",
"1",
"]",
"for",
"i",
"in",
"range",
"(",
"span1Start",
",",
"span1End",
")",
":",
"if",
"i",
"in",
"spansStartingFrom",
":",
"for",
"span2",
"in",
"spansStartingFrom",
"[",
"i",
"]",
":",
"span2Start",
"=",
"span2",
"[",
"0",
"]",
"span2End",
"=",
"span2",
"[",
"1",
"]",
"# If the spans are not the same, and the span2 is graphic\r",
"if",
"span2",
"!=",
"span1",
"and",
"span2",
"[",
"5",
"]",
":",
"# if the overlapping graphic span ends before the current span,\r",
"# we have to restart the graphic formatting of given span after \r",
"# the end of the overlapping span\r",
"if",
"span2End",
"<=",
"span1End",
":",
"if",
"not",
"span1",
"[",
"6",
"]",
":",
"# If span1 is not bracketed, just add it at the end of\r",
"# the overlapping span\r",
"span2",
"[",
"4",
"]",
"+=",
"span1",
"[",
"3",
"]",
"else",
":",
"# If span1 is bracketed, add it at the end of the \r",
"# overlapping span without brackets\r",
"wb",
"=",
"span1",
"[",
"3",
"]",
".",
"rstrip",
"(",
"'['",
")",
"span2",
"[",
"4",
"]",
"+=",
"wb"
] |
Provides a fix for overlapping annotations that are formatted graphically
(underlined or printed in non-default color).
If two graphically formatted annotations overlap, and if one annotation,
say A, ends within another annotation, say B, then ending of graphics of A
also causes graphics of B to end, and so, the end of A should restart the
the graphics of B for a continuous visualisation;
This method modifies ending tags in a way that annotations ending within
other annotations will also contain restarts of the corresponding (super)-
annotations, so that a continuous formatting is ensured.
|
[
"Provides",
"a",
"fix",
"for",
"overlapping",
"annotations",
"that",
"are",
"formatted",
"graphically",
"(",
"underlined",
"or",
"printed",
"in",
"non",
"-",
"default",
"color",
")",
".",
"If",
"two",
"graphically",
"formatted",
"annotations",
"overlap",
"and",
"if",
"one",
"annotation",
"say",
"A",
"ends",
"within",
"another",
"annotation",
"say",
"B",
"then",
"ending",
"of",
"graphics",
"of",
"A",
"also",
"causes",
"graphics",
"of",
"B",
"to",
"end",
"and",
"so",
"the",
"end",
"of",
"A",
"should",
"restart",
"the",
"the",
"graphics",
"of",
"B",
"for",
"a",
"continuous",
"visualisation",
";",
"This",
"method",
"modifies",
"ending",
"tags",
"in",
"a",
"way",
"that",
"annotations",
"ending",
"within",
"other",
"annotations",
"will",
"also",
"contain",
"restarts",
"of",
"the",
"corresponding",
"(",
"super",
")",
"-",
"annotations",
"so",
"that",
"a",
"continuous",
"formatting",
"is",
"ensured",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/terminalprettyprinter.py#L257-L296
|
train
|
Provides a fix for overlapping graphic annotations that are formatted graphically with non - default color.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIO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rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b0 + 0o60) + '\157' + '\x31' + '\x36' + chr(0b10010 + 0o44), ord("\x08")), nzTpIcepk0o8('\x30' + chr(9159 - 9048) + '\063' + chr(2358 - 2307) + chr(0b110001), 0o10), nzTpIcepk0o8('\060' + chr(0b101010 + 0o105) + chr(0b110010 + 0o1) + chr(2244 - 2190) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + chr(54) + '\x34', 6892 - 6884), nzTpIcepk0o8(chr(0b110000) + chr(0b101001 + 0o106) + chr(0b110011) + chr(0b1111 + 0o44) + chr(53), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b101 + 0o152) + chr(1394 - 1343) + chr(54) + chr(0b1 + 0o60), 8), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + '\x33', 21492 - 21484), nzTpIcepk0o8('\060' + chr(11400 - 11289) + chr(0b101110 + 0o5) + chr(0b110101), 42860 - 42852), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(50) + '\x35' + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(10730 - 10619) + chr(0b1010 + 0o51) + chr(55) + chr(55), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + '\x37' + '\062', 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x32' + chr(49) + chr(598 - 544), 0b1000), nzTpIcepk0o8(chr(263 - 215) + chr(111) + chr(0b1001 + 0o51) + chr(1695 - 1645) + '\x32', 0o10), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101111) + chr(51) + chr(0b100 + 0o61) + '\x37', 31160 - 31152), nzTpIcepk0o8('\x30' + '\x6f' + '\x33' + chr(0b110010) + '\x36', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b1111 + 0o46) + chr(734 - 682), 0o10), nzTpIcepk0o8(chr(0b11000 + 0o30) + '\157' + '\062' + chr(0b1001 + 0o47) + chr(103 - 48), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x31' + chr(1550 - 1501) + chr(51), 0b1000), nzTpIcepk0o8(chr(1564 - 1516) + chr(0b110111 + 0o70) + chr(406 - 356) + chr(0b11110 + 0o25) + chr(0b10001 + 0o44), ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b100000 + 0o117) + chr(2220 - 2166) + '\x36', 59740 - 59732), nzTpIcepk0o8(chr(0b110000) + chr(0b10 + 0o155) + chr(0b110011) + '\066' + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + chr(51) + chr(0b101110 + 0o5) + '\x36', 3741 - 3733), nzTpIcepk0o8(chr(1779 - 1731) + '\x6f' + chr(0b101 + 0o54) + '\x30' + chr(51), 0b1000), nzTpIcepk0o8('\060' + chr(1899 - 1788) + '\x33' + '\x33' + chr(0b110111), 0o10), nzTpIcepk0o8(chr(1559 - 1511) + chr(111) + chr(0b0 + 0o61) + '\065' + chr(54), 0o10), nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b1000011 + 0o54) + '\063' + chr(0b100011 + 0o21) + '\064', 24355 - 24347), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(0b1101111) + chr(50) + chr(0b110110) + chr(1278 - 1225), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(52) + chr(48), 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(7137 - 7026) + chr(1444 - 1393) + chr(0b110111 + 0o0) + chr(49), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + chr(0b110000) + chr(0b10101 + 0o41), 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + '\060' + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1010111 + 0o30) + chr(1861 - 1811) + '\x37' + chr(48), 0o10), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\x6f' + chr(0b110001) + chr(0b110010) + chr(48), 0b1000), nzTpIcepk0o8('\060' + chr(670 - 559) + '\x34' + chr(577 - 525), 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + chr(0b10011 + 0o36) + chr(0b110101 + 0o2) + '\060', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b1000 + 0o51) + '\x31' + chr(0b11100 + 0o30), 0o10), nzTpIcepk0o8(chr(767 - 719) + '\157' + chr(0b101010 + 0o7) + chr(55) + '\x30', 8), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\x6f' + '\x36' + '\062', ord("\x08")), nzTpIcepk0o8('\060' + chr(1530 - 1419) + chr(0b11110 + 0o25) + chr(847 - 792) + '\061', 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(257 - 209) + '\157' + chr(0b110101) + '\060', ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'X'), '\x64' + '\145' + chr(0b1000 + 0o133) + chr(0b1101111) + '\144' + '\x65')('\165' + chr(0b11101 + 0o127) + chr(0b1001001 + 0o35) + '\x2d' + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def zx0mejziW2nX(zDDta06N6DAG):
for AVHOn6lRvdKR in V3OlOVg98A85(roI3spqORKae(zDDta06N6DAG, roI3spqORKae(ES5oEprVxulp(b'\x1d\xbc\x88\xc7'), chr(0b1100100) + '\x65' + '\143' + chr(0b1101 + 0o142) + chr(4313 - 4213) + '\145')(chr(0b1110101) + chr(7303 - 7187) + chr(0b1100110) + chr(0b11 + 0o52) + chr(0b111000)))()):
for prb0Dn7yGbpq in zDDta06N6DAG[AVHOn6lRvdKR]:
if not prb0Dn7yGbpq[nzTpIcepk0o8('\060' + '\x6f' + chr(379 - 326), 13793 - 13785)]:
continue
zb6Z6NuHZUSZ = prb0Dn7yGbpq[nzTpIcepk0o8('\060' + '\x6f' + chr(48), 25975 - 25967)]
YBC3KntQfr_3 = prb0Dn7yGbpq[nzTpIcepk0o8(chr(548 - 500) + chr(0b110000 + 0o77) + chr(49), 0o10)]
for ZlbFMSG8gCoF in bbT2xIe5pzk7(zb6Z6NuHZUSZ, YBC3KntQfr_3):
if ZlbFMSG8gCoF in zDDta06N6DAG:
for l2kgRlYa9rts in zDDta06N6DAG[ZlbFMSG8gCoF]:
GHOCiTMJ6C2H = l2kgRlYa9rts[nzTpIcepk0o8(chr(562 - 514) + '\x6f' + '\060', 8)]
OtxuQeHfsIJY = l2kgRlYa9rts[nzTpIcepk0o8(chr(0b100 + 0o54) + '\157' + chr(49), 8)]
if l2kgRlYa9rts != prb0Dn7yGbpq and l2kgRlYa9rts[nzTpIcepk0o8('\060' + '\x6f' + '\x35', 8)]:
if OtxuQeHfsIJY <= YBC3KntQfr_3:
if not prb0Dn7yGbpq[nzTpIcepk0o8('\060' + chr(0b1000110 + 0o51) + '\066', 0o10)]:
l2kgRlYa9rts[nzTpIcepk0o8('\060' + '\157' + chr(0b110100), 49616 - 49608)] += prb0Dn7yGbpq[nzTpIcepk0o8('\x30' + chr(4651 - 4540) + '\063', 0b1000)]
else:
wlHb9hja4SFe = prb0Dn7yGbpq[nzTpIcepk0o8(chr(48) + chr(111) + chr(226 - 175), 8)].rstrip(roI3spqORKae(ES5oEprVxulp(b'-'), chr(0b1010010 + 0o22) + '\x65' + '\x63' + '\157' + chr(6446 - 6346) + chr(0b1011 + 0o132))(chr(117) + '\x74' + chr(2152 - 2050) + '\055' + '\070'))
l2kgRlYa9rts[nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001 + 0o3), 8)] += wlHb9hja4SFe
|
estnltk/estnltk
|
estnltk/prettyprinter/terminalprettyprinter.py
|
_preformat
|
def _preformat( text, layers, markup_settings = None ):
''' Formats given text, adding a special ( ANSI-terminal compatible ) markup
to the annotations of given layers, and returns formatted text as a
string.
*) layers is a list containing names of the layers to be preformatted in
the text (these layers must be present in Text);
*) markup_settings should be a list containing annotation options for each
layer: one dict with options per layer;
One dict can contain the following visualization options:
* 'bracket' : True -- annotations will be surrounded with brackets; This
works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in ANSI
compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color; this works in ANSI compatible
terminal;
*) Alternatively, if markup_settings is undefined, up to 12 layers can be
visualized following the default settings;
Parameters
----------
text: Text
a text object. Must contain given layers;
layer: list of str
list of layer names to be visualised;
markup_settings: list of dict
list of dictionaries containing user-defined visualization options;
(one dict per layer)
Returns
-------
text: str
preformatted text, where elements of given layers have been marked up, using
an ANSI-terminal compatible markup;
'''
if markup_settings and len(layers) != len(markup_settings):
raise Exception(' Input arguments layers and markup_settings should be equal size lists.')
elif not markup_settings and len(layers) <= len(default_markup_settings):
# Use default markup settings
markup_settings = default_markup_settings[0:len(layers)]
elif not markup_settings:
raise Exception(' Input argument markup_settings not defined.')
#
# 1) Construct the index of annotations (for each layer);
# Annotations are indexed by their start positions;
# The index also contains start and end tags of each annotation;
spansStartingFrom = {}
for i in range( len(layers) ):
layer = layers[i]
settings = markup_settings[i]
spansStartingFrom = _construct_start_index(text, layer, settings, spansStartingFrom)
#
# 2) Fix overlapping graphic annotations in the index
# (to ensure continuous formatting of annotations)
_fix_overlapping_graphics( spansStartingFrom )
#
# 3) Index the annotations by their end positions
endTags = _construct_end_index( spansStartingFrom )
#
# 4) Construct the output string
return_str = []
for i in range( len(text[TEXT]) ):
c = text[TEXT][i]
emptyTags = []
if i in endTags:
for tag in endTags[i]:
if tag[1] != i:
# Non-empty tag
return_str.append( tag[0] )
else:
# Empty tag
emptyTags.append( tag )
if i in spansStartingFrom:
for span in spansStartingFrom[i]:
return_str.append( span[3] )
if span[0] == span[1]:
# Empty tag: Add the closing tag
for emptyEndTag in emptyTags:
if span[2] == emptyEndTag[2]:
return_str.append( emptyEndTag[0] )
return_str.append( c )
if len(text[TEXT]) in spansStartingFrom:
for span in spansStartingFrom[len(text[TEXT])]:
return_str.append( span[3] )
if len(text[TEXT]) in endTags:
for tag in endTags[len(text[TEXT])]:
return_str.append( tag[0] )
# Hack: fix for a potential overflow / unclosed graphics
if return_str and '\033' in return_str[-1] and \
not return_str[-1].endswith('\033[0m'):
return_str.append( '\033[0m' )
return ''.join(return_str)
|
python
|
def _preformat( text, layers, markup_settings = None ):
''' Formats given text, adding a special ( ANSI-terminal compatible ) markup
to the annotations of given layers, and returns formatted text as a
string.
*) layers is a list containing names of the layers to be preformatted in
the text (these layers must be present in Text);
*) markup_settings should be a list containing annotation options for each
layer: one dict with options per layer;
One dict can contain the following visualization options:
* 'bracket' : True -- annotations will be surrounded with brackets; This
works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in ANSI
compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color; this works in ANSI compatible
terminal;
*) Alternatively, if markup_settings is undefined, up to 12 layers can be
visualized following the default settings;
Parameters
----------
text: Text
a text object. Must contain given layers;
layer: list of str
list of layer names to be visualised;
markup_settings: list of dict
list of dictionaries containing user-defined visualization options;
(one dict per layer)
Returns
-------
text: str
preformatted text, where elements of given layers have been marked up, using
an ANSI-terminal compatible markup;
'''
if markup_settings and len(layers) != len(markup_settings):
raise Exception(' Input arguments layers and markup_settings should be equal size lists.')
elif not markup_settings and len(layers) <= len(default_markup_settings):
# Use default markup settings
markup_settings = default_markup_settings[0:len(layers)]
elif not markup_settings:
raise Exception(' Input argument markup_settings not defined.')
#
# 1) Construct the index of annotations (for each layer);
# Annotations are indexed by their start positions;
# The index also contains start and end tags of each annotation;
spansStartingFrom = {}
for i in range( len(layers) ):
layer = layers[i]
settings = markup_settings[i]
spansStartingFrom = _construct_start_index(text, layer, settings, spansStartingFrom)
#
# 2) Fix overlapping graphic annotations in the index
# (to ensure continuous formatting of annotations)
_fix_overlapping_graphics( spansStartingFrom )
#
# 3) Index the annotations by their end positions
endTags = _construct_end_index( spansStartingFrom )
#
# 4) Construct the output string
return_str = []
for i in range( len(text[TEXT]) ):
c = text[TEXT][i]
emptyTags = []
if i in endTags:
for tag in endTags[i]:
if tag[1] != i:
# Non-empty tag
return_str.append( tag[0] )
else:
# Empty tag
emptyTags.append( tag )
if i in spansStartingFrom:
for span in spansStartingFrom[i]:
return_str.append( span[3] )
if span[0] == span[1]:
# Empty tag: Add the closing tag
for emptyEndTag in emptyTags:
if span[2] == emptyEndTag[2]:
return_str.append( emptyEndTag[0] )
return_str.append( c )
if len(text[TEXT]) in spansStartingFrom:
for span in spansStartingFrom[len(text[TEXT])]:
return_str.append( span[3] )
if len(text[TEXT]) in endTags:
for tag in endTags[len(text[TEXT])]:
return_str.append( tag[0] )
# Hack: fix for a potential overflow / unclosed graphics
if return_str and '\033' in return_str[-1] and \
not return_str[-1].endswith('\033[0m'):
return_str.append( '\033[0m' )
return ''.join(return_str)
|
[
"def",
"_preformat",
"(",
"text",
",",
"layers",
",",
"markup_settings",
"=",
"None",
")",
":",
"if",
"markup_settings",
"and",
"len",
"(",
"layers",
")",
"!=",
"len",
"(",
"markup_settings",
")",
":",
"raise",
"Exception",
"(",
"' Input arguments layers and markup_settings should be equal size lists.'",
")",
"elif",
"not",
"markup_settings",
"and",
"len",
"(",
"layers",
")",
"<=",
"len",
"(",
"default_markup_settings",
")",
":",
"# Use default markup settings\r",
"markup_settings",
"=",
"default_markup_settings",
"[",
"0",
":",
"len",
"(",
"layers",
")",
"]",
"elif",
"not",
"markup_settings",
":",
"raise",
"Exception",
"(",
"' Input argument markup_settings not defined.'",
")",
"#\r",
"# 1) Construct the index of annotations (for each layer); \r",
"# Annotations are indexed by their start positions;\r",
"# The index also contains start and end tags of each annotation;\r",
"spansStartingFrom",
"=",
"{",
"}",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"layers",
")",
")",
":",
"layer",
"=",
"layers",
"[",
"i",
"]",
"settings",
"=",
"markup_settings",
"[",
"i",
"]",
"spansStartingFrom",
"=",
"_construct_start_index",
"(",
"text",
",",
"layer",
",",
"settings",
",",
"spansStartingFrom",
")",
"#\r",
"# 2) Fix overlapping graphic annotations in the index\r",
"# (to ensure continuous formatting of annotations)\r",
"_fix_overlapping_graphics",
"(",
"spansStartingFrom",
")",
"#\r",
"# 3) Index the annotations by their end positions\r",
"endTags",
"=",
"_construct_end_index",
"(",
"spansStartingFrom",
")",
"#\r",
"# 4) Construct the output string\r",
"return_str",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"text",
"[",
"TEXT",
"]",
")",
")",
":",
"c",
"=",
"text",
"[",
"TEXT",
"]",
"[",
"i",
"]",
"emptyTags",
"=",
"[",
"]",
"if",
"i",
"in",
"endTags",
":",
"for",
"tag",
"in",
"endTags",
"[",
"i",
"]",
":",
"if",
"tag",
"[",
"1",
"]",
"!=",
"i",
":",
"# Non-empty tag\r",
"return_str",
".",
"append",
"(",
"tag",
"[",
"0",
"]",
")",
"else",
":",
"# Empty tag\r",
"emptyTags",
".",
"append",
"(",
"tag",
")",
"if",
"i",
"in",
"spansStartingFrom",
":",
"for",
"span",
"in",
"spansStartingFrom",
"[",
"i",
"]",
":",
"return_str",
".",
"append",
"(",
"span",
"[",
"3",
"]",
")",
"if",
"span",
"[",
"0",
"]",
"==",
"span",
"[",
"1",
"]",
":",
"# Empty tag: Add the closing tag\r",
"for",
"emptyEndTag",
"in",
"emptyTags",
":",
"if",
"span",
"[",
"2",
"]",
"==",
"emptyEndTag",
"[",
"2",
"]",
":",
"return_str",
".",
"append",
"(",
"emptyEndTag",
"[",
"0",
"]",
")",
"return_str",
".",
"append",
"(",
"c",
")",
"if",
"len",
"(",
"text",
"[",
"TEXT",
"]",
")",
"in",
"spansStartingFrom",
":",
"for",
"span",
"in",
"spansStartingFrom",
"[",
"len",
"(",
"text",
"[",
"TEXT",
"]",
")",
"]",
":",
"return_str",
".",
"append",
"(",
"span",
"[",
"3",
"]",
")",
"if",
"len",
"(",
"text",
"[",
"TEXT",
"]",
")",
"in",
"endTags",
":",
"for",
"tag",
"in",
"endTags",
"[",
"len",
"(",
"text",
"[",
"TEXT",
"]",
")",
"]",
":",
"return_str",
".",
"append",
"(",
"tag",
"[",
"0",
"]",
")",
"# Hack: fix for a potential overflow / unclosed graphics\r",
"if",
"return_str",
"and",
"'\\033'",
"in",
"return_str",
"[",
"-",
"1",
"]",
"and",
"not",
"return_str",
"[",
"-",
"1",
"]",
".",
"endswith",
"(",
"'\\033[0m'",
")",
":",
"return_str",
".",
"append",
"(",
"'\\033[0m'",
")",
"return",
"''",
".",
"join",
"(",
"return_str",
")"
] |
Formats given text, adding a special ( ANSI-terminal compatible ) markup
to the annotations of given layers, and returns formatted text as a
string.
*) layers is a list containing names of the layers to be preformatted in
the text (these layers must be present in Text);
*) markup_settings should be a list containing annotation options for each
layer: one dict with options per layer;
One dict can contain the following visualization options:
* 'bracket' : True -- annotations will be surrounded with brackets; This
works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in ANSI
compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color; this works in ANSI compatible
terminal;
*) Alternatively, if markup_settings is undefined, up to 12 layers can be
visualized following the default settings;
Parameters
----------
text: Text
a text object. Must contain given layers;
layer: list of str
list of layer names to be visualised;
markup_settings: list of dict
list of dictionaries containing user-defined visualization options;
(one dict per layer)
Returns
-------
text: str
preformatted text, where elements of given layers have been marked up, using
an ANSI-terminal compatible markup;
|
[
"Formats",
"given",
"text",
"adding",
"a",
"special",
"(",
"ANSI",
"-",
"terminal",
"compatible",
")",
"markup",
"to",
"the",
"annotations",
"of",
"given",
"layers",
"and",
"returns",
"formatted",
"text",
"as",
"a",
"string",
".",
"*",
")",
"layers",
"is",
"a",
"list",
"containing",
"names",
"of",
"the",
"layers",
"to",
"be",
"preformatted",
"in",
"the",
"text",
"(",
"these",
"layers",
"must",
"be",
"present",
"in",
"Text",
")",
";",
"*",
")",
"markup_settings",
"should",
"be",
"a",
"list",
"containing",
"annotation",
"options",
"for",
"each",
"layer",
":",
"one",
"dict",
"with",
"options",
"per",
"layer",
";",
"One",
"dict",
"can",
"contain",
"the",
"following",
"visualization",
"options",
":",
"*",
"bracket",
":",
"True",
"--",
"annotations",
"will",
"be",
"surrounded",
"with",
"brackets",
";",
"This",
"works",
"in",
"any",
"terminal",
";",
"*",
"underline",
":",
"True",
"--",
"annotations",
"will",
"be",
"underlined",
";",
"This",
"works",
"in",
"ANSI",
"compatible",
"terminal",
";",
"*",
"color",
":",
"(",
"red",
"green",
"blue",
"etc",
".",
")",
"--",
"annotated",
"text",
"will",
"be",
"displayed",
"in",
"given",
"color",
";",
"this",
"works",
"in",
"ANSI",
"compatible",
"terminal",
";",
"*",
")",
"Alternatively",
"if",
"markup_settings",
"is",
"undefined",
"up",
"to",
"12",
"layers",
"can",
"be",
"visualized",
"following",
"the",
"default",
"settings",
";",
"Parameters",
"----------",
"text",
":",
"Text",
"a",
"text",
"object",
".",
"Must",
"contain",
"given",
"layers",
";",
"layer",
":",
"list",
"of",
"str",
"list",
"of",
"layer",
"names",
"to",
"be",
"visualised",
";",
"markup_settings",
":",
"list",
"of",
"dict",
"list",
"of",
"dictionaries",
"containing",
"user",
"-",
"defined",
"visualization",
"options",
";",
"(",
"one",
"dict",
"per",
"layer",
")",
"Returns",
"-------",
"text",
":",
"str",
"preformatted",
"text",
"where",
"elements",
"of",
"given",
"layers",
"have",
"been",
"marked",
"up",
"using",
"an",
"ANSI",
"-",
"terminal",
"compatible",
"markup",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/terminalprettyprinter.py#L317-L409
|
train
|
Formats given text with special markups.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVz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c5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1101101 + 0o2) + '\x32' + '\x37' + chr(0b110111), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(2307 - 2258) + '\065' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49) + '\x31' + chr(0b101 + 0o60), ord("\x08")), nzTpIcepk0o8('\x30' + chr(10485 - 10374) + '\x36' + chr(53), 0b1000), nzTpIcepk0o8(chr(0b101110 + 0o2) + '\157' + chr(49) + chr(0b110011) + chr(632 - 580), 60984 - 60976), nzTpIcepk0o8(chr(48) + chr(4738 - 4627) + chr(0b110010) + chr(0b10000 + 0o42) + chr(0b11001 + 0o32), 0o10), nzTpIcepk0o8(chr(210 - 162) + chr(0b1101111) + chr(0b1000 + 0o53) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1001010 + 0o45) + chr(0b110011) + chr(2667 - 2614) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(121 - 10) + '\x32' + '\x34', 0o10), nzTpIcepk0o8('\060' + chr(0b1010100 + 0o33) + '\061' + '\x31' + chr(1265 - 1215), 0b1000), nzTpIcepk0o8(chr(48) + chr(6851 - 6740) + chr(51) + '\x32' + chr(1040 - 991), 40090 - 40082), nzTpIcepk0o8(chr(0b101110 + 0o2) + chr(0b1101111) + chr(0b110011) + chr(0b11111 + 0o21) + '\067', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011 + 0o0) + '\x37' + chr(0b110010 + 0o2), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(51) + chr(50) + chr(1211 - 1160), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\061' + '\061' + chr(647 - 597), 8), nzTpIcepk0o8('\060' + chr(111) + '\061' + chr(54) + '\063', 57171 - 57163), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(55) + '\x37', 0o10), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\x6f' + '\x31' + chr(0b101 + 0o53) + chr(2731 - 2677), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1100001 + 0o16) + '\x32' + chr(1412 - 1357) + chr(0b110011 + 0o3), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110100) + chr(317 - 264), 11959 - 11951), nzTpIcepk0o8('\x30' + chr(11006 - 10895) + '\x33' + chr(50) + chr(1263 - 1214), 8), nzTpIcepk0o8(chr(48) + chr(0b1100000 + 0o17) + '\x33' + '\065' + chr(49), 0o10), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(111) + chr(1498 - 1447) + chr(0b110100) + chr(307 - 258), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + '\x31' + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(266 - 218) + chr(0b10001 + 0o136) + '\067', 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100101 + 0o14) + '\063' + '\064', 8), nzTpIcepk0o8(chr(226 - 178) + '\x6f' + chr(50) + chr(0b110101) + chr(48), 31295 - 31287), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + chr(49) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(48) + chr(1130 - 1019) + chr(2159 - 2109) + chr(49) + chr(52), 0b1000), nzTpIcepk0o8(chr(2162 - 2114) + '\157' + '\061' + chr(0b11111 + 0o30) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(51) + chr(55) + '\064', 8), nzTpIcepk0o8(chr(1570 - 1522) + chr(111) + '\061' + chr(0b11000 + 0o34) + '\060', 0o10), nzTpIcepk0o8(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b10010 + 0o40) + '\x30' + chr(0b100101 + 0o15), 0o10), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\157' + '\x32' + chr(0b101001 + 0o7) + chr(318 - 270), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(4011 - 3900) + chr(0b0 + 0o65) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(881 - 833) + chr(0b1101111) + '\061' + '\065' + chr(0b110010), 0b1000), nzTpIcepk0o8('\060' + chr(8517 - 8406) + '\062', 5231 - 5223), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x37' + chr(2218 - 2165), 0b1000), nzTpIcepk0o8(chr(672 - 624) + chr(571 - 460) + '\067' + chr(50), 61303 - 61295), nzTpIcepk0o8(chr(2024 - 1976) + '\x6f' + chr(49) + chr(55) + chr(2050 - 2002), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + '\x35' + chr(1786 - 1738), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x91'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(101))('\x75' + '\x74' + '\x66' + '\055' + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def YttOqdODURDF(cpStk7cY1TJd, e_hUOKXrf_W9, z29Q35YDgq4u=None):
if z29Q35YDgq4u and ftfygxgFas5X(e_hUOKXrf_W9) != ftfygxgFas5X(z29Q35YDgq4u):
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b"\x9f'#E)\xe7=\x8cf-\xa4\xaa\x99\xbd>\x00_*\xdf\\\xb4\x9b\x92\xaef2\xcc\xaf\xe1\x1f\x8e\x0b\xf7\xf0v\x19gIN\x11\xd1\t>\x15/\xfbr\x98x.\xf1\xa5\x99\xf3/\x02\n'\xd2\x05\xa2\x80\x9b\xeb'0\xc1\xfc\xf8\r\xd2"), chr(0b10110 + 0o116) + chr(0b1010001 + 0o24) + chr(0b1100011) + chr(111) + chr(3920 - 3820) + '\x65')('\x75' + chr(7147 - 7031) + '\x66' + '\x2d' + chr(0b100111 + 0o21)))
elif not z29Q35YDgq4u and ftfygxgFas5X(e_hUOKXrf_W9) <= ftfygxgFas5X(jwX2wrezCooC):
z29Q35YDgq4u = jwX2wrezCooC[nzTpIcepk0o8(chr(0b110000) + chr(10415 - 10304) + '\060', 0o10):ftfygxgFas5X(e_hUOKXrf_W9)]
elif not z29Q35YDgq4u:
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b"\x9f'#E)\xe7=\x8cf-\xa4\xaa\x99\xbd>S\x12'\xccN\xa4\x99\xbe\xfdb(\xdc\xe6\xe2\x19\x8f@\xec\xef]JfX\\\x11\xd1\x0b)\x1b"), chr(0b1000100 + 0o40) + '\x65' + chr(99) + '\x6f' + '\x64' + '\x65')(chr(0b1010100 + 0o41) + chr(0b1110100) + '\x66' + '\x2d' + chr(0b11111 + 0o31)))
zDDta06N6DAG = {}
for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(e_hUOKXrf_W9)):
GHz9Ad9ZLlU5 = e_hUOKXrf_W9[ZlbFMSG8gCoF]
tlZFbd_9MN8s = z29Q35YDgq4u[ZlbFMSG8gCoF]
zDDta06N6DAG = hjAy_Efhrb_Y(cpStk7cY1TJd, GHz9Ad9ZLlU5, tlZFbd_9MN8s, zDDta06N6DAG)
zx0mejziW2nX(zDDta06N6DAG)
oIGkTtH81yq4 = MGsGxYlbESax(zDDta06N6DAG)
Al4lDJpR9SvQ = []
for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(cpStk7cY1TJd[JPzDaf6_RoFd])):
teUmM7cKWZUa = cpStk7cY1TJd[JPzDaf6_RoFd][ZlbFMSG8gCoF]
uCdlNRfesy8u = []
if ZlbFMSG8gCoF in oIGkTtH81yq4:
for A0gVABhHjc3L in oIGkTtH81yq4[ZlbFMSG8gCoF]:
if A0gVABhHjc3L[nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(2966 - 2855) + chr(0b11000 + 0o31), ord("\x08"))] != ZlbFMSG8gCoF:
roI3spqORKae(Al4lDJpR9SvQ, roI3spqORKae(ES5oEprVxulp(b'\xf7:\x1e\x01$\xf4Z\x82~%\x84\xf2'), '\144' + chr(2236 - 2135) + '\143' + chr(0b11011 + 0o124) + chr(0b1100100) + chr(0b1100101))(chr(13417 - 13300) + chr(116) + '\146' + chr(45) + chr(0b111000)))(A0gVABhHjc3L[nzTpIcepk0o8(chr(616 - 568) + '\x6f' + chr(0b110000), 8)])
else:
roI3spqORKae(uCdlNRfesy8u, roI3spqORKae(ES5oEprVxulp(b'\xf7:\x1e\x01$\xf4Z\x82~%\x84\xf2'), '\144' + chr(0b1100101) + chr(0b101100 + 0o67) + chr(111) + '\144' + '\145')(chr(0b1110101) + '\x74' + '\x66' + chr(45) + chr(0b101011 + 0o15)))(A0gVABhHjc3L)
if ZlbFMSG8gCoF in zDDta06N6DAG:
for YE_goZOOqWUi in zDDta06N6DAG[ZlbFMSG8gCoF]:
roI3spqORKae(Al4lDJpR9SvQ, roI3spqORKae(ES5oEprVxulp(b'\xf7:\x1e\x01$\xf4Z\x82~%\x84\xf2'), chr(100) + chr(10168 - 10067) + '\x63' + chr(111) + chr(100) + '\145')(chr(0b1110101) + chr(0b1001010 + 0o52) + chr(0b11 + 0o143) + chr(2021 - 1976) + chr(0b111000)))(YE_goZOOqWUi[nzTpIcepk0o8(chr(410 - 362) + chr(111) + chr(0b110011), 0o10)])
if YE_goZOOqWUi[nzTpIcepk0o8('\x30' + chr(4012 - 3901) + chr(0b1111 + 0o41), 8)] == YE_goZOOqWUi[nzTpIcepk0o8('\x30' + '\157' + '\x31', 8)]:
for gtCLUmMJHJgd in uCdlNRfesy8u:
if YE_goZOOqWUi[nzTpIcepk0o8('\x30' + '\x6f' + '\062', 8)] == gtCLUmMJHJgd[nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b110101 + 0o72) + chr(50), 8)]:
roI3spqORKae(Al4lDJpR9SvQ, roI3spqORKae(ES5oEprVxulp(b'\xf7:\x1e\x01$\xf4Z\x82~%\x84\xf2'), chr(100) + '\145' + chr(0b1100011) + chr(111) + chr(100) + '\145')(chr(117) + '\x74' + chr(3390 - 3288) + chr(0b10010 + 0o33) + '\070'))(gtCLUmMJHJgd[nzTpIcepk0o8(chr(0b100110 + 0o12) + '\157' + chr(0b10101 + 0o33), 8)])
roI3spqORKae(Al4lDJpR9SvQ, roI3spqORKae(ES5oEprVxulp(b'\xf7:\x1e\x01$\xf4Z\x82~%\x84\xf2'), chr(0b1000110 + 0o36) + '\145' + chr(99) + '\157' + chr(9957 - 9857) + chr(0b1011011 + 0o12))(chr(13512 - 13395) + chr(0b100011 + 0o121) + chr(102) + chr(0b1 + 0o54) + '\070'))(teUmM7cKWZUa)
if ftfygxgFas5X(cpStk7cY1TJd[JPzDaf6_RoFd]) in zDDta06N6DAG:
for YE_goZOOqWUi in zDDta06N6DAG[ftfygxgFas5X(cpStk7cY1TJd[JPzDaf6_RoFd])]:
roI3spqORKae(Al4lDJpR9SvQ, roI3spqORKae(ES5oEprVxulp(b'\xf7:\x1e\x01$\xf4Z\x82~%\x84\xf2'), '\144' + '\x65' + chr(99) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(5743 - 5626) + chr(0b1110100) + chr(5775 - 5673) + '\x2d' + chr(0b100100 + 0o24)))(YE_goZOOqWUi[nzTpIcepk0o8('\x30' + chr(0b111101 + 0o62) + chr(51), 8)])
if ftfygxgFas5X(cpStk7cY1TJd[JPzDaf6_RoFd]) in oIGkTtH81yq4:
for A0gVABhHjc3L in oIGkTtH81yq4[ftfygxgFas5X(cpStk7cY1TJd[JPzDaf6_RoFd])]:
roI3spqORKae(Al4lDJpR9SvQ, roI3spqORKae(ES5oEprVxulp(b'\xf7:\x1e\x01$\xf4Z\x82~%\x84\xf2'), chr(100) + chr(4308 - 4207) + chr(0b1100011) + '\x6f' + chr(0b1010000 + 0o24) + '\x65')(chr(117) + chr(116) + chr(0b10101 + 0o121) + chr(410 - 365) + chr(56)))(A0gVABhHjc3L[nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(422 - 374), 8)])
if Al4lDJpR9SvQ and roI3spqORKae(ES5oEprVxulp(b'\xa4'), chr(100) + chr(6334 - 6233) + chr(0b101001 + 0o72) + chr(111) + chr(100) + chr(101))(chr(117) + chr(6532 - 6416) + chr(0b10000 + 0o126) + '\x2d' + '\x38') in Al4lDJpR9SvQ[-nzTpIcepk0o8('\060' + '\x6f' + '\x31', 8)] and (not roI3spqORKae(Al4lDJpR9SvQ[-nzTpIcepk0o8('\x30' + chr(111) + chr(49), 8)], roI3spqORKae(ES5oEprVxulp(b'\xf6W+~\x15\xd0\\\xa1u?\x9b\xb5'), chr(100) + chr(0b10101 + 0o120) + '\x63' + chr(111) + chr(4470 - 4370) + chr(5134 - 5033))('\165' + chr(116) + '\146' + chr(0b101101) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\xa45}X'), chr(0b1100100) + '\145' + chr(0b111010 + 0o51) + chr(9286 - 9175) + '\144' + chr(0b1100101))('\x75' + '\x74' + chr(102) + chr(1279 - 1234) + chr(56)))):
roI3spqORKae(Al4lDJpR9SvQ, roI3spqORKae(ES5oEprVxulp(b'\xf7:\x1e\x01$\xf4Z\x82~%\x84\xf2'), chr(100) + chr(5863 - 5762) + chr(0b1100011) + chr(4836 - 4725) + chr(0b0 + 0o144) + '\145')('\x75' + '\164' + chr(8650 - 8548) + chr(863 - 818) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\xa45}X'), chr(100) + chr(0b100001 + 0o104) + chr(99) + '\x6f' + '\x64' + '\145')(chr(117) + chr(0b10110 + 0o136) + '\146' + chr(645 - 600) + chr(0b110 + 0o62)))
return roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b''), chr(560 - 460) + '\x65' + '\143' + chr(9128 - 9017) + '\144' + '\x65')(chr(0b1100000 + 0o25) + chr(13395 - 13279) + '\x66' + '\x2d' + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\xe6Z4xe\xd1~\x8b@\t\x9f\xb6'), chr(3706 - 3606) + chr(1260 - 1159) + '\143' + chr(0b1101111) + '\144' + '\145')(chr(7901 - 7784) + '\164' + chr(0b11111 + 0o107) + chr(0b101101) + '\070'))(Al4lDJpR9SvQ)
|
estnltk/estnltk
|
estnltk/prettyprinter/terminalprettyprinter.py
|
tprint
|
def tprint( text, layers, markup_settings = None ):
''' Formats given text, adding a special ( ANSI-terminal compatible ) markup
to the annotations of given layers, and prints the formatted text to the
screen.
*) layers is a list containing names of the layers to be preformatted in
the text (these layers must be present in Text);
*) markup_settings should be a list containing annotation options for each
layer: one dict with options per layer;
One dict can contain the following visualization options:
* 'bracket' : True -- annotations will be surrounded with brackets; This
works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in ANSI
compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color; this works in ANSI compatible
terminal;
*) Alternatively, if markup_settings is undefined, up to 12 layers can be
visualized following the default settings;
Parameters
----------
text: Text
a text object. Must contain given layers;
layer: list of str
list of layer names to be visualised;
markup_settings: list of dict
list of dictionaries containing user-defined visualization options;
(one dict per layer)
'''
if markup_settings and len(layers) != len(markup_settings):
raise Exception(' Input arguments layers and markup_settings should be equal size lists.')
elif not markup_settings and len(layers) <= len(default_markup_settings):
# Use a subset from default markup settings
markup_settings = default_markup_settings[0:len(layers)]
elif not markup_settings:
raise Exception(' Input argument markup_settings not defined.')
print( _preformat(text, layers, markup_settings=markup_settings) )
|
python
|
def tprint( text, layers, markup_settings = None ):
''' Formats given text, adding a special ( ANSI-terminal compatible ) markup
to the annotations of given layers, and prints the formatted text to the
screen.
*) layers is a list containing names of the layers to be preformatted in
the text (these layers must be present in Text);
*) markup_settings should be a list containing annotation options for each
layer: one dict with options per layer;
One dict can contain the following visualization options:
* 'bracket' : True -- annotations will be surrounded with brackets; This
works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in ANSI
compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color; this works in ANSI compatible
terminal;
*) Alternatively, if markup_settings is undefined, up to 12 layers can be
visualized following the default settings;
Parameters
----------
text: Text
a text object. Must contain given layers;
layer: list of str
list of layer names to be visualised;
markup_settings: list of dict
list of dictionaries containing user-defined visualization options;
(one dict per layer)
'''
if markup_settings and len(layers) != len(markup_settings):
raise Exception(' Input arguments layers and markup_settings should be equal size lists.')
elif not markup_settings and len(layers) <= len(default_markup_settings):
# Use a subset from default markup settings
markup_settings = default_markup_settings[0:len(layers)]
elif not markup_settings:
raise Exception(' Input argument markup_settings not defined.')
print( _preformat(text, layers, markup_settings=markup_settings) )
|
[
"def",
"tprint",
"(",
"text",
",",
"layers",
",",
"markup_settings",
"=",
"None",
")",
":",
"if",
"markup_settings",
"and",
"len",
"(",
"layers",
")",
"!=",
"len",
"(",
"markup_settings",
")",
":",
"raise",
"Exception",
"(",
"' Input arguments layers and markup_settings should be equal size lists.'",
")",
"elif",
"not",
"markup_settings",
"and",
"len",
"(",
"layers",
")",
"<=",
"len",
"(",
"default_markup_settings",
")",
":",
"# Use a subset from default markup settings\r",
"markup_settings",
"=",
"default_markup_settings",
"[",
"0",
":",
"len",
"(",
"layers",
")",
"]",
"elif",
"not",
"markup_settings",
":",
"raise",
"Exception",
"(",
"' Input argument markup_settings not defined.'",
")",
"print",
"(",
"_preformat",
"(",
"text",
",",
"layers",
",",
"markup_settings",
"=",
"markup_settings",
")",
")"
] |
Formats given text, adding a special ( ANSI-terminal compatible ) markup
to the annotations of given layers, and prints the formatted text to the
screen.
*) layers is a list containing names of the layers to be preformatted in
the text (these layers must be present in Text);
*) markup_settings should be a list containing annotation options for each
layer: one dict with options per layer;
One dict can contain the following visualization options:
* 'bracket' : True -- annotations will be surrounded with brackets; This
works in any terminal;
* 'underline' : True -- annotations will be underlined; This works in ANSI
compatible terminal;
* 'color' : ('red', 'green', 'blue' etc. ) -- annotated text will be
displayed in given color; this works in ANSI compatible
terminal;
*) Alternatively, if markup_settings is undefined, up to 12 layers can be
visualized following the default settings;
Parameters
----------
text: Text
a text object. Must contain given layers;
layer: list of str
list of layer names to be visualised;
markup_settings: list of dict
list of dictionaries containing user-defined visualization options;
(one dict per layer)
|
[
"Formats",
"given",
"text",
"adding",
"a",
"special",
"(",
"ANSI",
"-",
"terminal",
"compatible",
")",
"markup",
"to",
"the",
"annotations",
"of",
"given",
"layers",
"and",
"prints",
"the",
"formatted",
"text",
"to",
"the",
"screen",
".",
"*",
")",
"layers",
"is",
"a",
"list",
"containing",
"names",
"of",
"the",
"layers",
"to",
"be",
"preformatted",
"in",
"the",
"text",
"(",
"these",
"layers",
"must",
"be",
"present",
"in",
"Text",
")",
";",
"*",
")",
"markup_settings",
"should",
"be",
"a",
"list",
"containing",
"annotation",
"options",
"for",
"each",
"layer",
":",
"one",
"dict",
"with",
"options",
"per",
"layer",
";",
"One",
"dict",
"can",
"contain",
"the",
"following",
"visualization",
"options",
":",
"*",
"bracket",
":",
"True",
"--",
"annotations",
"will",
"be",
"surrounded",
"with",
"brackets",
";",
"This",
"works",
"in",
"any",
"terminal",
";",
"*",
"underline",
":",
"True",
"--",
"annotations",
"will",
"be",
"underlined",
";",
"This",
"works",
"in",
"ANSI",
"compatible",
"terminal",
";",
"*",
"color",
":",
"(",
"red",
"green",
"blue",
"etc",
".",
")",
"--",
"annotated",
"text",
"will",
"be",
"displayed",
"in",
"given",
"color",
";",
"this",
"works",
"in",
"ANSI",
"compatible",
"terminal",
";",
"*",
")",
"Alternatively",
"if",
"markup_settings",
"is",
"undefined",
"up",
"to",
"12",
"layers",
"can",
"be",
"visualized",
"following",
"the",
"default",
"settings",
";",
"Parameters",
"----------",
"text",
":",
"Text",
"a",
"text",
"object",
".",
"Must",
"contain",
"given",
"layers",
";",
"layer",
":",
"list",
"of",
"str",
"list",
"of",
"layer",
"names",
"to",
"be",
"visualised",
";",
"markup_settings",
":",
"list",
"of",
"dict",
"list",
"of",
"dictionaries",
"containing",
"user",
"-",
"defined",
"visualization",
"options",
";",
"(",
"one",
"dict",
"per",
"layer",
")"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/terminalprettyprinter.py#L418-L454
|
train
|
Formats given text with special markups and prints the formatted text to the screen.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIY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AglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b1111 + 0o41) + '\157' + '\x32' + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + '\157' + chr(0b110010) + chr(1037 - 983) + chr(53), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(51) + chr(53) + chr(51), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b1010 + 0o50) + chr(2216 - 2162) + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110011) + chr(55) + '\x32', 7807 - 7799), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b1100 + 0o51), 16741 - 16733), nzTpIcepk0o8(chr(48) + chr(111) + '\x31' + chr(0b110011), 50995 - 50987), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(111) + chr(2205 - 2156) + '\x35', 0b1000), nzTpIcepk0o8('\060' + chr(0b10011 + 0o134) + '\064' + chr(0b10110 + 0o35), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1815 - 1764), 49270 - 49262), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(0b10010 + 0o135) + chr(51) + chr(0b1000 + 0o53) + chr(0b100010 + 0o17), 37426 - 37418), nzTpIcepk0o8(chr(1181 - 1133) + chr(111) + chr(0b10010 + 0o41) + chr(54) + chr(170 - 119), ord("\x08")), nzTpIcepk0o8(chr(0b10011 + 0o35) + '\157' + chr(51) + chr(0b10 + 0o61) + chr(0b11001 + 0o35), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\063' + '\061' + chr(48), 24453 - 24445), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b101 + 0o55) + chr(0b10110 + 0o32) + chr(680 - 626), ord("\x08")), nzTpIcepk0o8(chr(1502 - 1454) + '\157' + chr(0b1111 + 0o45) + chr(0b10001 + 0o44), 6252 - 6244), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\061' + '\061' + chr(576 - 521), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + '\063' + '\066', 0o10), nzTpIcepk0o8(chr(850 - 802) + chr(3811 - 3700) + '\061' + chr(0b110000), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + chr(55) + chr(951 - 899), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1020 - 971) + '\060' + chr(2443 - 2393), 14870 - 14862), nzTpIcepk0o8(chr(1133 - 1085) + '\157' + chr(0b110011) + '\x33' + chr(0b100110 + 0o16), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b110101 + 0o72) + chr(0b1101 + 0o45) + chr(0b110111 + 0o0) + chr(2194 - 2144), 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b10011 + 0o134) + chr(0b110111) + '\x34', 14885 - 14877), nzTpIcepk0o8(chr(0b1101 + 0o43) + chr(111) + chr(0b110010) + chr(0b110101) + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(1559 - 1509) + chr(0b100001 + 0o21) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(48) + chr(3118 - 3007) + '\x37' + chr(0b110001), 60397 - 60389), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100000 + 0o27) + chr(0b110011 + 0o0), 0o10), nzTpIcepk0o8('\060' + chr(0b10 + 0o155) + '\061' + chr(2152 - 2101) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(1531 - 1481) + chr(0b1001 + 0o51) + chr(2800 - 2745), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061' + chr(48) + chr(0b11010 + 0o33), 35580 - 35572), nzTpIcepk0o8(chr(1466 - 1418) + chr(0b1101111) + chr(0b110010) + chr(53) + chr(0b11100 + 0o24), 37253 - 37245), nzTpIcepk0o8(chr(48) + '\x6f' + chr(51) + chr(297 - 245) + '\066', 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + '\157' + chr(0b11110 + 0o25) + chr(0b110011) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(444 - 396) + chr(0b1101111) + chr(751 - 701) + '\067' + chr(1888 - 1840), 40179 - 40171), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(50) + chr(48), 44613 - 44605), nzTpIcepk0o8(chr(1857 - 1809) + '\x6f' + '\063', 8), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b101101 + 0o7) + chr(0b110100 + 0o1), 0o10), nzTpIcepk0o8(chr(48) + chr(1399 - 1288) + chr(0b110111) + '\061', 8), nzTpIcepk0o8('\060' + chr(8488 - 8377) + chr(0b110010) + chr(0b101000 + 0o17) + chr(0b1000 + 0o50), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(111) + '\065' + '\x30', 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'<'), chr(5102 - 5002) + '\x65' + '\143' + chr(5448 - 5337) + chr(0b11101 + 0o107) + '\x65')('\165' + chr(0b1011111 + 0o25) + '\146' + chr(0b10 + 0o53) + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def hVkI_fq6TUej(cpStk7cY1TJd, e_hUOKXrf_W9, z29Q35YDgq4u=None):
if z29Q35YDgq4u and ftfygxgFas5X(e_hUOKXrf_W9) != ftfygxgFas5X(z29Q35YDgq4u):
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b"2\xfc\x85\xc3\x8fq+lQd\xac\x9e\xbb\xa6\xf2Vo2i\x05'\xae\xc9\x1c\xcc\xf8]\x1b5\xf67\xc3\x93\xa8\xe7\xa3f\x91M\xd1|\xd2\x98\x93\x89mdxOg\xf9\x91\xbb\xe8\xe3T:?d\\1\xb5\xc0Y\x8d\xfaPH,\xe4k"), chr(0b111001 + 0o53) + chr(101) + chr(3407 - 3308) + '\x6f' + '\144' + chr(0b111 + 0o136))(chr(0b100000 + 0o125) + chr(0b1000000 + 0o64) + chr(0b111011 + 0o53) + '\055' + '\070'))
elif not z29Q35YDgq4u and ftfygxgFas5X(e_hUOKXrf_W9) <= ftfygxgFas5X(jwX2wrezCooC):
z29Q35YDgq4u = jwX2wrezCooC[nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(111) + '\x30', 0b1000):ftfygxgFas5X(e_hUOKXrf_W9)]
elif not z29Q35YDgq4u:
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'2\xfc\x85\xc3\x8fq+lQd\xac\x9e\xbb\xa6\xf2\x05"?z\x177\xac\xe5O\xc8\xe2MR6\xf06\x88\x88\xb7\xcc\xf0g\x80_\xd1|\xd0\x8f\x9d'), '\x64' + '\x65' + chr(2720 - 2621) + '\157' + chr(0b1010011 + 0o21) + '\145')(chr(0b1110101) + '\x74' + '\146' + chr(1674 - 1629) + chr(0b111000)))
v8jsMqaYV6U2(YttOqdODURDF(cpStk7cY1TJd, e_hUOKXrf_W9, markup_settings=z29Q35YDgq4u))
|
estnltk/estnltk
|
estnltk/prettyprinter/templates.py
|
get_mark_css
|
def get_mark_css(aes_name, css_value):
"""Generate CSS class for <mark> tag.
Parameters
----------
aes_name: str
The name of the class.
css_value: str
The value for the CSS property defined by aes_name.
Returns
-------
list of str
The CSS codeblocks
"""
css_prop = AES_CSS_MAP[aes_name]
if isinstance(css_value, list):
return get_mark_css_for_rules(aes_name, css_prop, css_value)
else:
return get_mark_simple_css(aes_name, css_prop, css_value)
|
python
|
def get_mark_css(aes_name, css_value):
"""Generate CSS class for <mark> tag.
Parameters
----------
aes_name: str
The name of the class.
css_value: str
The value for the CSS property defined by aes_name.
Returns
-------
list of str
The CSS codeblocks
"""
css_prop = AES_CSS_MAP[aes_name]
if isinstance(css_value, list):
return get_mark_css_for_rules(aes_name, css_prop, css_value)
else:
return get_mark_simple_css(aes_name, css_prop, css_value)
|
[
"def",
"get_mark_css",
"(",
"aes_name",
",",
"css_value",
")",
":",
"css_prop",
"=",
"AES_CSS_MAP",
"[",
"aes_name",
"]",
"if",
"isinstance",
"(",
"css_value",
",",
"list",
")",
":",
"return",
"get_mark_css_for_rules",
"(",
"aes_name",
",",
"css_prop",
",",
"css_value",
")",
"else",
":",
"return",
"get_mark_simple_css",
"(",
"aes_name",
",",
"css_prop",
",",
"css_value",
")"
] |
Generate CSS class for <mark> tag.
Parameters
----------
aes_name: str
The name of the class.
css_value: str
The value for the CSS property defined by aes_name.
Returns
-------
list of str
The CSS codeblocks
|
[
"Generate",
"CSS",
"class",
"for",
"<mark",
">",
"tag",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/prettyprinter/templates.py#L44-L63
|
train
|
Generate CSS class for a mark tag.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLM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U,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(0b10111 + 0o130) + '\062' + chr(52) + chr(0b101100 + 0o5), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110001) + chr(0b10110 + 0o34) + '\061', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + '\x35' + chr(2173 - 2121), 0o10), nzTpIcepk0o8('\x30' + chr(5861 - 5750) + chr(1386 - 1337) + chr(980 - 930) + '\x36', 64162 - 64154), nzTpIcepk0o8(chr(0b110 + 0o52) + '\157' + '\063' + chr(0b100110 + 0o21) + chr(2449 - 2394), 0o10), nzTpIcepk0o8(chr(1106 - 1058) + '\157' + '\065' + '\067', 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1754 - 1704) + chr(0b10101 + 0o37) + chr(0b110110), 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + '\157' + chr(0b110100) + chr(50), 0b1000), nzTpIcepk0o8(chr(1038 - 990) + '\157' + chr(670 - 620) + '\064' + chr(0b10010 + 0o42), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\x34' + chr(52), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b100100 + 0o15), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2143 - 2093) + chr(1492 - 1438) + chr(1041 - 991), 0b1000), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(9037 - 8926) + chr(51) + '\063' + chr(55), 0b1000), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b1101111) + '\x33' + chr(0b1111 + 0o42) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(350 - 301) + chr(52) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(3516 - 3405) + chr(0b1011 + 0o52) + chr(55), 8), nzTpIcepk0o8(chr(894 - 846) + '\x6f' + '\063' + chr(0b10101 + 0o33) + chr(0b101111 + 0o10), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(0b10111 + 0o32) + chr(0b101110 + 0o6), ord("\x08")), nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(0b1101110 + 0o1) + chr(54) + chr(2150 - 2098), 0o10), nzTpIcepk0o8(chr(2070 - 2022) + '\x6f' + chr(49) + chr(632 - 583), 17565 - 17557), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(0b1011101 + 0o22) + chr(0b101110 + 0o5) + chr(0b110001) + '\x35', 8), nzTpIcepk0o8('\x30' + '\157' + chr(2339 - 2290) + chr(0b110111) + chr(0b11100 + 0o32), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(4136 - 4025) + chr(0b101 + 0o54) + '\x32' + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111) + chr(99 - 49) + chr(49) + chr(0b110 + 0o60), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\061' + chr(1389 - 1338) + chr(0b10000 + 0o40), 0o10), nzTpIcepk0o8(chr(0b10110 + 0o32) + '\x6f' + '\062' + chr(49) + chr(1374 - 1320), 8), nzTpIcepk0o8('\060' + '\157' + chr(0b110011) + '\061' + chr(2234 - 2182), 57073 - 57065), nzTpIcepk0o8(chr(0b11100 + 0o24) + '\x6f' + chr(51) + chr(49) + chr(55), 0o10), nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(0b1101111) + '\x32' + chr(48) + '\x31', 0b1000), nzTpIcepk0o8(chr(48) + chr(6919 - 6808) + chr(1198 - 1147) + chr(0b110110) + chr(50), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b101110 + 0o4) + chr(0b110100), 5925 - 5917), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(0b110001) + '\x31', 0o10), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(8123 - 8012) + chr(0b11100 + 0o25) + chr(2496 - 2442) + chr(0b110111), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(54) + chr(0b100000 + 0o24), 8), nzTpIcepk0o8('\060' + chr(6168 - 6057) + chr(51) + '\x31', 40153 - 40145), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110011) + chr(680 - 628) + chr(866 - 818), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1100010 + 0o15) + chr(2992 - 2937) + '\065', 0o10), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(3626 - 3515) + chr(0b100110 + 0o14) + chr(0b101 + 0o54) + '\x36', 8), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(0b1100 + 0o143) + '\061' + chr(1808 - 1755) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101111) + chr(209 - 158) + '\x34', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110101) + chr(0b100110 + 0o12), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x8f'), chr(100) + chr(0b1001101 + 0o30) + '\143' + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1100110) + '\055' + chr(0b100000 + 0o30)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def eZp6up_MBlQb(f3BvATjCUQ0i, M8YgOiJXPN03):
BE6Re0ih4Sw4 = zfeKdVNRQ9k1[f3BvATjCUQ0i]
if suIjIS24Zkqw(M8YgOiJXPN03, H4NoA26ON7iG):
return LN2U2IiGQOOf(f3BvATjCUQ0i, BE6Re0ih4Sw4, M8YgOiJXPN03)
else:
return tLSbvgGRBVQs(f3BvATjCUQ0i, BE6Re0ih4Sw4, M8YgOiJXPN03)
|
estnltk/estnltk
|
estnltk/mw_verbs/verbchain_nom_vinf_extender.py
|
VerbChainNomVInfExtender._loadSubcatRelations
|
def _loadSubcatRelations( self, inputFile ):
''' Laeb sisendfailist (inputFile) verb-nom/adv-vinf rektsiooniseoste mustrid.
Iga muster peab olema failis eraldi real, kujul:
(verbikirjeldus)\TAB(nom/adv-kirjeldus)\TAB(vinfkirjeldus)
nt
leid NEG aeg;S;((sg|pl) (p)|adt) da
leid POS võimalus;S;(sg|pl) (n|p|g) da
Salvestab laetud tulemused klassimuutujatesse nomAdvWordTemplates, verbRules
ja verbToVinf;
'''
self.nomAdvWordTemplates = dict()
self.verbRules = dict()
self.verbToVinf = dict()
in_f = codecs.open(inputFile, mode='r', encoding='utf-8')
for line in in_f:
line = line.rstrip()
if len(line) > 0 and not re.match("^#.+$", line):
items = line.split('\t')
if len(items) == 3:
verb = items[0]
nounAdv = items[1]
vinf = items[2]
if nounAdv not in self.nomAdvWordTemplates:
(root,pos,form) = nounAdv.split(';')
if not root.startswith('^') and not root.endswith('$'):
root = '^'+root+'$'
constraints = {ROOT:root, POSTAG:pos}
if form:
constraints[FORM] = form
self.nomAdvWordTemplates[nounAdv] = WordTemplate(constraints)
if verb not in self.verbRules:
self.verbRules[verb] = []
if verb not in self.verbToVinf:
self.verbToVinf[verb] = []
self.verbRules[verb].append( (nounAdv, 'V_'+vinf) )
if 'V_'+vinf not in self.verbToVinf[verb]:
self.verbToVinf[verb].append( 'V_'+vinf )
else:
raise Exception(' Unexpected number of items in the input lexicon line: '+line)
in_f.close()
|
python
|
def _loadSubcatRelations( self, inputFile ):
''' Laeb sisendfailist (inputFile) verb-nom/adv-vinf rektsiooniseoste mustrid.
Iga muster peab olema failis eraldi real, kujul:
(verbikirjeldus)\TAB(nom/adv-kirjeldus)\TAB(vinfkirjeldus)
nt
leid NEG aeg;S;((sg|pl) (p)|adt) da
leid POS võimalus;S;(sg|pl) (n|p|g) da
Salvestab laetud tulemused klassimuutujatesse nomAdvWordTemplates, verbRules
ja verbToVinf;
'''
self.nomAdvWordTemplates = dict()
self.verbRules = dict()
self.verbToVinf = dict()
in_f = codecs.open(inputFile, mode='r', encoding='utf-8')
for line in in_f:
line = line.rstrip()
if len(line) > 0 and not re.match("^#.+$", line):
items = line.split('\t')
if len(items) == 3:
verb = items[0]
nounAdv = items[1]
vinf = items[2]
if nounAdv not in self.nomAdvWordTemplates:
(root,pos,form) = nounAdv.split(';')
if not root.startswith('^') and not root.endswith('$'):
root = '^'+root+'$'
constraints = {ROOT:root, POSTAG:pos}
if form:
constraints[FORM] = form
self.nomAdvWordTemplates[nounAdv] = WordTemplate(constraints)
if verb not in self.verbRules:
self.verbRules[verb] = []
if verb not in self.verbToVinf:
self.verbToVinf[verb] = []
self.verbRules[verb].append( (nounAdv, 'V_'+vinf) )
if 'V_'+vinf not in self.verbToVinf[verb]:
self.verbToVinf[verb].append( 'V_'+vinf )
else:
raise Exception(' Unexpected number of items in the input lexicon line: '+line)
in_f.close()
|
[
"def",
"_loadSubcatRelations",
"(",
"self",
",",
"inputFile",
")",
":",
"self",
".",
"nomAdvWordTemplates",
"=",
"dict",
"(",
")",
"self",
".",
"verbRules",
"=",
"dict",
"(",
")",
"self",
".",
"verbToVinf",
"=",
"dict",
"(",
")",
"in_f",
"=",
"codecs",
".",
"open",
"(",
"inputFile",
",",
"mode",
"=",
"'r'",
",",
"encoding",
"=",
"'utf-8'",
")",
"for",
"line",
"in",
"in_f",
":",
"line",
"=",
"line",
".",
"rstrip",
"(",
")",
"if",
"len",
"(",
"line",
")",
">",
"0",
"and",
"not",
"re",
".",
"match",
"(",
"\"^#.+$\"",
",",
"line",
")",
":",
"items",
"=",
"line",
".",
"split",
"(",
"'\\t'",
")",
"if",
"len",
"(",
"items",
")",
"==",
"3",
":",
"verb",
"=",
"items",
"[",
"0",
"]",
"nounAdv",
"=",
"items",
"[",
"1",
"]",
"vinf",
"=",
"items",
"[",
"2",
"]",
"if",
"nounAdv",
"not",
"in",
"self",
".",
"nomAdvWordTemplates",
":",
"(",
"root",
",",
"pos",
",",
"form",
")",
"=",
"nounAdv",
".",
"split",
"(",
"';'",
")",
"if",
"not",
"root",
".",
"startswith",
"(",
"'^'",
")",
"and",
"not",
"root",
".",
"endswith",
"(",
"'$'",
")",
":",
"root",
"=",
"'^'",
"+",
"root",
"+",
"'$'",
"constraints",
"=",
"{",
"ROOT",
":",
"root",
",",
"POSTAG",
":",
"pos",
"}",
"if",
"form",
":",
"constraints",
"[",
"FORM",
"]",
"=",
"form",
"self",
".",
"nomAdvWordTemplates",
"[",
"nounAdv",
"]",
"=",
"WordTemplate",
"(",
"constraints",
")",
"if",
"verb",
"not",
"in",
"self",
".",
"verbRules",
":",
"self",
".",
"verbRules",
"[",
"verb",
"]",
"=",
"[",
"]",
"if",
"verb",
"not",
"in",
"self",
".",
"verbToVinf",
":",
"self",
".",
"verbToVinf",
"[",
"verb",
"]",
"=",
"[",
"]",
"self",
".",
"verbRules",
"[",
"verb",
"]",
".",
"append",
"(",
"(",
"nounAdv",
",",
"'V_'",
"+",
"vinf",
")",
")",
"if",
"'V_'",
"+",
"vinf",
"not",
"in",
"self",
".",
"verbToVinf",
"[",
"verb",
"]",
":",
"self",
".",
"verbToVinf",
"[",
"verb",
"]",
".",
"append",
"(",
"'V_'",
"+",
"vinf",
")",
"else",
":",
"raise",
"Exception",
"(",
"' Unexpected number of items in the input lexicon line: '",
"+",
"line",
")",
"in_f",
".",
"close",
"(",
")"
] |
Laeb sisendfailist (inputFile) verb-nom/adv-vinf rektsiooniseoste mustrid.
Iga muster peab olema failis eraldi real, kujul:
(verbikirjeldus)\TAB(nom/adv-kirjeldus)\TAB(vinfkirjeldus)
nt
leid NEG aeg;S;((sg|pl) (p)|adt) da
leid POS võimalus;S;(sg|pl) (n|p|g) da
Salvestab laetud tulemused klassimuutujatesse nomAdvWordTemplates, verbRules
ja verbToVinf;
|
[
"Laeb",
"sisendfailist",
"(",
"inputFile",
")",
"verb",
"-",
"nom",
"/",
"adv",
"-",
"vinf",
"rektsiooniseoste",
"mustrid",
".",
"Iga",
"muster",
"peab",
"olema",
"failis",
"eraldi",
"real",
"kujul",
":",
"(",
"verbikirjeldus",
")",
"\\",
"TAB",
"(",
"nom",
"/",
"adv",
"-",
"kirjeldus",
")",
"\\",
"TAB",
"(",
"vinfkirjeldus",
")",
"nt",
"leid",
"NEG",
"aeg",
";",
"S",
";",
"((",
"sg|pl",
")",
"(",
"p",
")",
"|adt",
")",
"da",
"leid",
"POS",
"võimalus",
";",
"S",
";",
"(",
"sg|pl",
")",
"(",
"n|p|g",
")",
"da",
"Salvestab",
"laetud",
"tulemused",
"klassimuutujatesse",
"nomAdvWordTemplates",
"verbRules",
"ja",
"verbToVinf",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/mw_verbs/verbchain_nom_vinf_extender.py#L66-L105
|
train
|
Load the relations from the input file into the instance attributes.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIs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,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(330 - 282) + chr(0b1000000 + 0o57) + chr(0b11000 + 0o31) + chr(0b110110) + '\x34', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101110 + 0o3) + chr(1035 - 980), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(53) + chr(48), ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + chr(50) + chr(0b110001) + chr(0b101110 + 0o2), 49227 - 49219), nzTpIcepk0o8('\x30' + '\157' + chr(2048 - 1997) + chr(51) + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b111 + 0o150) + chr(0b110 + 0o54) + '\x32' + chr(49), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\067', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110100) + '\060', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + chr(0b110011) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b100111 + 0o11) + chr(0b101000 + 0o17), 4183 - 4175), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001) + '\067', 8), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10101 + 0o34) + chr(0b110000) + chr(54), 43006 - 42998), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(48), 0o10), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b100010 + 0o115) + chr(0b100111 + 0o14) + chr(0b110101) + chr(0b10001 + 0o42), ord("\x08")), nzTpIcepk0o8(chr(2200 - 2152) + '\x6f' + chr(0b1110 + 0o44) + chr(1477 - 1424) + chr(48), 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(754 - 706) + chr(773 - 721), ord("\x08")), nzTpIcepk0o8(chr(0b101000 + 0o10) + '\x6f' + chr(2088 - 2037) + chr(0b110101) + chr(84 - 30), 0o10), nzTpIcepk0o8(chr(0b101001 + 0o7) + chr(0b1101111) + '\x32' + chr(2461 - 2411) + chr(0b110110), 63175 - 63167), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(111) + '\x33' + chr(590 - 537) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b110010) + chr(53), 0b1000), nzTpIcepk0o8(chr(0b10111 + 0o31) + '\x6f' + chr(51) + chr(0b11111 + 0o30), 0o10), nzTpIcepk0o8('\x30' + chr(0b11010 + 0o125) + chr(1380 - 1329) + chr(236 - 186) + '\063', 0b1000), nzTpIcepk0o8(chr(636 - 588) + chr(0b100000 + 0o117) + chr(862 - 812) + chr(544 - 491) + chr(0b10010 + 0o41), 0b1000), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(8264 - 8153) + chr(2439 - 2388) + chr(51) + chr(0b11 + 0o61), 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + chr(0b110011 + 0o3) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1723 - 1672) + '\x33' + '\061', 12016 - 12008), nzTpIcepk0o8('\060' + chr(0b1101111) + '\062' + chr(0b100101 + 0o17) + chr(2777 - 2722), ord("\x08")), nzTpIcepk0o8(chr(667 - 619) + chr(0b110001 + 0o76) + '\x32' + '\065' + chr(48), 8), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110011) + '\x37', 8), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + chr(0b110011) + chr(0b110011), 9713 - 9705), nzTpIcepk0o8(chr(0b110000) + chr(9243 - 9132) + '\x33' + chr(2364 - 2310) + chr(1984 - 1931), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(50) + '\063' + chr(49), 55727 - 55719), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(2503 - 2452) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(438 - 390) + '\x6f' + '\x31' + chr(704 - 654) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1001 + 0o146) + '\x32' + chr(0b1001 + 0o50) + chr(143 - 92), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101111 + 0o2) + chr(0b101110 + 0o5) + chr(0b110011), 8), nzTpIcepk0o8('\060' + chr(4889 - 4778) + '\x36' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(0b110011) + chr(48), 48390 - 48382), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111 + 0o0) + '\x33' + '\x32' + chr(0b10011 + 0o40), 8), nzTpIcepk0o8(chr(1511 - 1463) + chr(0b101101 + 0o102) + '\063' + '\061', ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x35' + chr(48), ord("\x08"))] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'Z'), chr(0b1111 + 0o125) + '\145' + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b11011 + 0o112))('\x75' + chr(0b111010 + 0o72) + chr(3140 - 3038) + '\x2d' + chr(0b101101 + 0o13)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def qHmcy7U9oGIC(hXMPsSrOQzbh, taEx9S3w1s1M):
hXMPsSrOQzbh.QYWKWzD8faO4 = znjnJWK64FDT()
hXMPsSrOQzbh.Dj44cREKz_Oa = znjnJWK64FDT()
hXMPsSrOQzbh.w6bwvoaPo8sK = znjnJWK64FDT()
mkkQK_f7m_F1 = Hj8X5RtMNBIn.DnU3Rq9N5ala(taEx9S3w1s1M, mode=roI3spqORKae(ES5oEprVxulp(b'\x06'), chr(0b1100100) + chr(0b1100101) + chr(0b101101 + 0o66) + chr(8173 - 8062) + chr(0b110000 + 0o64) + '\145')('\165' + '\x74' + '\146' + chr(1298 - 1253) + chr(56)), encoding=roI3spqORKae(ES5oEprVxulp(b'\x01{\xce\xa5\xe5'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b101000 + 0o107) + chr(100) + '\x65')(chr(117) + chr(116) + chr(102) + '\x2d' + chr(56)))
for ffiOpFBWGmZU in mkkQK_f7m_F1:
ffiOpFBWGmZU = ffiOpFBWGmZU.rstrip()
if ftfygxgFas5X(ffiOpFBWGmZU) > nzTpIcepk0o8(chr(1978 - 1930) + chr(0b1101111) + chr(48), 8) and (not roI3spqORKae(aoTc4YA2bs2R, roI3spqORKae(ES5oEprVxulp(b'\x1cd\x91\xc7\xb4\xfbjI\x9f\xd8u\x07'), chr(0b1100100) + '\x65' + chr(0b101000 + 0o73) + chr(10717 - 10606) + '\144' + chr(101))(chr(0b1110101) + '\x74' + '\146' + chr(45) + chr(1172 - 1116)))(roI3spqORKae(ES5oEprVxulp(b'*,\x86\xa3\xf9'), chr(0b1100100) + '\x65' + '\143' + chr(0b100010 + 0o115) + '\x64' + '\x65')(chr(2597 - 2480) + '\164' + '\146' + '\055' + '\070'), ffiOpFBWGmZU)):
Y_nNEzH43vXi = ffiOpFBWGmZU.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'}'), chr(0b1100100) + '\x65' + '\x63' + chr(111) + chr(100) + '\x65')('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56)))
if ftfygxgFas5X(Y_nNEzH43vXi) == nzTpIcepk0o8(chr(0b110000) + '\157' + '\063', 40356 - 40348):
zyG6yE_SkDAn = Y_nNEzH43vXi[nzTpIcepk0o8(chr(0b10101 + 0o33) + chr(0b1001100 + 0o43) + chr(0b1010 + 0o46), 8)]
D6B80qQyluxl = Y_nNEzH43vXi[nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31', 0o10)]
S1qX6KKMpuOu = Y_nNEzH43vXi[nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b0 + 0o157) + '\062', 0o10)]
if D6B80qQyluxl not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'%V\xff\xc3\x8a\xebC\x18\xba\xe6@r'), chr(3611 - 3511) + chr(6567 - 6466) + '\x63' + chr(0b1101111) + chr(0b1101 + 0o127) + chr(101))(chr(117) + chr(116) + chr(102) + chr(0b11010 + 0o23) + chr(0b11011 + 0o35))):
(kF9CWBi2ucGu, IGIA_fu6MbaO, qnYTYR39V38E) = D6B80qQyluxl.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'O'), '\x64' + '\145' + chr(0b1000 + 0o133) + chr(4201 - 4090) + chr(6895 - 6795) + chr(0b1000001 + 0o44))(chr(0b100101 + 0o120) + chr(116) + chr(102) + chr(0b10100 + 0o31) + chr(0b110101 + 0o3)))
if not roI3spqORKae(kF9CWBi2ucGu, roI3spqORKae(ES5oEprVxulp(b'\x07{\xc9\xfa\xa9\xe2pI\xa8\xef'), chr(0b1101 + 0o127) + chr(101) + '\143' + '\157' + '\144' + chr(0b10111 + 0o116))(chr(0b1110101) + chr(12723 - 12607) + '\x66' + chr(45) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'*'), chr(0b1100100) + chr(3267 - 3166) + chr(0b1011011 + 0o10) + chr(0b110010 + 0o75) + chr(0b111100 + 0o50) + chr(1933 - 1832))('\x75' + '\164' + '\x66' + chr(45) + chr(1704 - 1648))) and (not roI3spqORKae(kF9CWBi2ucGu, roI3spqORKae(ES5oEprVxulp(b'=6\xce\xc3\x94\xd2Fl\xbd\xf2E4'), chr(100) + chr(0b100110 + 0o77) + chr(5589 - 5490) + chr(111) + chr(0b1100100) + '\145')('\165' + chr(0b1110100) + chr(102) + chr(45) + chr(0b111000)))(roI3spqORKae(ES5oEprVxulp(b'P'), '\144' + chr(4172 - 4071) + chr(0b0 + 0o143) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(1143 - 1041) + '\x2d' + chr(2537 - 2481)))):
kF9CWBi2ucGu = roI3spqORKae(ES5oEprVxulp(b'*'), chr(0b1010100 + 0o20) + chr(2518 - 2417) + chr(0b11010 + 0o111) + chr(0b1101111) + chr(0b101000 + 0o74) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(242 - 197) + chr(56)) + kF9CWBi2ucGu + roI3spqORKae(ES5oEprVxulp(b'P'), chr(0b10010 + 0o122) + chr(101) + chr(0b101 + 0o136) + chr(0b1010 + 0o145) + chr(7282 - 7182) + chr(0b1100101))(chr(117) + chr(2096 - 1980) + chr(0b1100110) + chr(45) + chr(0b111000))
WsRXUozGEySJ = {XsvoTOpX8A2b: kF9CWBi2ucGu, QivUjX90e7n8: IGIA_fu6MbaO}
if qnYTYR39V38E:
WsRXUozGEySJ[invlgHm8TzbV] = qnYTYR39V38E
hXMPsSrOQzbh.QYWKWzD8faO4[D6B80qQyluxl] = AdjECv1glaZZ(WsRXUozGEySJ)
if zyG6yE_SkDAn not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b"0e\x9c\xbc\xbe\xc3Bk\xa6\xd8@'"), '\144' + chr(6265 - 6164) + '\x63' + chr(0b1101111) + '\144' + chr(0b1001000 + 0o35))(chr(0b111110 + 0o67) + '\164' + '\146' + '\055' + chr(0b101010 + 0o16))):
hXMPsSrOQzbh.Dj44cREKz_Oa[zyG6yE_SkDAn] = []
if zyG6yE_SkDAn not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x039\xca\xff\xab\xfefp\xb3\xbf|\r'), chr(6806 - 6706) + chr(0b1000101 + 0o40) + chr(0b1000100 + 0o37) + '\157' + chr(100) + chr(101))(chr(117) + '\164' + chr(102) + chr(1244 - 1199) + chr(501 - 445))):
hXMPsSrOQzbh.w6bwvoaPo8sK[zyG6yE_SkDAn] = []
roI3spqORKae(hXMPsSrOQzbh.verbRules[zyG6yE_SkDAn], roI3spqORKae(ES5oEprVxulp(b'<[\xfb\xbc\xa5\xf6@O\xb6\xe8Zs'), chr(0b11000 + 0o114) + chr(101) + chr(99) + '\x6f' + '\x64' + '\x65')('\x75' + chr(0b10011 + 0o141) + '\x66' + chr(0b11 + 0o52) + '\x38'))((D6B80qQyluxl, roI3spqORKae(ES5oEprVxulp(b'"P'), '\144' + chr(0b1100101) + chr(2362 - 2263) + chr(2772 - 2661) + chr(0b1100100) + chr(4562 - 4461))(chr(0b1101010 + 0o13) + '\x74' + '\x66' + chr(45) + chr(0b11011 + 0o35)) + S1qX6KKMpuOu))
if roI3spqORKae(ES5oEprVxulp(b'"P'), '\x64' + chr(101) + chr(99) + chr(1100 - 989) + '\144' + chr(0b1100101))(chr(0b1110101) + '\x74' + '\146' + '\x2d' + '\x38') + S1qX6KKMpuOu not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x039\xca\xff\xab\xfefp\xb3\xbf|\r'), '\144' + chr(0b1000011 + 0o42) + chr(0b1100011) + '\x6f' + chr(0b1010111 + 0o15) + '\x65')('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + '\070'))[zyG6yE_SkDAn]:
roI3spqORKae(hXMPsSrOQzbh.verbToVinf[zyG6yE_SkDAn], roI3spqORKae(ES5oEprVxulp(b'<[\xfb\xbc\xa5\xf6@O\xb6\xe8Zs'), '\144' + '\x65' + '\x63' + chr(2039 - 1928) + '\144' + '\145')(chr(117) + '\x74' + '\146' + chr(0b101101) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'"P'), chr(0b1100100) + '\x65' + '\x63' + chr(0b1011000 + 0o27) + chr(0b1000111 + 0o35) + chr(0b1100101))(chr(117) + chr(12214 - 12098) + chr(102) + chr(0b101101) + '\x38') + S1qX6KKMpuOu)
else:
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'TZ\xc6\xed\xa5\xe1bC\xa8\xe2kfn\x9e\xc5&\x8b\xe4\xc8\xfay\xf3\xc2\xa8\xd5\xb4\xd4\x88v5\xd5\xed71\xab2]\xa8\xa6mTc\xcd\xf0\xb4\xf2hN\xfc\xebf(e\xd1\x88'), '\144' + chr(0b1100101) + '\x63' + '\157' + '\x64' + chr(0b1001 + 0o134))('\x75' + chr(6188 - 6072) + chr(0b1100101 + 0o1) + '\055' + '\070') + ffiOpFBWGmZU)
roI3spqORKae(mkkQK_f7m_F1, roI3spqORKae(ES5oEprVxulp(b'.j\xd9\xbf\x9e\xf2a\x19\x89\xe37,'), chr(0b1001000 + 0o34) + '\145' + chr(99) + chr(111) + '\144' + '\145')(chr(0b1110101) + chr(0b1011010 + 0o32) + chr(102) + chr(0b101011 + 0o2) + '\x38'))()
|
estnltk/estnltk
|
estnltk/mw_verbs/verbchain_nom_vinf_extender.py
|
VerbChainNomVInfExtender.tokenMatchesNomAdvVinf
|
def tokenMatchesNomAdvVinf( self, token, verb, vinf):
''' Teeb kindlaks, kas etteantud token v6iks olla verb'i alluv ning vinf'i ylemus (st
paikneda nende vahel). Kui see nii on, tagastab j2rjendi vahele sobiva s6na morf
analyysidega (meetodi _getMatchingAnalysisIDs abil), vastasel juhul tagastab tyhja
j2rjendi;
'''
if verb in self.verbRules:
for (nounAdv, vinf1) in self.verbRules[verb]:
if vinf == vinf1 and (self.nomAdvWordTemplates[nounAdv]).matches(token):
return _getMatchingAnalysisIDs( token, self.nomAdvWordTemplates[nounAdv] )
return []
|
python
|
def tokenMatchesNomAdvVinf( self, token, verb, vinf):
''' Teeb kindlaks, kas etteantud token v6iks olla verb'i alluv ning vinf'i ylemus (st
paikneda nende vahel). Kui see nii on, tagastab j2rjendi vahele sobiva s6na morf
analyysidega (meetodi _getMatchingAnalysisIDs abil), vastasel juhul tagastab tyhja
j2rjendi;
'''
if verb in self.verbRules:
for (nounAdv, vinf1) in self.verbRules[verb]:
if vinf == vinf1 and (self.nomAdvWordTemplates[nounAdv]).matches(token):
return _getMatchingAnalysisIDs( token, self.nomAdvWordTemplates[nounAdv] )
return []
|
[
"def",
"tokenMatchesNomAdvVinf",
"(",
"self",
",",
"token",
",",
"verb",
",",
"vinf",
")",
":",
"if",
"verb",
"in",
"self",
".",
"verbRules",
":",
"for",
"(",
"nounAdv",
",",
"vinf1",
")",
"in",
"self",
".",
"verbRules",
"[",
"verb",
"]",
":",
"if",
"vinf",
"==",
"vinf1",
"and",
"(",
"self",
".",
"nomAdvWordTemplates",
"[",
"nounAdv",
"]",
")",
".",
"matches",
"(",
"token",
")",
":",
"return",
"_getMatchingAnalysisIDs",
"(",
"token",
",",
"self",
".",
"nomAdvWordTemplates",
"[",
"nounAdv",
"]",
")",
"return",
"[",
"]"
] |
Teeb kindlaks, kas etteantud token v6iks olla verb'i alluv ning vinf'i ylemus (st
paikneda nende vahel). Kui see nii on, tagastab j2rjendi vahele sobiva s6na morf
analyysidega (meetodi _getMatchingAnalysisIDs abil), vastasel juhul tagastab tyhja
j2rjendi;
|
[
"Teeb",
"kindlaks",
"kas",
"etteantud",
"token",
"v6iks",
"olla",
"verb",
"i",
"alluv",
"ning",
"vinf",
"i",
"ylemus",
"(",
"st",
"paikneda",
"nende",
"vahel",
")",
".",
"Kui",
"see",
"nii",
"on",
"tagastab",
"j2rjendi",
"vahele",
"sobiva",
"s6na",
"morf",
"analyysidega",
"(",
"meetodi",
"_getMatchingAnalysisIDs",
"abil",
")",
"vastasel",
"juhul",
"tagastab",
"tyhja",
"j2rjendi",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/mw_verbs/verbchain_nom_vinf_extender.py#L107-L117
|
train
|
Returns a list of analysis IDs that match the given token and the given verb and vinf.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,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qIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\157' + chr(471 - 420) + '\x31' + '\x34', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(504 - 452) + chr(0b110011 + 0o2), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\065' + chr(51), 0b1000), nzTpIcepk0o8(chr(1233 - 1185) + chr(7453 - 7342) + chr(51) + chr(1500 - 1452) + '\066', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(52) + chr(0b110101), 8), nzTpIcepk0o8('\060' + chr(4688 - 4577) + chr(0b110011) + chr(53) + chr(642 - 590), 11087 - 11079), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(201 - 146), 940 - 932), nzTpIcepk0o8(chr(0b10001 + 0o37) + '\x6f' + chr(0b110010) + chr(0b110001) + '\063', 45187 - 45179), nzTpIcepk0o8(chr(0b110000) + chr(0b1100011 + 0o14) + '\x33' + chr(0b1000 + 0o53), 63972 - 63964), nzTpIcepk0o8('\060' + chr(0b11101 + 0o122) + chr(0b110011) + chr(0b110010 + 0o3) + chr(53), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(926 - 876) + chr(2565 - 2514) + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(273 - 225) + '\157' + '\x33' + chr(0b10110 + 0o36) + chr(0b1001 + 0o47), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b11111 + 0o24) + chr(864 - 813) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b1010 + 0o46) + chr(0b1101111) + '\061' + '\x33' + chr(0b101010 + 0o11), 0b1000), nzTpIcepk0o8(chr(1263 - 1215) + chr(111) + chr(0b110011) + chr(49) + chr(343 - 292), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + '\063' + chr(0b110000), 39657 - 39649), nzTpIcepk0o8(chr(2017 - 1969) + chr(0b1010101 + 0o32) + chr(53), 0b1000), nzTpIcepk0o8(chr(48) + chr(10376 - 10265) + '\x33' + chr(0b110011) + chr(52), ord("\x08")), nzTpIcepk0o8(chr(2145 - 2097) + '\157' + chr(1811 - 1761) + chr(0b110110) + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x32' + '\x31' + chr(50), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(151 - 103) + chr(111) + chr(1633 - 1578) + chr(0b110000), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\061' + '\x35' + '\x35', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(49), 9753 - 9745), nzTpIcepk0o8(chr(48) + '\157' + '\063' + '\x32' + chr(53), 0o10), nzTpIcepk0o8(chr(175 - 127) + chr(0b1101111) + chr(815 - 763) + '\x33', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(4056 - 3945) + chr(1169 - 1117) + chr(723 - 674), 0o10), nzTpIcepk0o8(chr(1425 - 1377) + '\x6f' + chr(1412 - 1363) + chr(2390 - 2338) + chr(51), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b110011 + 0o74) + chr(51) + chr(53) + chr(0b1011 + 0o46), 12767 - 12759), nzTpIcepk0o8(chr(0b110000) + chr(0b100010 + 0o115) + chr(0b110011) + chr(49) + chr(0b110111), 47711 - 47703), nzTpIcepk0o8('\060' + chr(111) + chr(0b1 + 0o61) + chr(0b110111) + '\067', 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110001) + '\060', 0o10), nzTpIcepk0o8('\x30' + chr(8438 - 8327) + chr(50) + chr(0b11110 + 0o26) + chr(946 - 893), 40345 - 40337), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b1101101 + 0o2) + chr(1632 - 1581) + chr(243 - 195) + chr(2364 - 2313), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b100001 + 0o22) + '\060' + chr(0b110001 + 0o0), ord("\x08")), nzTpIcepk0o8(chr(1258 - 1210) + chr(0b1101111) + chr(0b101 + 0o56) + chr(49) + chr(0b110000), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(51) + chr(0b101010 + 0o6) + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(51) + chr(0b110011) + chr(0b110000), 8), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110010) + chr(0b10010 + 0o36) + '\x33', 0b1000), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(0b1101111) + chr(0b1010 + 0o51) + '\x33' + chr(0b1100 + 0o47), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x35' + '\x30', 28192 - 28184)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xe2'), '\144' + chr(0b101101 + 0o70) + '\x63' + chr(11304 - 11193) + chr(8960 - 8860) + chr(101))('\165' + chr(4255 - 4139) + '\x66' + chr(1799 - 1754) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def kvFj344s4wK9(hXMPsSrOQzbh, Hd4nWPplSa3h, zyG6yE_SkDAn, S1qX6KKMpuOu):
if zyG6yE_SkDAn in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x88O\x1f\xf2F\xbeZ\xc0a\xb2\xd1\x81'), chr(0b110000 + 0o64) + chr(0b1100101) + '\143' + chr(111) + chr(0b1011010 + 0o12) + '\145')(chr(0b1110101) + chr(9239 - 9123) + chr(0b1100110) + chr(0b101101) + chr(0b111000))):
for (D6B80qQyluxl, oZn2EnaygC8z) in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x88O\x1f\xf2F\xbeZ\xc0a\xb2\xd1\x81'), chr(0b1100100) + chr(0b110000 + 0o65) + chr(5643 - 5544) + '\x6f' + chr(100) + '\x65')(chr(117) + '\x74' + chr(0b1100000 + 0o6) + '\055' + chr(56)))[zyG6yE_SkDAn]:
if S1qX6KKMpuOu == oZn2EnaygC8z and roI3spqORKae(hXMPsSrOQzbh.nomAdvWordTemplates[D6B80qQyluxl], roI3spqORKae(ES5oEprVxulp(b'\x83kD\xb6n\xd4V\xc5y\xd8\xad\xaf'), chr(0b10110 + 0o116) + '\x65' + '\143' + chr(605 - 494) + '\144' + chr(0b1100101))(chr(0b1010111 + 0o36) + chr(9894 - 9778) + '\146' + chr(1663 - 1618) + '\070'))(Hd4nWPplSa3h):
return DoDyztMAKsny(Hd4nWPplSa3h, roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x9d||\x8dr\x96[\xb3}\x8c\xd1\xd4'), chr(0b1000011 + 0o41) + '\x65' + chr(0b1111 + 0o124) + '\157' + '\144' + '\145')(chr(6677 - 6560) + chr(0b1110100) + chr(0b1100110) + chr(1770 - 1725) + chr(191 - 135)))[D6B80qQyluxl])
return []
|
estnltk/estnltk
|
estnltk/mw_verbs/verbchain_nom_vinf_extender.py
|
VerbChainNomVInfExtender.extendChainsInSentence
|
def extendChainsInSentence( self, sentence, foundChains ):
''' Rakendab meetodit self.extendChainsInClause() antud lause igal osalausel.
'''
# 1) Preprocessing
clauses = getClausesByClauseIDs( sentence )
# 2) Extend verb chains in each clause
allDetectedVerbChains = []
for clauseID in clauses:
clause = clauses[clauseID]
self.extendChainsInClause(clause, clauseID, foundChains)
|
python
|
def extendChainsInSentence( self, sentence, foundChains ):
''' Rakendab meetodit self.extendChainsInClause() antud lause igal osalausel.
'''
# 1) Preprocessing
clauses = getClausesByClauseIDs( sentence )
# 2) Extend verb chains in each clause
allDetectedVerbChains = []
for clauseID in clauses:
clause = clauses[clauseID]
self.extendChainsInClause(clause, clauseID, foundChains)
|
[
"def",
"extendChainsInSentence",
"(",
"self",
",",
"sentence",
",",
"foundChains",
")",
":",
"# 1) Preprocessing\r",
"clauses",
"=",
"getClausesByClauseIDs",
"(",
"sentence",
")",
"# 2) Extend verb chains in each clause\r",
"allDetectedVerbChains",
"=",
"[",
"]",
"for",
"clauseID",
"in",
"clauses",
":",
"clause",
"=",
"clauses",
"[",
"clauseID",
"]",
"self",
".",
"extendChainsInClause",
"(",
"clause",
",",
"clauseID",
",",
"foundChains",
")"
] |
Rakendab meetodit self.extendChainsInClause() antud lause igal osalausel.
|
[
"Rakendab",
"meetodit",
"self",
".",
"extendChainsInClause",
"()",
"antud",
"lause",
"igal",
"osalausel",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/est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,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(111) + chr(50) + chr(217 - 163) + chr(0b11001 + 0o27), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1100101 + 0o12) + chr(1670 - 1618) + chr(1996 - 1944), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1011010 + 0o25) + '\061' + '\x35' + chr(54), 25465 - 25457), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + '\066' + '\x31', 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(51) + chr(1487 - 1437) + chr(54), 0b1000), nzTpIcepk0o8('\060' + chr(5106 - 4995) + chr(708 - 657) + chr(1706 - 1651) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\061' + '\067' + '\x34', ord("\x08")), nzTpIcepk0o8('\x30' + chr(111) + '\062' + chr(0b10100 + 0o37) + '\066', 0o10), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b110011) + chr(49), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(747 - 697) + chr(49) + chr(55), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100110 + 0o21), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(11915 - 11804) + chr(51) + '\060' + chr(0b110100 + 0o3), 0b1000), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110001) + chr(0b0 + 0o64) + '\061', 0o10), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\157' + chr(0b110010) + chr(52) + chr(2132 - 2084), 0o10), nzTpIcepk0o8(chr(177 - 129) + '\157' + chr(0b110011) + chr(278 - 225) + '\060', ord("\x08")), nzTpIcepk0o8('\060' + chr(0b10110 + 0o131) + '\x31' + chr(0b11101 + 0o26) + chr(2432 - 2379), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(885 - 836) + '\x32' + '\067', 0b1000), nzTpIcepk0o8(chr(48) + chr(9194 - 9083) + chr(0b110 + 0o54) + '\064' + chr(0b11111 + 0o26), 0b1000), nzTpIcepk0o8(chr(0b101010 + 0o6) + chr(0b1011 + 0o144) + '\061' + '\062' + chr(0b100011 + 0o21), 47621 - 47613), nzTpIcepk0o8(chr(0b110000) + chr(0b1001110 + 0o41) + chr(0b110010) + chr(0b110001 + 0o0) + chr(0b11010 + 0o26), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1001011 + 0o44) + chr(0b10110 + 0o35) + '\063' + '\x33', 29820 - 29812), nzTpIcepk0o8(chr(2065 - 2017) + chr(0b11111 + 0o120) + chr(50) + chr(53 - 3) + '\061', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(53) + chr(54), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1098 - 1045) + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(7911 - 7800) + '\x32' + chr(0b110111) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(1395 - 1347) + chr(0b11001 + 0o126) + chr(0b110011) + '\060' + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1000001 + 0o56) + '\062' + '\x34' + '\x35', 8), nzTpIcepk0o8(chr(1271 - 1223) + chr(0b10100 + 0o133) + chr(0b10001 + 0o44) + chr(52), 8), nzTpIcepk0o8(chr(2130 - 2082) + chr(1007 - 896) + chr(55) + '\065', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b111011 + 0o64) + chr(49) + chr(0b110011) + '\063', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(1904 - 1855) + '\x32', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110110) + chr(48), 20568 - 20560), nzTpIcepk0o8(chr(201 - 153) + chr(0b1010010 + 0o35) + '\x33' + '\066' + '\060', 8), nzTpIcepk0o8(chr(1848 - 1800) + '\157' + chr(0b111 + 0o52) + chr(48) + '\061', 0o10), nzTpIcepk0o8(chr(1330 - 1282) + chr(0b1101111) + chr(0b101111 + 0o2) + '\x35' + chr(1931 - 1883), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b111100 + 0o63) + '\x31' + chr(0b110000) + chr(49), 8), nzTpIcepk0o8('\060' + chr(336 - 225) + '\x31' + chr(0b110111) + chr(2275 - 2222), 0o10), nzTpIcepk0o8('\060' + chr(0b1001100 + 0o43) + chr(0b1000 + 0o53) + '\064' + '\x35', 0b1000), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(0b1101111) + chr(0b11110 + 0o26) + '\067', 0b1000), nzTpIcepk0o8('\060' + chr(0b1101000 + 0o7) + '\x31' + chr(0b1001 + 0o51) + chr(0b100110 + 0o12), 20744 - 20736)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(53) + '\060', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9e'), chr(100) + chr(8826 - 8725) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b1000111 + 0o36))(chr(11682 - 11565) + '\x74' + '\146' + chr(45) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def UcCp7yJFtVxQ(hXMPsSrOQzbh, v3YfwzoUholR, pOHqW_FNK1BR):
YNecfRkOXqFZ = yek_MUKCNZcx(v3YfwzoUholR)
A7bl0vd_FDV1 = []
for hvzWTn4ua_8s in YNecfRkOXqFZ:
va9olG5Fw2F2 = YNecfRkOXqFZ[hvzWTn4ua_8s]
roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b"\xd5\\\x1a\xd4\xb8\x9a?\xf6x\xe6i\xb4(\xce\xab16\xd0'\xed"), chr(0b1011001 + 0o13) + '\145' + chr(2062 - 1963) + '\x6f' + chr(0b1010 + 0o132) + chr(101))(chr(0b10100 + 0o141) + chr(0b10011 + 0o141) + '\x66' + chr(759 - 714) + chr(56)))(va9olG5Fw2F2, hvzWTn4ua_8s, pOHqW_FNK1BR)
|
estnltk/estnltk
|
estnltk/mw_verbs/verbchain_nom_vinf_extender.py
|
VerbChainNomVInfExtender._isLikelyNotPhrase
|
def _isLikelyNotPhrase( self, headVerbRoot, headVerbWID, nomAdvWID, widToToken):
''' Kontrollib, et nom/adv ei kuuluks mingi suurema fraasi kooseisu (poleks fraasi peas6na).
Tagastab True, kui:
*) nom/adv j2rgneb vahetult peaverbile
*) või nom/adv on vahetult osalause alguses
*) või nom-ile eelneb vahetult selline s6na, mis kindlasti ei saa olla
eestäiendiks
*) või nom/adv puhul on tegemist olema-verbi adv-ga;
'''
minWID = min(widToToken.keys())
nomAdvToken = widToToken[nomAdvWID]
isNom = self.wtNom.matches(nomAdvToken)
if headVerbWID+1 == nomAdvWID:
# 1) Kui nom/adv j2rgneb vahetult verbile, siis on ysna turvaline arvata,
# et need kuuluvad kokku, nt:
# ja seda tunnet on_0 raske_0 millegi vastu vahetada_0 .
# mida nad peavad_0 vajalikuks_0 läände müüa_0
return True
elif minWID == nomAdvWID:
# 2) Kui nom/adv on vahetult osalause alguses, siis on samuti üsna turvaline
# eeldada, et see kuulub verbiga kokku, nt:
# Tarvis_0 on_0 muretseda_0 veel auhinnafond 250 000 dollarit .
# Raske_0 on_0 temaga vaielda_0 .
return True
elif isNom and nomAdvWID-1 in widToToken:
prevToken = widToToken[nomAdvWID-1]
if self.wtNotSyntAttrib.matches(prevToken):
#
# 3.1) Kui nom-ile eelneb vahetult adverb, mis tavaliselt allub otse
# verbile ning ei funktsioneeri eest2iendina (nt 'ju', 'ikka',
# 'vist', 'veel' jms), siis on ysna turvaline eeldada, et nom
# ei ole mingi fraasi osa:
# Kaudseid näitajaid on_0 aga võimalik_0 analüüsida_0
# Pole_0 ju mõtet_0 hakata_0 teile ette laduma asjaolusid
# on_0 veel raske_0 kommenteerida_0
#
return True
elif self.wtNom.matches(prevToken):
if self.wtNomSemCase.matches(prevToken):
if not self.wtNomSemCase.matches(nomAdvToken):
#
# 3.2) Kui nom-ile vahetult eelnev s6na on semantilises k22ndes, aga nom
# mitte, pole nad suure t6en2osusega seotud, nt:
# Siis jääb_0 ootajal võimalus_0 öelda_0
# vahendajate juurdehindlust on_0 riigil võimalik_0 kontrollida_0 .
# Ka üürnikul on_0 selle seadusega õigus_0 maksta_0 vähem üüri
#
return True
else:
#
# 3.3) Kui nii nom kui vahetult eelnev s6na on m6lemad semantilises k22ndes,
# aga k22nded on erinevad, ei moodusta nad t6en2oliselt yhte fraasi, nt:
# pole_0 ettevõttel plaanis_0 Tartus kaugküttesooja hinda tõsta_0 .
# Ginrichi teatel on_0 vabariiklastel kavas_0 luua_0 erikomisjon ,
# et ühegi parkimismaja rajamist pole_0 linnal kavas_0 toetada_0 .
#
analyses1 = self.wtNomSemCase.matchingAnalyses(prevToken)
analyses2 = self.wtNomSemCase.matchingAnalyses(nomAdvToken)
forms1 = set([a[FORM] for a in analyses1])
forms2 = set([a[FORM] for a in analyses2])
if len(forms1.intersection(forms2))==0:
return True
elif not isNom and headVerbRoot.startswith('ole '):
#
# X) Kui tegemist on olema-ga liituva adv-ga, eeldame, et see on suurema t6en2osusega yksik,
# st pole mingi fraasi koosseisus:
# Theresel polnud_0 raskeid seasöögiämbreid tarvis_0 ubida_0 .
# Seepärast pole_0 meil ka häbi vaja_0 tunda_0
#
# NB! Alati see siiski nii ei ole, st võib liituda tähendust intensiivistav 'väga',
# 'pisut', 'palju' jms adverb, nt:
# Meil pole_0 siin palju vaja_0 pingutada_0
#
return True
return False
|
python
|
def _isLikelyNotPhrase( self, headVerbRoot, headVerbWID, nomAdvWID, widToToken):
''' Kontrollib, et nom/adv ei kuuluks mingi suurema fraasi kooseisu (poleks fraasi peas6na).
Tagastab True, kui:
*) nom/adv j2rgneb vahetult peaverbile
*) või nom/adv on vahetult osalause alguses
*) või nom-ile eelneb vahetult selline s6na, mis kindlasti ei saa olla
eestäiendiks
*) või nom/adv puhul on tegemist olema-verbi adv-ga;
'''
minWID = min(widToToken.keys())
nomAdvToken = widToToken[nomAdvWID]
isNom = self.wtNom.matches(nomAdvToken)
if headVerbWID+1 == nomAdvWID:
# 1) Kui nom/adv j2rgneb vahetult verbile, siis on ysna turvaline arvata,
# et need kuuluvad kokku, nt:
# ja seda tunnet on_0 raske_0 millegi vastu vahetada_0 .
# mida nad peavad_0 vajalikuks_0 läände müüa_0
return True
elif minWID == nomAdvWID:
# 2) Kui nom/adv on vahetult osalause alguses, siis on samuti üsna turvaline
# eeldada, et see kuulub verbiga kokku, nt:
# Tarvis_0 on_0 muretseda_0 veel auhinnafond 250 000 dollarit .
# Raske_0 on_0 temaga vaielda_0 .
return True
elif isNom and nomAdvWID-1 in widToToken:
prevToken = widToToken[nomAdvWID-1]
if self.wtNotSyntAttrib.matches(prevToken):
#
# 3.1) Kui nom-ile eelneb vahetult adverb, mis tavaliselt allub otse
# verbile ning ei funktsioneeri eest2iendina (nt 'ju', 'ikka',
# 'vist', 'veel' jms), siis on ysna turvaline eeldada, et nom
# ei ole mingi fraasi osa:
# Kaudseid näitajaid on_0 aga võimalik_0 analüüsida_0
# Pole_0 ju mõtet_0 hakata_0 teile ette laduma asjaolusid
# on_0 veel raske_0 kommenteerida_0
#
return True
elif self.wtNom.matches(prevToken):
if self.wtNomSemCase.matches(prevToken):
if not self.wtNomSemCase.matches(nomAdvToken):
#
# 3.2) Kui nom-ile vahetult eelnev s6na on semantilises k22ndes, aga nom
# mitte, pole nad suure t6en2osusega seotud, nt:
# Siis jääb_0 ootajal võimalus_0 öelda_0
# vahendajate juurdehindlust on_0 riigil võimalik_0 kontrollida_0 .
# Ka üürnikul on_0 selle seadusega õigus_0 maksta_0 vähem üüri
#
return True
else:
#
# 3.3) Kui nii nom kui vahetult eelnev s6na on m6lemad semantilises k22ndes,
# aga k22nded on erinevad, ei moodusta nad t6en2oliselt yhte fraasi, nt:
# pole_0 ettevõttel plaanis_0 Tartus kaugküttesooja hinda tõsta_0 .
# Ginrichi teatel on_0 vabariiklastel kavas_0 luua_0 erikomisjon ,
# et ühegi parkimismaja rajamist pole_0 linnal kavas_0 toetada_0 .
#
analyses1 = self.wtNomSemCase.matchingAnalyses(prevToken)
analyses2 = self.wtNomSemCase.matchingAnalyses(nomAdvToken)
forms1 = set([a[FORM] for a in analyses1])
forms2 = set([a[FORM] for a in analyses2])
if len(forms1.intersection(forms2))==0:
return True
elif not isNom and headVerbRoot.startswith('ole '):
#
# X) Kui tegemist on olema-ga liituva adv-ga, eeldame, et see on suurema t6en2osusega yksik,
# st pole mingi fraasi koosseisus:
# Theresel polnud_0 raskeid seasöögiämbreid tarvis_0 ubida_0 .
# Seepärast pole_0 meil ka häbi vaja_0 tunda_0
#
# NB! Alati see siiski nii ei ole, st võib liituda tähendust intensiivistav 'väga',
# 'pisut', 'palju' jms adverb, nt:
# Meil pole_0 siin palju vaja_0 pingutada_0
#
return True
return False
|
[
"def",
"_isLikelyNotPhrase",
"(",
"self",
",",
"headVerbRoot",
",",
"headVerbWID",
",",
"nomAdvWID",
",",
"widToToken",
")",
":",
"minWID",
"=",
"min",
"(",
"widToToken",
".",
"keys",
"(",
")",
")",
"nomAdvToken",
"=",
"widToToken",
"[",
"nomAdvWID",
"]",
"isNom",
"=",
"self",
".",
"wtNom",
".",
"matches",
"(",
"nomAdvToken",
")",
"if",
"headVerbWID",
"+",
"1",
"==",
"nomAdvWID",
":",
"# 1) Kui nom/adv j2rgneb vahetult verbile, siis on ysna turvaline arvata,\r",
"# et need kuuluvad kokku, nt:\r",
"# ja seda tunnet on_0 raske_0 millegi vastu vahetada_0 .\r",
"# mida nad peavad_0 vajalikuks_0 läände müüa_0\r",
"return",
"True",
"elif",
"minWID",
"==",
"nomAdvWID",
":",
"# 2) Kui nom/adv on vahetult osalause alguses, siis on samuti üsna turvaline\r",
"# eeldada, et see kuulub verbiga kokku, nt:\r",
"# Tarvis_0 on_0 muretseda_0 veel auhinnafond 250 000 dollarit .\r",
"# Raske_0 on_0 temaga vaielda_0 .\r",
"return",
"True",
"elif",
"isNom",
"and",
"nomAdvWID",
"-",
"1",
"in",
"widToToken",
":",
"prevToken",
"=",
"widToToken",
"[",
"nomAdvWID",
"-",
"1",
"]",
"if",
"self",
".",
"wtNotSyntAttrib",
".",
"matches",
"(",
"prevToken",
")",
":",
"#\r",
"# 3.1) Kui nom-ile eelneb vahetult adverb, mis tavaliselt allub otse \r",
"# verbile ning ei funktsioneeri eest2iendina (nt 'ju', 'ikka',\r",
"# 'vist', 'veel' jms), siis on ysna turvaline eeldada, et nom\r",
"# ei ole mingi fraasi osa:\r",
"# Kaudseid näitajaid on_0 aga võimalik_0 analüüsida_0\r",
"# Pole_0 ju mõtet_0 hakata_0 teile ette laduma asjaolusid\r",
"# on_0 veel raske_0 kommenteerida_0\r",
"#\r",
"return",
"True",
"elif",
"self",
".",
"wtNom",
".",
"matches",
"(",
"prevToken",
")",
":",
"if",
"self",
".",
"wtNomSemCase",
".",
"matches",
"(",
"prevToken",
")",
":",
"if",
"not",
"self",
".",
"wtNomSemCase",
".",
"matches",
"(",
"nomAdvToken",
")",
":",
"#\r",
"# 3.2) Kui nom-ile vahetult eelnev s6na on semantilises k22ndes, aga nom\r",
"# mitte, pole nad suure t6en2osusega seotud, nt:\r",
"# Siis jääb_0 ootajal võimalus_0 öelda_0 \r",
"# vahendajate juurdehindlust on_0 riigil võimalik_0 kontrollida_0 .\r",
"# Ka üürnikul on_0 selle seadusega õigus_0 maksta_0 vähem üüri\r",
"#\r",
"return",
"True",
"else",
":",
"#\r",
"# 3.3) Kui nii nom kui vahetult eelnev s6na on m6lemad semantilises k22ndes, \r",
"# aga k22nded on erinevad, ei moodusta nad t6en2oliselt yhte fraasi, nt:\r",
"# pole_0 ettevõttel plaanis_0 Tartus kaugküttesooja hinda tõsta_0 .\r",
"# Ginrichi teatel on_0 vabariiklastel kavas_0 luua_0 erikomisjon ,\r",
"# et ühegi parkimismaja rajamist pole_0 linnal kavas_0 toetada_0 .\r",
"#\r",
"analyses1",
"=",
"self",
".",
"wtNomSemCase",
".",
"matchingAnalyses",
"(",
"prevToken",
")",
"analyses2",
"=",
"self",
".",
"wtNomSemCase",
".",
"matchingAnalyses",
"(",
"nomAdvToken",
")",
"forms1",
"=",
"set",
"(",
"[",
"a",
"[",
"FORM",
"]",
"for",
"a",
"in",
"analyses1",
"]",
")",
"forms2",
"=",
"set",
"(",
"[",
"a",
"[",
"FORM",
"]",
"for",
"a",
"in",
"analyses2",
"]",
")",
"if",
"len",
"(",
"forms1",
".",
"intersection",
"(",
"forms2",
")",
")",
"==",
"0",
":",
"return",
"True",
"elif",
"not",
"isNom",
"and",
"headVerbRoot",
".",
"startswith",
"(",
"'ole '",
")",
":",
"#\r",
"# X) Kui tegemist on olema-ga liituva adv-ga, eeldame, et see on suurema t6en2osusega yksik, \r",
"# st pole mingi fraasi koosseisus:\r",
"# Theresel polnud_0 raskeid seasöögiämbreid tarvis_0 ubida_0 .\r",
"# Seepärast pole_0 meil ka häbi vaja_0 tunda_0\r",
"#\r",
"# NB! Alati see siiski nii ei ole, st võib liituda tähendust intensiivistav 'väga',\r",
"# 'pisut', 'palju' jms adverb, nt:\r",
"# Meil pole_0 siin palju vaja_0 pingutada_0\r",
"#\r",
"return",
"True",
"return",
"False"
] |
Kontrollib, et nom/adv ei kuuluks mingi suurema fraasi kooseisu (poleks fraasi peas6na).
Tagastab True, kui:
*) nom/adv j2rgneb vahetult peaverbile
*) või nom/adv on vahetult osalause alguses
*) või nom-ile eelneb vahetult selline s6na, mis kindlasti ei saa olla
eestäiendiks
*) või nom/adv puhul on tegemist olema-verbi adv-ga;
|
[
"Kontrollib",
"et",
"nom",
"/",
"adv",
"ei",
"kuuluks",
"mingi",
"suurema",
"fraasi",
"kooseisu",
"(",
"poleks",
"fraasi",
"peas6na",
")",
".",
"Tagastab",
"True",
"kui",
":",
"*",
")",
"nom",
"/",
"adv",
"j2rgneb",
"vahetult",
"peaverbile",
"*",
")",
"või",
"nom",
"/",
"adv",
"on",
"vahetult",
"osalause",
"alguses",
"*",
")",
"või",
"nom",
"-",
"ile",
"eelneb",
"vahetult",
"selline",
"s6na",
"mis",
"kindlasti",
"ei",
"saa",
"olla",
"eestäiendiks",
"*",
")",
"või",
"nom",
"/",
"adv",
"puhul",
"on",
"tegemist",
"olema",
"-",
"verbi",
"adv",
"-",
"ga",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/mw_verbs/verbchain_nom_vinf_extender.py#L133-L207
|
train
|
Returns True if the given head verb is not phrase.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,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qT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + '\062' + chr(0b110001) + '\061', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100111 + 0o14) + chr(2330 - 2275) + chr(0b110001), 3580 - 3572), nzTpIcepk0o8(chr(2077 - 2029) + chr(111) + chr(51) + chr(0b1001 + 0o51) + chr(50), 0b1000), nzTpIcepk0o8(chr(235 - 187) + '\x6f' + chr(0b110 + 0o55) + '\067' + '\063', 0o10), nzTpIcepk0o8(chr(48) + chr(3535 - 3424) + chr(121 - 72) + chr(50) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(3342 - 3231) + chr(2147 - 2097) + chr(48) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(137 - 89) + '\157' + chr(0b11111 + 0o24) + '\x35' + '\x30', 0o10), nzTpIcepk0o8(chr(190 - 142) + '\157' + '\x34' + chr(49), 47306 - 47298), nzTpIcepk0o8(chr(48) + chr(0b110100 + 0o73) + chr(0b110111) + chr(51), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110100) + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1001000 + 0o47) + chr(52) + chr(0b101101 + 0o5), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b11100 + 0o30) + '\x33', 34874 - 34866), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(111) + chr(49) + chr(0b11001 + 0o32) + chr(54), 38089 - 38081), nzTpIcepk0o8('\x30' + chr(111) + chr(49) + chr(55) + chr(0b110010), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\062' + '\064' + '\x37', 63940 - 63932), nzTpIcepk0o8('\x30' + chr(111) + chr(0b101110 + 0o4) + chr(0b110011) + chr(0b1 + 0o57), 0b1000), nzTpIcepk0o8(chr(298 - 250) + chr(0b1101111) + chr(1296 - 1245) + chr(48) + chr(52), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011) + chr(0b110111) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(0b1101111) + chr(0b100100 + 0o17) + chr(0b100 + 0o55) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\x6f' + '\x33' + chr(54) + '\060', 0b1000), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(8012 - 7901) + chr(0b110011) + chr(49) + chr(0b10000 + 0o47), 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + '\157' + '\x33' + '\066' + '\062', 37444 - 37436), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(2307 - 2256) + chr(0b11101 + 0o24) + '\x31', ord("\x08")), nzTpIcepk0o8(chr(444 - 396) + chr(111) + chr(0b110011) + chr(1060 - 1009) + chr(49), 0b1000), nzTpIcepk0o8(chr(573 - 525) + '\157' + chr(0b1111 + 0o43) + chr(1473 - 1418) + '\x33', 48063 - 48055), nzTpIcepk0o8(chr(326 - 278) + '\x6f' + chr(1129 - 1078) + chr(0b110111) + chr(1066 - 1015), 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b11010 + 0o30) + chr(1755 - 1706), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(49) + chr(1609 - 1557), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(1789 - 1739) + chr(0b110001), 8), nzTpIcepk0o8('\060' + chr(3253 - 3142) + '\x32' + '\x32' + '\065', 524 - 516), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + chr(54) + '\062', 8), nzTpIcepk0o8(chr(507 - 459) + chr(0b1101010 + 0o5) + chr(0b10100 + 0o35) + chr(0b110001) + '\x33', 40073 - 40065), nzTpIcepk0o8('\x30' + '\157' + '\x36' + '\067', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100001 + 0o21), 29424 - 29416), nzTpIcepk0o8(chr(0b110000) + chr(8228 - 8117) + chr(52), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(5827 - 5716) + '\x31' + chr(1883 - 1829) + '\x30', ord("\x08")), nzTpIcepk0o8('\060' + chr(5521 - 5410) + chr(2475 - 2424), 0o10), nzTpIcepk0o8('\060' + '\157' + '\x32' + '\060' + '\063', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110101) + chr(0b11110 + 0o24), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1951 - 1901) + '\x30' + '\x36', ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + '\x6f' + '\065' + '\060', 41538 - 41530)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xa7'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(101))('\165' + chr(5974 - 5858) + '\x66' + chr(1043 - 998) + chr(0b110111 + 0o1)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def AX7DUss17tkU(hXMPsSrOQzbh, pzSrbLY9vKoV, spL00kDdDnQS, OQnxK_EghuDT, tPPwt53c3V2p):
A9_8l4obLp68 = XURpmPuEWCNF(tPPwt53c3V2p.keys())
BG_1rd7hhoO9 = tPPwt53c3V2p[OQnxK_EghuDT]
NhFq2_AVllUt = hXMPsSrOQzbh.wtNom.ONopK8INb53O(BG_1rd7hhoO9)
if spL00kDdDnQS + nzTpIcepk0o8(chr(0b110000) + chr(0b1010101 + 0o32) + chr(49), 8094 - 8086) == OQnxK_EghuDT:
return nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(111) + chr(2210 - 2161), 8)
elif A9_8l4obLp68 == OQnxK_EghuDT:
return nzTpIcepk0o8(chr(0b1011 + 0o45) + '\157' + chr(49), 8)
elif NhFq2_AVllUt and OQnxK_EghuDT - nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001), 8) in tPPwt53c3V2p:
FrzoxjNmF7m5 = tPPwt53c3V2p[OQnxK_EghuDT - nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001), 8)]
if roI3spqORKae(hXMPsSrOQzbh.wtNotSyntAttrib, roI3spqORKae(ES5oEprVxulp(b'\xc6\xb7\xbd\x8b\x1e\xbc\xa1oY\xd5\x11l'), chr(0b1100100) + chr(522 - 421) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(101))('\x75' + chr(0b1010010 + 0o42) + chr(0b1100110) + chr(801 - 756) + chr(0b111000)))(FrzoxjNmF7m5):
return nzTpIcepk0o8(chr(0b111 + 0o51) + '\x6f' + '\061', 8)
elif roI3spqORKae(hXMPsSrOQzbh.wtNom, roI3spqORKae(ES5oEprVxulp(b'\xc6\xb7\xbd\x8b\x1e\xbc\xa1oY\xd5\x11l'), '\144' + '\145' + chr(99) + chr(0b1101111) + chr(1929 - 1829) + chr(101))('\x75' + chr(0b1110 + 0o146) + '\146' + chr(45) + '\070'))(FrzoxjNmF7m5):
if roI3spqORKae(hXMPsSrOQzbh.wtNomSemCase, roI3spqORKae(ES5oEprVxulp(b'\xc6\xb7\xbd\x8b\x1e\xbc\xa1oY\xd5\x11l'), '\x64' + chr(0b1100101) + chr(6959 - 6860) + '\x6f' + chr(9302 - 9202) + '\145')(chr(0b111 + 0o156) + chr(116) + '\x66' + chr(0b11010 + 0o23) + chr(3006 - 2950)))(FrzoxjNmF7m5):
if not roI3spqORKae(hXMPsSrOQzbh.wtNomSemCase, roI3spqORKae(ES5oEprVxulp(b'\xc6\xb7\xbd\x8b\x1e\xbc\xa1oY\xd5\x11l'), '\x64' + chr(0b101011 + 0o72) + '\x63' + '\157' + '\144' + '\x65')(chr(3756 - 3639) + chr(7078 - 6962) + chr(0b1010011 + 0o23) + '\055' + '\x38'))(BG_1rd7hhoO9):
return nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001), 8)
else:
Wu2DbVHBsMHp = hXMPsSrOQzbh.wtNomSemCase.matchingAnalyses(FrzoxjNmF7m5)
gjngrcKR87Y4 = hXMPsSrOQzbh.wtNomSemCase.matchingAnalyses(BG_1rd7hhoO9)
JGnMtBsiNpGW = Bvi71nNyvlqO([AQ9ceR9AaoT1[invlgHm8TzbV] for AQ9ceR9AaoT1 in Wu2DbVHBsMHp])
nDvPBn3539nM = Bvi71nNyvlqO([AQ9ceR9AaoT1[invlgHm8TzbV] for AQ9ceR9AaoT1 in gjngrcKR87Y4])
if ftfygxgFas5X(roI3spqORKae(JGnMtBsiNpGW, roI3spqORKae(ES5oEprVxulp(b"\xe0\x97\xa6\x9e'\xf7\x8dBO\x89MM"), chr(100) + chr(0b1000 + 0o135) + '\143' + chr(111) + chr(1957 - 1857) + chr(8061 - 7960))(chr(7109 - 6992) + '\164' + chr(993 - 891) + '\055' + chr(0b10011 + 0o45)))(nDvPBn3539nM)) == nzTpIcepk0o8(chr(0b101011 + 0o5) + '\x6f' + chr(842 - 794), 0b1000):
return nzTpIcepk0o8(chr(0b110000) + chr(0b10 + 0o155) + chr(0b110001), 8)
elif not NhFq2_AVllUt and roI3spqORKae(pzSrbLY9vKoV, roI3spqORKae(ES5oEprVxulp(b'\xfa\x8d\xb3\x89!\xf7\x9fHO\x88'), chr(0b110100 + 0o60) + chr(0b1100101) + '\x63' + '\157' + chr(607 - 507) + chr(0b1100101))(chr(117) + '\164' + '\x66' + '\x2d' + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\xe6\x95\xb7\xdb'), chr(0b1010111 + 0o15) + chr(0b1100101) + chr(9223 - 9124) + chr(5258 - 5147) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b100101 + 0o117) + chr(102) + chr(0b101101) + '\070')):
return nzTpIcepk0o8('\060' + chr(0b1000001 + 0o56) + '\061', 8)
return nzTpIcepk0o8(chr(48) + '\157' + chr(0b110000), 8)
|
estnltk/estnltk
|
estnltk/mw_verbs/verbchain_nom_vinf_extender.py
|
VerbChainNomVInfExtender._canBeExpanded
|
def _canBeExpanded( self, headVerbRoot, headVerbWID, suitableNomAdvExpansions, expansionVerbs, widToToken ):
''' Teeb kindlaks, kas kontekst on verbiahela laiendamiseks piisavalt selge/yhene:
1) Nii 'nom/adv' kandidaate kui ka Vinf kandidaate on täpselt üks;
2) Nom/adv ei kuulu mingi suurema fraasi kooseisu (meetodi _isLikelyNotPhrase() abil);
Kui tingimused täidetud, tagastab lisatava verbi listist expansionVerbs, vastasel juhul
tagastab None;
'''
if len(suitableNomAdvExpansions)==1 and expansionVerbs:
# Kontrollime, kas leidub t2pselt yks laiendiks sobiv verb (kui leidub
# rohkem, on kontekst kahtlane ja raske otsustada, kas tasub laiendada
# v6i mitte)
suitableExpansionVerbs = \
[expVerb for expVerb in expansionVerbs if expVerb[2] == suitableNomAdvExpansions[0][2]]
if len( suitableExpansionVerbs ) == 1:
# Kontrollime, et nom/adv ei kuuluks mingi suurema fraasi kooseisu (ei oleks fraasi
# peas6na);
nomAdvWID = suitableNomAdvExpansions[0][0]
if self._isLikelyNotPhrase( headVerbRoot, headVerbWID, nomAdvWID, widToToken ):
return suitableExpansionVerbs[0]
return None
|
python
|
def _canBeExpanded( self, headVerbRoot, headVerbWID, suitableNomAdvExpansions, expansionVerbs, widToToken ):
''' Teeb kindlaks, kas kontekst on verbiahela laiendamiseks piisavalt selge/yhene:
1) Nii 'nom/adv' kandidaate kui ka Vinf kandidaate on täpselt üks;
2) Nom/adv ei kuulu mingi suurema fraasi kooseisu (meetodi _isLikelyNotPhrase() abil);
Kui tingimused täidetud, tagastab lisatava verbi listist expansionVerbs, vastasel juhul
tagastab None;
'''
if len(suitableNomAdvExpansions)==1 and expansionVerbs:
# Kontrollime, kas leidub t2pselt yks laiendiks sobiv verb (kui leidub
# rohkem, on kontekst kahtlane ja raske otsustada, kas tasub laiendada
# v6i mitte)
suitableExpansionVerbs = \
[expVerb for expVerb in expansionVerbs if expVerb[2] == suitableNomAdvExpansions[0][2]]
if len( suitableExpansionVerbs ) == 1:
# Kontrollime, et nom/adv ei kuuluks mingi suurema fraasi kooseisu (ei oleks fraasi
# peas6na);
nomAdvWID = suitableNomAdvExpansions[0][0]
if self._isLikelyNotPhrase( headVerbRoot, headVerbWID, nomAdvWID, widToToken ):
return suitableExpansionVerbs[0]
return None
|
[
"def",
"_canBeExpanded",
"(",
"self",
",",
"headVerbRoot",
",",
"headVerbWID",
",",
"suitableNomAdvExpansions",
",",
"expansionVerbs",
",",
"widToToken",
")",
":",
"if",
"len",
"(",
"suitableNomAdvExpansions",
")",
"==",
"1",
"and",
"expansionVerbs",
":",
"# Kontrollime, kas leidub t2pselt yks laiendiks sobiv verb (kui leidub\r",
"# rohkem, on kontekst kahtlane ja raske otsustada, kas tasub laiendada \r",
"# v6i mitte)\r",
"suitableExpansionVerbs",
"=",
"[",
"expVerb",
"for",
"expVerb",
"in",
"expansionVerbs",
"if",
"expVerb",
"[",
"2",
"]",
"==",
"suitableNomAdvExpansions",
"[",
"0",
"]",
"[",
"2",
"]",
"]",
"if",
"len",
"(",
"suitableExpansionVerbs",
")",
"==",
"1",
":",
"# Kontrollime, et nom/adv ei kuuluks mingi suurema fraasi kooseisu (ei oleks fraasi\r",
"# peas6na);\r",
"nomAdvWID",
"=",
"suitableNomAdvExpansions",
"[",
"0",
"]",
"[",
"0",
"]",
"if",
"self",
".",
"_isLikelyNotPhrase",
"(",
"headVerbRoot",
",",
"headVerbWID",
",",
"nomAdvWID",
",",
"widToToken",
")",
":",
"return",
"suitableExpansionVerbs",
"[",
"0",
"]",
"return",
"None"
] |
Teeb kindlaks, kas kontekst on verbiahela laiendamiseks piisavalt selge/yhene:
1) Nii 'nom/adv' kandidaate kui ka Vinf kandidaate on täpselt üks;
2) Nom/adv ei kuulu mingi suurema fraasi kooseisu (meetodi _isLikelyNotPhrase() abil);
Kui tingimused täidetud, tagastab lisatava verbi listist expansionVerbs, vastasel juhul
tagastab None;
|
[
"Teeb",
"kindlaks",
"kas",
"kontekst",
"on",
"verbiahela",
"laiendamiseks",
"piisavalt",
"selge",
"/",
"yhene",
":",
"1",
")",
"Nii",
"nom",
"/",
"adv",
"kandidaate",
"kui",
"ka",
"Vinf",
"kandidaate",
"on",
"täpselt",
"üks",
";",
"2",
")",
"Nom",
"/",
"adv",
"ei",
"kuulu",
"mingi",
"suurema",
"fraasi",
"kooseisu",
"(",
"meetodi",
"_isLikelyNotPhrase",
"()",
"abil",
")",
";",
"Kui",
"tingimused",
"täidetud",
"tagastab",
"lisatava",
"verbi",
"listist",
"expansionVerbs",
"vastasel",
"juhul",
"tagastab",
"None",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/mw_verbs/verbchain_nom_vinf_extender.py#L210-L229
|
train
|
Returns whether or not the given tag is able to be expanded.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSE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I3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + '\157' + '\067' + chr(0b100110 + 0o21), 42522 - 42514), nzTpIcepk0o8(chr(48) + chr(7780 - 7669) + chr(0b110010) + '\x37' + '\x37', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1110 + 0o141) + chr(0b101 + 0o54) + '\065' + chr(0b11010 + 0o35), 0b1000), nzTpIcepk0o8('\x30' + '\157' + '\062' + chr(2699 - 2647) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(111) + chr(2550 - 2499) + '\x34' + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + '\x34' + chr(0b110010 + 0o1), ord("\x08")), nzTpIcepk0o8(chr(586 - 538) + chr(0b1101111) + chr(50) + chr(54) + chr(0b110010), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\063' + chr(0b1011 + 0o47) + '\064', ord("\x08")), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b1101111) + '\062' + chr(0b110011) + chr(0b100001 + 0o22), 0b1000), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(111) + chr(1383 - 1328) + chr(1888 - 1836), 0b1000), nzTpIcepk0o8('\x30' + chr(0b101111 + 0o100) + '\063' + chr(1426 - 1373), 0b1000), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + chr(0b110010) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + '\x37' + '\062', 11974 - 11966), nzTpIcepk0o8('\060' + '\157' + '\x36' + chr(51), 0o10), nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b11111 + 0o120) + chr(0b110 + 0o55) + '\061' + chr(1049 - 996), ord("\x08")), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(0b1101111 + 0o0) + chr(1066 - 1015) + chr(0b110101) + chr(1733 - 1682), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110110), 3431 - 3423), nzTpIcepk0o8('\x30' + '\x6f' + chr(1958 - 1907) + '\061' + chr(0b110011), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\067' + chr(0b110111), 8), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(50) + '\x32' + chr(2229 - 2181), 0b1000), nzTpIcepk0o8(chr(1525 - 1477) + chr(111) + chr(2364 - 2314) + chr(0b110111) + chr(55), 8), nzTpIcepk0o8('\060' + chr(0b1000010 + 0o55) + '\x31' + chr(1550 - 1498) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(199 - 151) + '\x6f' + chr(1655 - 1605) + '\067' + chr(48), 0b1000), nzTpIcepk0o8(chr(48) + chr(2873 - 2762) + chr(0b11000 + 0o31) + '\x31' + chr(0b10100 + 0o36), 0b1000), nzTpIcepk0o8(chr(1167 - 1119) + chr(0b1001010 + 0o45) + '\061' + '\x32' + '\x36', 23398 - 23390), nzTpIcepk0o8(chr(1445 - 1397) + chr(0b1101111) + '\x31' + chr(0b110000) + chr(494 - 444), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1011011 + 0o24) + chr(459 - 410) + chr(0b110111) + '\061', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1000111 + 0o50) + chr(51) + chr(51) + chr(51), 33457 - 33449), nzTpIcepk0o8('\x30' + '\x6f' + chr(1614 - 1565) + chr(0b100101 + 0o17) + chr(0b101 + 0o62), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\061' + chr(1489 - 1437) + '\x32', 0o10), nzTpIcepk0o8('\x30' + chr(0b110011 + 0o74) + '\x34' + chr(0b101100 + 0o6), 0b1000), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b1101111) + '\061' + '\060', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b10010 + 0o43) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(1743 - 1695) + chr(0b1101111) + '\x32' + chr(0b110001) + '\066', 9364 - 9356), nzTpIcepk0o8('\060' + chr(8481 - 8370) + chr(51) + '\x37', 0o10), nzTpIcepk0o8(chr(0b11101 + 0o23) + '\x6f' + '\062' + chr(0b11110 + 0o23) + '\062', 54502 - 54494), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(50) + chr(0b110010 + 0o4), 26663 - 26655), nzTpIcepk0o8('\060' + chr(111) + chr(1149 - 1100) + '\x34' + chr(1007 - 958), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1100100 + 0o13) + chr(0b110011) + '\x31', 57205 - 57197), nzTpIcepk0o8(chr(85 - 37) + chr(0b1101111) + '\x33' + chr(53) + chr(0b101000 + 0o12), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\157' + '\x35' + chr(48), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x11'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1101000 + 0o7) + '\x64' + '\145')('\165' + chr(2410 - 2294) + chr(0b1100110) + '\x2d' + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def KtfvzaHWuTg1(hXMPsSrOQzbh, pzSrbLY9vKoV, spL00kDdDnQS, HiHzeKKzaxK4, iT0iLKuSRuWw, tPPwt53c3V2p):
if ftfygxgFas5X(HiHzeKKzaxK4) == nzTpIcepk0o8(chr(674 - 626) + '\157' + chr(49), 36993 - 36985) and iT0iLKuSRuWw:
wpykuoDY8igU = [ifFsL5COeqT9 for ifFsL5COeqT9 in iT0iLKuSRuWw if ifFsL5COeqT9[nzTpIcepk0o8(chr(1427 - 1379) + chr(0b1101111) + chr(1921 - 1871), 0o10)] == HiHzeKKzaxK4[nzTpIcepk0o8(chr(0b110000) + chr(0b1101010 + 0o5) + chr(0b110000), 0o10)][nzTpIcepk0o8('\x30' + '\157' + chr(400 - 350), 8)]]
if ftfygxgFas5X(wpykuoDY8igU) == nzTpIcepk0o8(chr(48) + '\157' + '\061', 8):
OQnxK_EghuDT = HiHzeKKzaxK4[nzTpIcepk0o8(chr(2006 - 1958) + '\157' + '\x30', 8)][nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b100 + 0o54), 8)]
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'`\xd6\x1c\xee\x8e\x08\xd7\xb8\xe2rr\xe6\xaa[\xbf\x8au\xae'), chr(100) + chr(101) + '\143' + chr(5417 - 5306) + '\x64' + chr(0b11010 + 0o113))(chr(0b1001110 + 0o47) + chr(0b111111 + 0o65) + chr(0b110010 + 0o64) + '\055' + chr(0b11100 + 0o34)))(pzSrbLY9vKoV, spL00kDdDnQS, OQnxK_EghuDT, tPPwt53c3V2p):
return wpykuoDY8igU[nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\060', 8)]
return None
|
estnltk/estnltk
|
estnltk/mw_verbs/verbchain_nom_vinf_extender.py
|
VerbChainNomVInfExtender.extendChainsInClause
|
def extendChainsInClause( self, clause, clauseID, foundChains ):
''' Proovime etteantud osalauses leiduvaid verbiahelaid täiendada 'verb-nom/adv-vinf'
rektsiooniseostega, nt:
andma + võimalus + Vda : talle anti_0 võimalus_0 olukorda parandada_0
olema + vaja + Vda : nüüd on_0 küll vaja_0 asi lõpetada_0
Teeme seda kahel moel:
1) kui mingi olemasoleva verbiahela keskelt on puudu 'nom/adv' (nt 'andma', 'jätma'
verbide vinf rektsiooniseoste leidmisel võib tekkida selliseid lünki), siis
lisame ahela keskele 'nom/adv' sõna.
2) kui verbiahela lõpus on verb, mis on sageli ülemuseks 'nom/adv' sõnale, millest
omakorda sõltub mingi Vinf verb (Vma, Vda), ning need on osalausekontekstis olemas,
lisame need verbiahela lõppu;
'''
expansionPerformed = False
# J22dvustame s6nad, mis kuuluvad juba mingi tuvastatud verbifraasi koosseisu
annotatedWords = []
for verbObj in foundChains:
if clauseID == verbObj[CLAUSE_IDX] and (len(verbObj[PATTERN])==1 and \
re.match('^(ei|ära|ega)$', verbObj[PATTERN][0])):
# V2lja j22vad yksikuna esinevad ei/ära/ega, kuna need tõenäoliselt ei sega
continue
annotatedWords.extend( verbObj[PHRASE] )
widToToken = { token[WORD_ID] : token for token in clause }
verbDaMa = WordTemplate({POSTAG:'V', FORM:'^(da|ma)$'})
verbOle = WordTemplate({ROOT:'^ole$',POSTAG:'V'})
#
# 1) Yritame leida, millised juba tuvastatud verbiahelatest on sellised, kust on
# vahelt puudu nom/adv s6na, nt:
# annab_0 kunstnik jälle põhjuse endast kirjutada_0
# see annab_0 võimaluse laua tagant tõusta_0 ja_0 minema jalutada_0
# Kui leiame ahelast puuduoleva s6na ja lisame selle ahelasse ...
#
for verbObj in foundChains:
if clauseID == verbObj[CLAUSE_IDX]:
headVerb = ''
headVerbWID = -1
dependentVerb = ''
dependentVerbWIDs = []
firstDependentVerbID = -1
# Leiame ahela l6pust ylemus-verbi ja sellele alluva verbi
if len(verbObj[PATTERN]) > 3 and verbObj[PATTERN][-2] == '&':
headVerb = verbObj[ROOTS][-4]+" "+verbObj[POLARITY]
dependentVerb = verbObj[MORPH][-3]
headVerbWID = verbObj[PHRASE][-4]
dependentVerbWIDs.append( verbObj[PHRASE][-3] )
dependentVerbWIDs.append( verbObj[PHRASE][-1] )
firstDependentVerbID = len(verbObj[PHRASE])-3
elif len(verbObj[PATTERN]) > 1 and verbObj[PATTERN][-2]=='verb':
headVerb = verbObj[ROOTS][-2]+" "+verbObj[POLARITY]
dependentVerb = verbObj[MORPH][-1]
headVerbWID = verbObj[PHRASE][-2]
dependentVerbWIDs.append(verbObj[PHRASE][-1])
firstDependentVerbID = len(verbObj[PHRASE])-1
# Kontrollime, kas ylemusverb ja sellele alluv verb v6iksid olla yhendatud
# mingi nom/adv s6na kaudu
if headVerb in self.verbRules and headVerb in self.verbToVinf and \
dependentVerb in self.verbToVinf[headVerb]:
# Teeme kindlaks, kas s6nade vahele j22b puuduolev nom/adv
minInd = min(min(dependentVerbWIDs), headVerbWID-1)
maxInd = max(max(dependentVerbWIDs)-1, headVerbWID)
if minInd < maxInd:
for i in range(minInd, maxInd+1):
if i in widToToken and i not in annotatedWords:
token = widToToken[i]
matchingAnalyses = self.tokenMatchesNomAdvVinf( token, headVerb, dependentVerb )
if matchingAnalyses and not expansionPerformed:
# Kontrollime, kas vaheletorgatav sõna paikneb nii, et see on suure
# tõenäosusega üksiksõna, mitte fraas.
if self._isLikelyNotPhrase( headVerb, headVerbWID, token[WORD_ID], widToToken ):
# Torkame nimis6na/adverbi vahele
verbObj[PHRASE].insert( firstDependentVerbID, token[WORD_ID] )
verbObj[PATTERN].insert( firstDependentVerbID, 'nom/adv' )
verbObj[ANALYSIS_IDS].insert( firstDependentVerbID, matchingAnalyses )
annotatedWords.append( token[WORD_ID] )
expansionPerformed = True
else:
# Kui me ei saa olla kindlad, et vaheletorgatav sõna pole fraas, paneme
# küsimärgi, näitamaks, et verbiahelast on suure tõenäosusega midagi
# puudu ...
verbObj[OTHER_VERBS] = True
#_debugPrint( ' '+('+'.join(verbObj[PATTERN]))+' | '+_getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
#
# 2) Yritame luua uusi ahelaid, laiendades verbe olemasolevate ahelate l6pus:
#
# millega antakse_0 võimalus_1 sõlmida_1 uus kokkulepe .
# puudub_0 võimalus_1 spetsialiste täistööajaga rakendada_1 .
# kui on_0 võimalus_1 rahulikult vooluga kaasa minna_1
#
clauseMaxWID = max( list(widToToken.keys()) )
for verbObj in foundChains:
if clauseID == verbObj[CLAUSE_IDX] and verbObj[OTHER_VERBS]:
if (len(verbObj[PATTERN])==1 or (len(verbObj[PATTERN])>1 and \
verbObj[PATTERN][-2] != '&')):
headVerb = verbObj[ROOTS][-1]+" "+verbObj[POLARITY]
headVerbWID = verbObj[PHRASE][-1]
#
# 2.1) Esimeses l2henduses vaatame tavalisi verbe (mitte-olema);
#
if headVerb in self.verbRules and not headVerb.startswith('ole '):
minInd = headVerbWID-1 if verbObj[PATTERN][0]!='ega' else headVerbWID
suitableNomAdvExpansions = []
expansionVerbs = []
for i in range(minInd, clauseMaxWID+1):
if i in widToToken and i not in annotatedWords:
token = widToToken[i]
if _isFollowedByComma( i, clause ):
# Katkestame, kui satume koma otsa (kuna ei saa kindel olla,
# et teisel pool koma on olevad jupid kuuluvad ikka verbi
# juurde)
break
if verbDaMa.matches( token ):
analysisIDs = _getMatchingAnalysisIDs( token, verbDaMa )
form = token[ANALYSIS][analysisIDs[0]][FORM]
expansionVerbs.append( [i, token, "V_"+form ] )
else:
for (nounAdv, vinf1) in self.verbRules[headVerb]:
if (self.nomAdvWordTemplates[nounAdv]).matches(token):
suitableNomAdvExpansions.append( [i, token, vinf1, \
(self.nomAdvWordTemplates[nounAdv]), nounAdv ] )
# Teeme kindlaks, kas kontekst on laiendamiseks piisavalt yhene/selge ...
suitableExpansionVerb = \
self._canBeExpanded( headVerb, headVerbWID, suitableNomAdvExpansions, \
expansionVerbs, widToToken )
if suitableExpansionVerb:
phraseExt = [suitableNomAdvExpansions[0][0], suitableExpansionVerb[0]]
expIsOle = verbOle.matches(suitableExpansionVerb[1])
patternExt = ['nom/adv', 'ole' if expIsOle else 'verb']
analysisIDsExt = [ \
_getMatchingAnalysisIDs( suitableNomAdvExpansions[0][1], \
suitableNomAdvExpansions[0][3] ), \
_getMatchingAnalysisIDs( suitableExpansionVerb[1], verbDaMa ) ]
# Lisame ahelale pikendused
verbObj[PHRASE].extend( phraseExt )
verbObj[PATTERN].extend( patternExt )
verbObj[ANALYSIS_IDS].extend( analysisIDsExt )
annotatedWords.extend( phraseExt )
expansionPerformed = True
#if headVerb.startswith('and '):
# _debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
#_debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
elif headVerb in self.verbRules and headVerb.startswith('ole '):
#
# 2.2) Vaatame olema-verbi rektsiooniseoseid;
#
minInd = headVerbWID-1 if verbObj[PATTERN][0]!='ega' else headVerbWID
suitableNomAdvExpansions = []
expansionVerbs = []
for i in range(minInd, clauseMaxWID+1):
if i in widToToken and i not in annotatedWords:
token = widToToken[i]
if verbDaMa.matches( token ):
analysisIDs = _getMatchingAnalysisIDs( token, verbDaMa )
form = token[ANALYSIS][analysisIDs[0]][FORM]
expansionVerbs.append( [i, token, "V_"+form ] )
else:
for (nounAdv, vinf1) in self.verbRules[headVerb]:
if (self.nomAdvWordTemplates[nounAdv]).matches(token):
suitableNomAdvExpansions.append( [i, token, vinf1, \
(self.nomAdvWordTemplates[nounAdv]), nounAdv] )
if _isFollowedByComma( i, clause ):
# Katkestame, kui satume koma otsa (kuna ei saa kindel olla,
# et teisel pool koma on olevad jupid kuuluvad ikka verbi
# juurde)
break
# Teeme kindlaks, kas kontekst on laiendamiseks piisavalt yhene/selge ...
suitableExpansionVerb = \
self._canBeExpanded( headVerb, headVerbWID, suitableNomAdvExpansions, \
expansionVerbs, widToToken )
if suitableExpansionVerb:
phraseExt = [suitableNomAdvExpansions[0][0], suitableExpansionVerb[0]]
expIsOle = verbOle.matches(suitableExpansionVerb[1])
patternExt = ['nom/adv', 'ole' if expIsOle else 'verb']
analysisIDsExt = [ \
_getMatchingAnalysisIDs( suitableNomAdvExpansions[0][1], \
suitableNomAdvExpansions[0][3] ), \
_getMatchingAnalysisIDs( suitableExpansionVerb[1], verbDaMa ) ]
# Lisame ahelale pikendused
verbObj[PHRASE].extend( phraseExt )
verbObj[PATTERN].extend( patternExt )
verbObj[ANALYSIS_IDS].extend( analysisIDsExt )
annotatedWords.extend( phraseExt )
expansionPerformed = True
#_debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
#if suitableNomAdvExpansions[0][4].startswith('aeg;'):
# _debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+_getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
return expansionPerformed
|
python
|
def extendChainsInClause( self, clause, clauseID, foundChains ):
''' Proovime etteantud osalauses leiduvaid verbiahelaid täiendada 'verb-nom/adv-vinf'
rektsiooniseostega, nt:
andma + võimalus + Vda : talle anti_0 võimalus_0 olukorda parandada_0
olema + vaja + Vda : nüüd on_0 küll vaja_0 asi lõpetada_0
Teeme seda kahel moel:
1) kui mingi olemasoleva verbiahela keskelt on puudu 'nom/adv' (nt 'andma', 'jätma'
verbide vinf rektsiooniseoste leidmisel võib tekkida selliseid lünki), siis
lisame ahela keskele 'nom/adv' sõna.
2) kui verbiahela lõpus on verb, mis on sageli ülemuseks 'nom/adv' sõnale, millest
omakorda sõltub mingi Vinf verb (Vma, Vda), ning need on osalausekontekstis olemas,
lisame need verbiahela lõppu;
'''
expansionPerformed = False
# J22dvustame s6nad, mis kuuluvad juba mingi tuvastatud verbifraasi koosseisu
annotatedWords = []
for verbObj in foundChains:
if clauseID == verbObj[CLAUSE_IDX] and (len(verbObj[PATTERN])==1 and \
re.match('^(ei|ära|ega)$', verbObj[PATTERN][0])):
# V2lja j22vad yksikuna esinevad ei/ära/ega, kuna need tõenäoliselt ei sega
continue
annotatedWords.extend( verbObj[PHRASE] )
widToToken = { token[WORD_ID] : token for token in clause }
verbDaMa = WordTemplate({POSTAG:'V', FORM:'^(da|ma)$'})
verbOle = WordTemplate({ROOT:'^ole$',POSTAG:'V'})
#
# 1) Yritame leida, millised juba tuvastatud verbiahelatest on sellised, kust on
# vahelt puudu nom/adv s6na, nt:
# annab_0 kunstnik jälle põhjuse endast kirjutada_0
# see annab_0 võimaluse laua tagant tõusta_0 ja_0 minema jalutada_0
# Kui leiame ahelast puuduoleva s6na ja lisame selle ahelasse ...
#
for verbObj in foundChains:
if clauseID == verbObj[CLAUSE_IDX]:
headVerb = ''
headVerbWID = -1
dependentVerb = ''
dependentVerbWIDs = []
firstDependentVerbID = -1
# Leiame ahela l6pust ylemus-verbi ja sellele alluva verbi
if len(verbObj[PATTERN]) > 3 and verbObj[PATTERN][-2] == '&':
headVerb = verbObj[ROOTS][-4]+" "+verbObj[POLARITY]
dependentVerb = verbObj[MORPH][-3]
headVerbWID = verbObj[PHRASE][-4]
dependentVerbWIDs.append( verbObj[PHRASE][-3] )
dependentVerbWIDs.append( verbObj[PHRASE][-1] )
firstDependentVerbID = len(verbObj[PHRASE])-3
elif len(verbObj[PATTERN]) > 1 and verbObj[PATTERN][-2]=='verb':
headVerb = verbObj[ROOTS][-2]+" "+verbObj[POLARITY]
dependentVerb = verbObj[MORPH][-1]
headVerbWID = verbObj[PHRASE][-2]
dependentVerbWIDs.append(verbObj[PHRASE][-1])
firstDependentVerbID = len(verbObj[PHRASE])-1
# Kontrollime, kas ylemusverb ja sellele alluv verb v6iksid olla yhendatud
# mingi nom/adv s6na kaudu
if headVerb in self.verbRules and headVerb in self.verbToVinf and \
dependentVerb in self.verbToVinf[headVerb]:
# Teeme kindlaks, kas s6nade vahele j22b puuduolev nom/adv
minInd = min(min(dependentVerbWIDs), headVerbWID-1)
maxInd = max(max(dependentVerbWIDs)-1, headVerbWID)
if minInd < maxInd:
for i in range(minInd, maxInd+1):
if i in widToToken and i not in annotatedWords:
token = widToToken[i]
matchingAnalyses = self.tokenMatchesNomAdvVinf( token, headVerb, dependentVerb )
if matchingAnalyses and not expansionPerformed:
# Kontrollime, kas vaheletorgatav sõna paikneb nii, et see on suure
# tõenäosusega üksiksõna, mitte fraas.
if self._isLikelyNotPhrase( headVerb, headVerbWID, token[WORD_ID], widToToken ):
# Torkame nimis6na/adverbi vahele
verbObj[PHRASE].insert( firstDependentVerbID, token[WORD_ID] )
verbObj[PATTERN].insert( firstDependentVerbID, 'nom/adv' )
verbObj[ANALYSIS_IDS].insert( firstDependentVerbID, matchingAnalyses )
annotatedWords.append( token[WORD_ID] )
expansionPerformed = True
else:
# Kui me ei saa olla kindlad, et vaheletorgatav sõna pole fraas, paneme
# küsimärgi, näitamaks, et verbiahelast on suure tõenäosusega midagi
# puudu ...
verbObj[OTHER_VERBS] = True
#_debugPrint( ' '+('+'.join(verbObj[PATTERN]))+' | '+_getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
#
# 2) Yritame luua uusi ahelaid, laiendades verbe olemasolevate ahelate l6pus:
#
# millega antakse_0 võimalus_1 sõlmida_1 uus kokkulepe .
# puudub_0 võimalus_1 spetsialiste täistööajaga rakendada_1 .
# kui on_0 võimalus_1 rahulikult vooluga kaasa minna_1
#
clauseMaxWID = max( list(widToToken.keys()) )
for verbObj in foundChains:
if clauseID == verbObj[CLAUSE_IDX] and verbObj[OTHER_VERBS]:
if (len(verbObj[PATTERN])==1 or (len(verbObj[PATTERN])>1 and \
verbObj[PATTERN][-2] != '&')):
headVerb = verbObj[ROOTS][-1]+" "+verbObj[POLARITY]
headVerbWID = verbObj[PHRASE][-1]
#
# 2.1) Esimeses l2henduses vaatame tavalisi verbe (mitte-olema);
#
if headVerb in self.verbRules and not headVerb.startswith('ole '):
minInd = headVerbWID-1 if verbObj[PATTERN][0]!='ega' else headVerbWID
suitableNomAdvExpansions = []
expansionVerbs = []
for i in range(minInd, clauseMaxWID+1):
if i in widToToken and i not in annotatedWords:
token = widToToken[i]
if _isFollowedByComma( i, clause ):
# Katkestame, kui satume koma otsa (kuna ei saa kindel olla,
# et teisel pool koma on olevad jupid kuuluvad ikka verbi
# juurde)
break
if verbDaMa.matches( token ):
analysisIDs = _getMatchingAnalysisIDs( token, verbDaMa )
form = token[ANALYSIS][analysisIDs[0]][FORM]
expansionVerbs.append( [i, token, "V_"+form ] )
else:
for (nounAdv, vinf1) in self.verbRules[headVerb]:
if (self.nomAdvWordTemplates[nounAdv]).matches(token):
suitableNomAdvExpansions.append( [i, token, vinf1, \
(self.nomAdvWordTemplates[nounAdv]), nounAdv ] )
# Teeme kindlaks, kas kontekst on laiendamiseks piisavalt yhene/selge ...
suitableExpansionVerb = \
self._canBeExpanded( headVerb, headVerbWID, suitableNomAdvExpansions, \
expansionVerbs, widToToken )
if suitableExpansionVerb:
phraseExt = [suitableNomAdvExpansions[0][0], suitableExpansionVerb[0]]
expIsOle = verbOle.matches(suitableExpansionVerb[1])
patternExt = ['nom/adv', 'ole' if expIsOle else 'verb']
analysisIDsExt = [ \
_getMatchingAnalysisIDs( suitableNomAdvExpansions[0][1], \
suitableNomAdvExpansions[0][3] ), \
_getMatchingAnalysisIDs( suitableExpansionVerb[1], verbDaMa ) ]
# Lisame ahelale pikendused
verbObj[PHRASE].extend( phraseExt )
verbObj[PATTERN].extend( patternExt )
verbObj[ANALYSIS_IDS].extend( analysisIDsExt )
annotatedWords.extend( phraseExt )
expansionPerformed = True
#if headVerb.startswith('and '):
# _debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
#_debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
elif headVerb in self.verbRules and headVerb.startswith('ole '):
#
# 2.2) Vaatame olema-verbi rektsiooniseoseid;
#
minInd = headVerbWID-1 if verbObj[PATTERN][0]!='ega' else headVerbWID
suitableNomAdvExpansions = []
expansionVerbs = []
for i in range(minInd, clauseMaxWID+1):
if i in widToToken and i not in annotatedWords:
token = widToToken[i]
if verbDaMa.matches( token ):
analysisIDs = _getMatchingAnalysisIDs( token, verbDaMa )
form = token[ANALYSIS][analysisIDs[0]][FORM]
expansionVerbs.append( [i, token, "V_"+form ] )
else:
for (nounAdv, vinf1) in self.verbRules[headVerb]:
if (self.nomAdvWordTemplates[nounAdv]).matches(token):
suitableNomAdvExpansions.append( [i, token, vinf1, \
(self.nomAdvWordTemplates[nounAdv]), nounAdv] )
if _isFollowedByComma( i, clause ):
# Katkestame, kui satume koma otsa (kuna ei saa kindel olla,
# et teisel pool koma on olevad jupid kuuluvad ikka verbi
# juurde)
break
# Teeme kindlaks, kas kontekst on laiendamiseks piisavalt yhene/selge ...
suitableExpansionVerb = \
self._canBeExpanded( headVerb, headVerbWID, suitableNomAdvExpansions, \
expansionVerbs, widToToken )
if suitableExpansionVerb:
phraseExt = [suitableNomAdvExpansions[0][0], suitableExpansionVerb[0]]
expIsOle = verbOle.matches(suitableExpansionVerb[1])
patternExt = ['nom/adv', 'ole' if expIsOle else 'verb']
analysisIDsExt = [ \
_getMatchingAnalysisIDs( suitableNomAdvExpansions[0][1], \
suitableNomAdvExpansions[0][3] ), \
_getMatchingAnalysisIDs( suitableExpansionVerb[1], verbDaMa ) ]
# Lisame ahelale pikendused
verbObj[PHRASE].extend( phraseExt )
verbObj[PATTERN].extend( patternExt )
verbObj[ANALYSIS_IDS].extend( analysisIDsExt )
annotatedWords.extend( phraseExt )
expansionPerformed = True
#_debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
#if suitableNomAdvExpansions[0][4].startswith('aeg;'):
# _debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+_getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))
return expansionPerformed
|
[
"def",
"extendChainsInClause",
"(",
"self",
",",
"clause",
",",
"clauseID",
",",
"foundChains",
")",
":",
"expansionPerformed",
"=",
"False",
"# J22dvustame s6nad, mis kuuluvad juba mingi tuvastatud verbifraasi koosseisu\r",
"annotatedWords",
"=",
"[",
"]",
"for",
"verbObj",
"in",
"foundChains",
":",
"if",
"clauseID",
"==",
"verbObj",
"[",
"CLAUSE_IDX",
"]",
"and",
"(",
"len",
"(",
"verbObj",
"[",
"PATTERN",
"]",
")",
"==",
"1",
"and",
"re",
".",
"match",
"(",
"'^(ei|ära|ega)$',",
" ",
"erbObj[",
"P",
"ATTERN]",
"[",
"0",
"]",
")",
")",
":",
"\r",
"# V2lja j22vad yksikuna esinevad ei/ära/ega, kuna need tõenäoliselt ei sega\r",
"continue",
"annotatedWords",
".",
"extend",
"(",
"verbObj",
"[",
"PHRASE",
"]",
")",
"widToToken",
"=",
"{",
"token",
"[",
"WORD_ID",
"]",
":",
"token",
"for",
"token",
"in",
"clause",
"}",
"verbDaMa",
"=",
"WordTemplate",
"(",
"{",
"POSTAG",
":",
"'V'",
",",
"FORM",
":",
"'^(da|ma)$'",
"}",
")",
"verbOle",
"=",
"WordTemplate",
"(",
"{",
"ROOT",
":",
"'^ole$'",
",",
"POSTAG",
":",
"'V'",
"}",
")",
"#\r",
"# 1) Yritame leida, millised juba tuvastatud verbiahelatest on sellised, kust on\r",
"# vahelt puudu nom/adv s6na, nt:\r",
"# annab_0 kunstnik jälle põhjuse endast kirjutada_0\r",
"# see annab_0 võimaluse laua tagant tõusta_0 ja_0 minema jalutada_0\r",
"# Kui leiame ahelast puuduoleva s6na ja lisame selle ahelasse ...\r",
"#\r",
"for",
"verbObj",
"in",
"foundChains",
":",
"if",
"clauseID",
"==",
"verbObj",
"[",
"CLAUSE_IDX",
"]",
":",
"headVerb",
"=",
"''",
"headVerbWID",
"=",
"-",
"1",
"dependentVerb",
"=",
"''",
"dependentVerbWIDs",
"=",
"[",
"]",
"firstDependentVerbID",
"=",
"-",
"1",
"# Leiame ahela l6pust ylemus-verbi ja sellele alluva verbi\r",
"if",
"len",
"(",
"verbObj",
"[",
"PATTERN",
"]",
")",
">",
"3",
"and",
"verbObj",
"[",
"PATTERN",
"]",
"[",
"-",
"2",
"]",
"==",
"'&'",
":",
"headVerb",
"=",
"verbObj",
"[",
"ROOTS",
"]",
"[",
"-",
"4",
"]",
"+",
"\" \"",
"+",
"verbObj",
"[",
"POLARITY",
"]",
"dependentVerb",
"=",
"verbObj",
"[",
"MORPH",
"]",
"[",
"-",
"3",
"]",
"headVerbWID",
"=",
"verbObj",
"[",
"PHRASE",
"]",
"[",
"-",
"4",
"]",
"dependentVerbWIDs",
".",
"append",
"(",
"verbObj",
"[",
"PHRASE",
"]",
"[",
"-",
"3",
"]",
")",
"dependentVerbWIDs",
".",
"append",
"(",
"verbObj",
"[",
"PHRASE",
"]",
"[",
"-",
"1",
"]",
")",
"firstDependentVerbID",
"=",
"len",
"(",
"verbObj",
"[",
"PHRASE",
"]",
")",
"-",
"3",
"elif",
"len",
"(",
"verbObj",
"[",
"PATTERN",
"]",
")",
">",
"1",
"and",
"verbObj",
"[",
"PATTERN",
"]",
"[",
"-",
"2",
"]",
"==",
"'verb'",
":",
"headVerb",
"=",
"verbObj",
"[",
"ROOTS",
"]",
"[",
"-",
"2",
"]",
"+",
"\" \"",
"+",
"verbObj",
"[",
"POLARITY",
"]",
"dependentVerb",
"=",
"verbObj",
"[",
"MORPH",
"]",
"[",
"-",
"1",
"]",
"headVerbWID",
"=",
"verbObj",
"[",
"PHRASE",
"]",
"[",
"-",
"2",
"]",
"dependentVerbWIDs",
".",
"append",
"(",
"verbObj",
"[",
"PHRASE",
"]",
"[",
"-",
"1",
"]",
")",
"firstDependentVerbID",
"=",
"len",
"(",
"verbObj",
"[",
"PHRASE",
"]",
")",
"-",
"1",
"# Kontrollime, kas ylemusverb ja sellele alluv verb v6iksid olla yhendatud\r",
"# mingi nom/adv s6na kaudu\r",
"if",
"headVerb",
"in",
"self",
".",
"verbRules",
"and",
"headVerb",
"in",
"self",
".",
"verbToVinf",
"and",
"dependentVerb",
"in",
"self",
".",
"verbToVinf",
"[",
"headVerb",
"]",
":",
"# Teeme kindlaks, kas s6nade vahele j22b puuduolev nom/adv\r",
"minInd",
"=",
"min",
"(",
"min",
"(",
"dependentVerbWIDs",
")",
",",
"headVerbWID",
"-",
"1",
")",
"maxInd",
"=",
"max",
"(",
"max",
"(",
"dependentVerbWIDs",
")",
"-",
"1",
",",
"headVerbWID",
")",
"if",
"minInd",
"<",
"maxInd",
":",
"for",
"i",
"in",
"range",
"(",
"minInd",
",",
"maxInd",
"+",
"1",
")",
":",
"if",
"i",
"in",
"widToToken",
"and",
"i",
"not",
"in",
"annotatedWords",
":",
"token",
"=",
"widToToken",
"[",
"i",
"]",
"matchingAnalyses",
"=",
"self",
".",
"tokenMatchesNomAdvVinf",
"(",
"token",
",",
"headVerb",
",",
"dependentVerb",
")",
"if",
"matchingAnalyses",
"and",
"not",
"expansionPerformed",
":",
"# Kontrollime, kas vaheletorgatav sõna paikneb nii, et see on suure\r",
"# tõenäosusega üksiksõna, mitte fraas.\r",
"if",
"self",
".",
"_isLikelyNotPhrase",
"(",
"headVerb",
",",
"headVerbWID",
",",
"token",
"[",
"WORD_ID",
"]",
",",
"widToToken",
")",
":",
"# Torkame nimis6na/adverbi vahele\r",
"verbObj",
"[",
"PHRASE",
"]",
".",
"insert",
"(",
"firstDependentVerbID",
",",
"token",
"[",
"WORD_ID",
"]",
")",
"verbObj",
"[",
"PATTERN",
"]",
".",
"insert",
"(",
"firstDependentVerbID",
",",
"'nom/adv'",
")",
"verbObj",
"[",
"ANALYSIS_IDS",
"]",
".",
"insert",
"(",
"firstDependentVerbID",
",",
"matchingAnalyses",
")",
"annotatedWords",
".",
"append",
"(",
"token",
"[",
"WORD_ID",
"]",
")",
"expansionPerformed",
"=",
"True",
"else",
":",
"# Kui me ei saa olla kindlad, et vaheletorgatav sõna pole fraas, paneme\r",
"# küsimärgi, näitamaks, et verbiahelast on suure tõenäosusega midagi\r",
"# puudu ...\r",
"verbObj",
"[",
"OTHER_VERBS",
"]",
"=",
"True",
"#_debugPrint( ' '+('+'.join(verbObj[PATTERN]))+' | '+_getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))\r",
"#\r",
"# 2) Yritame luua uusi ahelaid, laiendades verbe olemasolevate ahelate l6pus:\r",
"#\r",
"# millega antakse_0 võimalus_1 sõlmida_1 uus kokkulepe .\r",
"# puudub_0 võimalus_1 spetsialiste täistööajaga rakendada_1 .\r",
"# kui on_0 võimalus_1 rahulikult vooluga kaasa minna_1\r",
"#\r",
"clauseMaxWID",
"=",
"max",
"(",
"list",
"(",
"widToToken",
".",
"keys",
"(",
")",
")",
")",
"for",
"verbObj",
"in",
"foundChains",
":",
"if",
"clauseID",
"==",
"verbObj",
"[",
"CLAUSE_IDX",
"]",
"and",
"verbObj",
"[",
"OTHER_VERBS",
"]",
":",
"if",
"(",
"len",
"(",
"verbObj",
"[",
"PATTERN",
"]",
")",
"==",
"1",
"or",
"(",
"len",
"(",
"verbObj",
"[",
"PATTERN",
"]",
")",
">",
"1",
"and",
"verbObj",
"[",
"PATTERN",
"]",
"[",
"-",
"2",
"]",
"!=",
"'&'",
")",
")",
":",
"headVerb",
"=",
"verbObj",
"[",
"ROOTS",
"]",
"[",
"-",
"1",
"]",
"+",
"\" \"",
"+",
"verbObj",
"[",
"POLARITY",
"]",
"headVerbWID",
"=",
"verbObj",
"[",
"PHRASE",
"]",
"[",
"-",
"1",
"]",
"#\r",
"# 2.1) Esimeses l2henduses vaatame tavalisi verbe (mitte-olema);\r",
"#\r",
"if",
"headVerb",
"in",
"self",
".",
"verbRules",
"and",
"not",
"headVerb",
".",
"startswith",
"(",
"'ole '",
")",
":",
"minInd",
"=",
"headVerbWID",
"-",
"1",
"if",
"verbObj",
"[",
"PATTERN",
"]",
"[",
"0",
"]",
"!=",
"'ega'",
"else",
"headVerbWID",
"suitableNomAdvExpansions",
"=",
"[",
"]",
"expansionVerbs",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"minInd",
",",
"clauseMaxWID",
"+",
"1",
")",
":",
"if",
"i",
"in",
"widToToken",
"and",
"i",
"not",
"in",
"annotatedWords",
":",
"token",
"=",
"widToToken",
"[",
"i",
"]",
"if",
"_isFollowedByComma",
"(",
"i",
",",
"clause",
")",
":",
"# Katkestame, kui satume koma otsa (kuna ei saa kindel olla,\r",
"# et teisel pool koma on olevad jupid kuuluvad ikka verbi \r",
"# juurde)\r",
"break",
"if",
"verbDaMa",
".",
"matches",
"(",
"token",
")",
":",
"analysisIDs",
"=",
"_getMatchingAnalysisIDs",
"(",
"token",
",",
"verbDaMa",
")",
"form",
"=",
"token",
"[",
"ANALYSIS",
"]",
"[",
"analysisIDs",
"[",
"0",
"]",
"]",
"[",
"FORM",
"]",
"expansionVerbs",
".",
"append",
"(",
"[",
"i",
",",
"token",
",",
"\"V_\"",
"+",
"form",
"]",
")",
"else",
":",
"for",
"(",
"nounAdv",
",",
"vinf1",
")",
"in",
"self",
".",
"verbRules",
"[",
"headVerb",
"]",
":",
"if",
"(",
"self",
".",
"nomAdvWordTemplates",
"[",
"nounAdv",
"]",
")",
".",
"matches",
"(",
"token",
")",
":",
"suitableNomAdvExpansions",
".",
"append",
"(",
"[",
"i",
",",
"token",
",",
"vinf1",
",",
"(",
"self",
".",
"nomAdvWordTemplates",
"[",
"nounAdv",
"]",
")",
",",
"nounAdv",
"]",
")",
"# Teeme kindlaks, kas kontekst on laiendamiseks piisavalt yhene/selge ...\r",
"suitableExpansionVerb",
"=",
"self",
".",
"_canBeExpanded",
"(",
"headVerb",
",",
"headVerbWID",
",",
"suitableNomAdvExpansions",
",",
"expansionVerbs",
",",
"widToToken",
")",
"if",
"suitableExpansionVerb",
":",
"phraseExt",
"=",
"[",
"suitableNomAdvExpansions",
"[",
"0",
"]",
"[",
"0",
"]",
",",
"suitableExpansionVerb",
"[",
"0",
"]",
"]",
"expIsOle",
"=",
"verbOle",
".",
"matches",
"(",
"suitableExpansionVerb",
"[",
"1",
"]",
")",
"patternExt",
"=",
"[",
"'nom/adv'",
",",
"'ole'",
"if",
"expIsOle",
"else",
"'verb'",
"]",
"analysisIDsExt",
"=",
"[",
"_getMatchingAnalysisIDs",
"(",
"suitableNomAdvExpansions",
"[",
"0",
"]",
"[",
"1",
"]",
",",
"suitableNomAdvExpansions",
"[",
"0",
"]",
"[",
"3",
"]",
")",
",",
"_getMatchingAnalysisIDs",
"(",
"suitableExpansionVerb",
"[",
"1",
"]",
",",
"verbDaMa",
")",
"]",
"# Lisame ahelale pikendused\r",
"verbObj",
"[",
"PHRASE",
"]",
".",
"extend",
"(",
"phraseExt",
")",
"verbObj",
"[",
"PATTERN",
"]",
".",
"extend",
"(",
"patternExt",
")",
"verbObj",
"[",
"ANALYSIS_IDS",
"]",
".",
"extend",
"(",
"analysisIDsExt",
")",
"annotatedWords",
".",
"extend",
"(",
"phraseExt",
")",
"expansionPerformed",
"=",
"True",
"#if headVerb.startswith('and '):\r",
"# _debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))\r",
"#_debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))\r",
"elif",
"headVerb",
"in",
"self",
".",
"verbRules",
"and",
"headVerb",
".",
"startswith",
"(",
"'ole '",
")",
":",
"#\r",
"# 2.2) Vaatame olema-verbi rektsiooniseoseid;\r",
"#\r",
"minInd",
"=",
"headVerbWID",
"-",
"1",
"if",
"verbObj",
"[",
"PATTERN",
"]",
"[",
"0",
"]",
"!=",
"'ega'",
"else",
"headVerbWID",
"suitableNomAdvExpansions",
"=",
"[",
"]",
"expansionVerbs",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"minInd",
",",
"clauseMaxWID",
"+",
"1",
")",
":",
"if",
"i",
"in",
"widToToken",
"and",
"i",
"not",
"in",
"annotatedWords",
":",
"token",
"=",
"widToToken",
"[",
"i",
"]",
"if",
"verbDaMa",
".",
"matches",
"(",
"token",
")",
":",
"analysisIDs",
"=",
"_getMatchingAnalysisIDs",
"(",
"token",
",",
"verbDaMa",
")",
"form",
"=",
"token",
"[",
"ANALYSIS",
"]",
"[",
"analysisIDs",
"[",
"0",
"]",
"]",
"[",
"FORM",
"]",
"expansionVerbs",
".",
"append",
"(",
"[",
"i",
",",
"token",
",",
"\"V_\"",
"+",
"form",
"]",
")",
"else",
":",
"for",
"(",
"nounAdv",
",",
"vinf1",
")",
"in",
"self",
".",
"verbRules",
"[",
"headVerb",
"]",
":",
"if",
"(",
"self",
".",
"nomAdvWordTemplates",
"[",
"nounAdv",
"]",
")",
".",
"matches",
"(",
"token",
")",
":",
"suitableNomAdvExpansions",
".",
"append",
"(",
"[",
"i",
",",
"token",
",",
"vinf1",
",",
"(",
"self",
".",
"nomAdvWordTemplates",
"[",
"nounAdv",
"]",
")",
",",
"nounAdv",
"]",
")",
"if",
"_isFollowedByComma",
"(",
"i",
",",
"clause",
")",
":",
"# Katkestame, kui satume koma otsa (kuna ei saa kindel olla,\r",
"# et teisel pool koma on olevad jupid kuuluvad ikka verbi \r",
"# juurde)\r",
"break",
"# Teeme kindlaks, kas kontekst on laiendamiseks piisavalt yhene/selge ...\r",
"suitableExpansionVerb",
"=",
"self",
".",
"_canBeExpanded",
"(",
"headVerb",
",",
"headVerbWID",
",",
"suitableNomAdvExpansions",
",",
"expansionVerbs",
",",
"widToToken",
")",
"if",
"suitableExpansionVerb",
":",
"phraseExt",
"=",
"[",
"suitableNomAdvExpansions",
"[",
"0",
"]",
"[",
"0",
"]",
",",
"suitableExpansionVerb",
"[",
"0",
"]",
"]",
"expIsOle",
"=",
"verbOle",
".",
"matches",
"(",
"suitableExpansionVerb",
"[",
"1",
"]",
")",
"patternExt",
"=",
"[",
"'nom/adv'",
",",
"'ole'",
"if",
"expIsOle",
"else",
"'verb'",
"]",
"analysisIDsExt",
"=",
"[",
"_getMatchingAnalysisIDs",
"(",
"suitableNomAdvExpansions",
"[",
"0",
"]",
"[",
"1",
"]",
",",
"suitableNomAdvExpansions",
"[",
"0",
"]",
"[",
"3",
"]",
")",
",",
"_getMatchingAnalysisIDs",
"(",
"suitableExpansionVerb",
"[",
"1",
"]",
",",
"verbDaMa",
")",
"]",
"# Lisame ahelale pikendused\r",
"verbObj",
"[",
"PHRASE",
"]",
".",
"extend",
"(",
"phraseExt",
")",
"verbObj",
"[",
"PATTERN",
"]",
".",
"extend",
"(",
"patternExt",
")",
"verbObj",
"[",
"ANALYSIS_IDS",
"]",
".",
"extend",
"(",
"analysisIDsExt",
")",
"annotatedWords",
".",
"extend",
"(",
"phraseExt",
")",
"expansionPerformed",
"=",
"True",
"#_debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))\r",
"#if suitableNomAdvExpansions[0][4].startswith('aeg;'):\r",
"# _debugPrint( ('+'.join(verbObj[PATTERN]))+' | '+_getJsonAsTextString(clause, markTokens = [ verbObj[PHRASE] ] ))\r",
"return",
"expansionPerformed"
] |
Proovime etteantud osalauses leiduvaid verbiahelaid täiendada 'verb-nom/adv-vinf'
rektsiooniseostega, nt:
andma + võimalus + Vda : talle anti_0 võimalus_0 olukorda parandada_0
olema + vaja + Vda : nüüd on_0 küll vaja_0 asi lõpetada_0
Teeme seda kahel moel:
1) kui mingi olemasoleva verbiahela keskelt on puudu 'nom/adv' (nt 'andma', 'jätma'
verbide vinf rektsiooniseoste leidmisel võib tekkida selliseid lünki), siis
lisame ahela keskele 'nom/adv' sõna.
2) kui verbiahela lõpus on verb, mis on sageli ülemuseks 'nom/adv' sõnale, millest
omakorda sõltub mingi Vinf verb (Vma, Vda), ning need on osalausekontekstis olemas,
lisame need verbiahela lõppu;
|
[
"Proovime",
"etteantud",
"osalauses",
"leiduvaid",
"verbiahelaid",
"täiendada",
"verb",
"-",
"nom",
"/",
"adv",
"-",
"vinf",
"rektsiooniseostega",
"nt",
":",
"andma",
"+",
"võimalus",
"+",
"Vda",
":",
"talle",
"anti_0",
"võimalus_0",
"olukorda",
"parandada_0",
"olema",
"+",
"vaja",
"+",
"Vda",
":",
"nüüd",
"on_0",
"küll",
"vaja_0",
"asi",
"lõpetada_0",
"Teeme",
"seda",
"kahel",
"moel",
":",
"1",
")",
"kui",
"mingi",
"olemasoleva",
"verbiahela",
"keskelt",
"on",
"puudu",
"nom",
"/",
"adv",
"(",
"nt",
"andma",
"jätma",
"verbide",
"vinf",
"rektsiooniseoste",
"leidmisel",
"võib",
"tekkida",
"selliseid",
"lünki",
")",
"siis",
"lisame",
"ahela",
"keskele",
"nom",
"/",
"adv",
"sõna",
".",
"2",
")",
"kui",
"verbiahela",
"lõpus",
"on",
"verb",
"mis",
"on",
"sageli",
"ülemuseks",
"nom",
"/",
"adv",
"sõnale",
"millest",
"omakorda",
"sõltub",
"mingi",
"Vinf",
"verb",
"(",
"Vma",
"Vda",
")",
"ning",
"need",
"on",
"osalausekontekstis",
"olemas",
"lisame",
"need",
"verbiahela",
"lõppu",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/mw_verbs/verbchain_nom_vinf_extender.py#L232-L418
|
train
|
Extends the list of foundChains with the ones in the given clause.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,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hU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b101110 + 0o2) + '\x6f' + chr(49) + chr(0b101011 + 0o6) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\157' + '\x33' + chr(53) + chr(0b101101 + 0o10), 64615 - 64607), nzTpIcepk0o8('\x30' + chr(6786 - 6675) + '\061' + chr(0b110111) + chr(0b110111), 11591 - 11583), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x31' + chr(50) + chr(0b101011 + 0o14), 0b1000), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b111010 + 0o65) + chr(1992 - 1943) + chr(0b110101) + '\x32', 64056 - 64048), nzTpIcepk0o8(chr(0b11010 + 0o26) + '\157' + '\x32' + chr(1218 - 1166) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(48) + chr(3375 - 3264) + chr(0b110011) + chr(0b100110 + 0o12) + chr(0b110101), 47686 - 47678), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x33' + chr(53) + '\x36', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + chr(50) + chr(54), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1001110 + 0o41) + chr(0b1100 + 0o47) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\062' + chr(845 - 794) + chr(1761 - 1708), 62421 - 62413), nzTpIcepk0o8('\x30' + '\157' + chr(50) + chr(1556 - 1506), 0b1000), nzTpIcepk0o8(chr(1653 - 1605) + chr(0b1101111) + chr(0b110001) + chr(49) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\061' + '\060' + chr(1671 - 1621), 0o10), nzTpIcepk0o8(chr(48) + '\157' + '\x31' + '\x34' + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b110 + 0o151) + '\x35' + chr(1425 - 1375), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x31' + chr(55) + '\x33', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(51) + chr(0b10100 + 0o35), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b100101 + 0o112) + chr(486 - 437) + '\066' + '\065', 0b1000), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b110001) + chr(0b110001) + chr(1735 - 1680), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b110010) + chr(0b110010) + chr(51), 60573 - 60565), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(1710 - 1659) + '\067' + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b11101 + 0o23) + chr(111) + '\066' + chr(0b100 + 0o56), 58554 - 58546), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(930 - 876) + '\066', 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(2337 - 2287) + '\060' + '\x37', 0o10), nzTpIcepk0o8('\060' + chr(0b1100110 + 0o11) + chr(51) + chr(0b110111) + '\063', 36813 - 36805), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(0b110101) + chr(425 - 370), 33174 - 33166), nzTpIcepk0o8(chr(0b110000) + chr(5509 - 5398) + chr(0b110011) + '\x31' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100000 + 0o23) + '\067' + chr(0b11100 + 0o25), 35553 - 35545), nzTpIcepk0o8('\060' + chr(0b11001 + 0o126) + chr(2349 - 2298) + '\064' + chr(1864 - 1813), 0b1000), nzTpIcepk0o8(chr(1138 - 1090) + chr(0b11101 + 0o122) + '\063' + chr(0b110111) + '\063', 8), nzTpIcepk0o8(chr(0b11111 + 0o21) + '\157' + chr(52) + chr(51), 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b11011 + 0o26) + '\x30', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + '\x31' + chr(0b111 + 0o53), 0o10), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(111) + '\062' + chr(0b11010 + 0o27) + '\x33', 0o10), nzTpIcepk0o8(chr(0b110 + 0o52) + chr(0b10111 + 0o130) + chr(0b110001) + chr(0b11000 + 0o36) + chr(181 - 133), 14799 - 14791), nzTpIcepk0o8(chr(48) + chr(111) + chr(534 - 483) + '\x34' + chr(1238 - 1187), 8), nzTpIcepk0o8(chr(48) + '\x6f' + '\063' + chr(0b110100) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(4647 - 4536) + chr(51) + chr(0b110111) + chr(0b100 + 0o61), 0b1000), nzTpIcepk0o8(chr(1567 - 1519) + chr(111) + chr(0b110111) + chr(0b1010 + 0o50), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + '\157' + '\065' + chr(0b1100 + 0o44), 0b1000)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'f'), chr(0b111011 + 0o51) + chr(7480 - 7379) + chr(0b1010100 + 0o17) + '\x6f' + chr(455 - 355) + chr(0b1100101))(chr(0b1001010 + 0o53) + chr(8518 - 8402) + chr(0b1100110) + chr(0b1111 + 0o36) + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def KXiQTup9bHFY(hXMPsSrOQzbh, va9olG5Fw2F2, hvzWTn4ua_8s, pOHqW_FNK1BR):
q104BzPUok6h = nzTpIcepk0o8('\060' + chr(0b100110 + 0o111) + chr(0b110000), ord("\x08"))
E1HdBbbUHn2s = []
for eHpDT_fnrcqV in pOHqW_FNK1BR:
if hvzWTn4ua_8s == eHpDT_fnrcqV[DLXKWZHG1d62] and (ftfygxgFas5X(eHpDT_fnrcqV[TRDh5eU8TN7t]) == nzTpIcepk0o8(chr(0b110000) + chr(0b111111 + 0o60) + chr(208 - 159), 0b1000) and roI3spqORKae(aoTc4YA2bs2R, roI3spqORKae(ES5oEprVxulp(b' \x86F\x18\x03\xcb\xa8\x87\xd5@\xe7S'), chr(100) + '\145' + chr(0b1100010 + 0o1) + chr(111) + chr(0b1100100) + '\x65')(chr(0b110101 + 0o100) + chr(116) + chr(102) + chr(45) + chr(56)))(roI3spqORKae(ES5oEprVxulp(b'\x16\xc5\x1a>\x16ba\x9c\xf7c\xf8u/k@'), chr(6310 - 6210) + chr(101) + chr(0b100010 + 0o101) + chr(0b101001 + 0o106) + '\144' + chr(101))('\x75' + chr(0b1101 + 0o147) + chr(0b100110 + 0o100) + '\055' + chr(0b111000)), eHpDT_fnrcqV[TRDh5eU8TN7t][nzTpIcepk0o8(chr(0b1001 + 0o47) + '\x6f' + '\060', 8)])):
continue
roI3spqORKae(E1HdBbbUHn2s, roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), chr(0b111010 + 0o52) + chr(0b1100101) + chr(99) + '\x6f' + chr(100) + '\x65')('\165' + chr(0b11011 + 0o131) + chr(0b1000011 + 0o43) + chr(0b101101) + chr(0b10010 + 0o46)))(eHpDT_fnrcqV[P6huukvm63lP])
tPPwt53c3V2p = {Hd4nWPplSa3h[WmO5LTjo3YUT]: Hd4nWPplSa3h for Hd4nWPplSa3h in va9olG5Fw2F2}
qYyr53WwPVFz = AdjECv1glaZZ({QivUjX90e7n8: roI3spqORKae(ES5oEprVxulp(b'\x1e'), chr(7831 - 7731) + chr(0b1100101) + chr(8369 - 8270) + chr(0b1101111) + chr(0b1001001 + 0o33) + '\x65')('\165' + '\164' + chr(0b1100110) + chr(1911 - 1866) + chr(1363 - 1307)), invlgHm8TzbV: roI3spqORKae(ES5oEprVxulp(b'\x16\xc5\x1b6\x16\xcc\xa4\xc7\xb2'), chr(0b1100100) + chr(0b1001011 + 0o32) + chr(0b110100 + 0o57) + '\157' + chr(7030 - 6930) + chr(0b111110 + 0o47))(chr(0b110 + 0o157) + '\x74' + '\x66' + '\x2d' + chr(56))})
m4Uq0OLJRI84 = AdjECv1glaZZ({XsvoTOpX8A2b: roI3spqORKae(ES5oEprVxulp(b'\x16\x82\x132N'), chr(0b10011 + 0o121) + '\145' + '\x63' + chr(0b11111 + 0o120) + chr(0b1001010 + 0o32) + chr(101))(chr(117) + chr(0b1001010 + 0o52) + chr(0b1100110) + chr(1087 - 1042) + '\x38'), QivUjX90e7n8: roI3spqORKae(ES5oEprVxulp(b'\x1e'), chr(0b1100100) + chr(101) + '\x63' + '\157' + chr(9464 - 9364) + chr(1524 - 1423))(chr(9666 - 9549) + '\x74' + '\x66' + chr(1076 - 1031) + '\x38')})
for eHpDT_fnrcqV in pOHqW_FNK1BR:
if hvzWTn4ua_8s == eHpDT_fnrcqV[DLXKWZHG1d62]:
FFfXoBR0AEAI = roI3spqORKae(ES5oEprVxulp(b''), chr(3556 - 3456) + '\x65' + chr(2478 - 2379) + '\157' + chr(0b1011101 + 0o7) + chr(0b1100101))(chr(0b101010 + 0o113) + chr(116) + chr(0b1100110) + chr(1832 - 1787) + chr(1512 - 1456))
spL00kDdDnQS = -nzTpIcepk0o8('\060' + chr(8557 - 8446) + chr(0b11011 + 0o26), 8)
jQW5Rj0FIUWk = roI3spqORKae(ES5oEprVxulp(b''), chr(202 - 102) + '\145' + '\143' + '\x6f' + chr(0b1100100) + chr(475 - 374))(chr(117) + chr(7701 - 7585) + chr(0b10001 + 0o125) + '\x2d' + chr(56))
CfHgcfsEZnRF = []
H4ps7ZOZ7hjR = -nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b100110 + 0o13), 8)
if ftfygxgFas5X(eHpDT_fnrcqV[TRDh5eU8TN7t]) > nzTpIcepk0o8('\060' + chr(0b10 + 0o155) + chr(0b10100 + 0o37), ord("\x08")) and eHpDT_fnrcqV[TRDh5eU8TN7t][-nzTpIcepk0o8(chr(48) + '\157' + chr(0b1010 + 0o50), 0o10)] == roI3spqORKae(ES5oEprVxulp(b'n'), '\144' + '\145' + chr(5035 - 4936) + chr(111) + '\144' + chr(0b1011011 + 0o12))(chr(13506 - 13389) + chr(3472 - 3356) + '\x66' + '\x2d' + chr(2613 - 2557)):
FFfXoBR0AEAI = eHpDT_fnrcqV[a6lfotXZKsof][-nzTpIcepk0o8('\x30' + chr(10161 - 10050) + chr(0b110100), 25899 - 25891)] + roI3spqORKae(ES5oEprVxulp(b'h'), chr(0b1100100) + '\145' + chr(99) + chr(0b101001 + 0o106) + '\144' + chr(101))('\165' + '\164' + chr(0b1100110) + chr(0b11011 + 0o22) + '\x38') + eHpDT_fnrcqV[WZ1cQUih4WVz]
jQW5Rj0FIUWk = eHpDT_fnrcqV[j6UDj97Ae0wm][-nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b101100 + 0o7), 8)]
spL00kDdDnQS = eHpDT_fnrcqV[P6huukvm63lP][-nzTpIcepk0o8(chr(0b110000) + chr(111) + '\064', 8)]
roI3spqORKae(CfHgcfsEZnRF, roI3spqORKae(ES5oEprVxulp(b"\x00\xb9,c\x12\xc6\x82\x81\xfcp\xc8'"), '\144' + chr(0b101000 + 0o75) + chr(4702 - 4603) + '\x6f' + '\x64' + chr(0b1010110 + 0o17))('\x75' + chr(0b1011111 + 0o25) + chr(5120 - 5018) + chr(45) + '\070'))(eHpDT_fnrcqV[P6huukvm63lP][-nzTpIcepk0o8(chr(1251 - 1203) + chr(0b1001011 + 0o44) + chr(51), 8)])
roI3spqORKae(CfHgcfsEZnRF, roI3spqORKae(ES5oEprVxulp(b"\x00\xb9,c\x12\xc6\x82\x81\xfcp\xc8'"), '\144' + chr(7268 - 7167) + chr(292 - 193) + '\157' + '\x64' + '\x65')(chr(10449 - 10332) + '\x74' + '\x66' + '\055' + chr(0b110000 + 0o10)))(eHpDT_fnrcqV[P6huukvm63lP][-nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b110001), 8)])
H4ps7ZOZ7hjR = ftfygxgFas5X(eHpDT_fnrcqV[P6huukvm63lP]) - nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011), 8)
elif ftfygxgFas5X(eHpDT_fnrcqV[TRDh5eU8TN7t]) > nzTpIcepk0o8(chr(1454 - 1406) + chr(0b1101111) + chr(1359 - 1310), 8) and eHpDT_fnrcqV[TRDh5eU8TN7t][-nzTpIcepk0o8('\x30' + chr(111) + chr(50), 8)] == roI3spqORKae(ES5oEprVxulp(b'>\x88\r5'), '\x64' + chr(0b1100101) + chr(0b1110 + 0o125) + chr(0b1101111) + chr(997 - 897) + chr(101))(chr(0b1110101) + '\x74' + chr(102) + '\055' + '\070'):
FFfXoBR0AEAI = eHpDT_fnrcqV[a6lfotXZKsof][-nzTpIcepk0o8(chr(2021 - 1973) + '\x6f' + chr(1578 - 1528), 8)] + roI3spqORKae(ES5oEprVxulp(b'h'), chr(0b1011101 + 0o7) + chr(0b1100101) + '\x63' + chr(0b100100 + 0o113) + chr(0b1100100) + chr(101))('\x75' + '\x74' + chr(102) + chr(0b10111 + 0o26) + '\070') + eHpDT_fnrcqV[WZ1cQUih4WVz]
jQW5Rj0FIUWk = eHpDT_fnrcqV[j6UDj97Ae0wm][-nzTpIcepk0o8(chr(48) + chr(111) + chr(49), 8)]
spL00kDdDnQS = eHpDT_fnrcqV[P6huukvm63lP][-nzTpIcepk0o8(chr(499 - 451) + chr(0b1101111) + '\062', 8)]
roI3spqORKae(CfHgcfsEZnRF, roI3spqORKae(ES5oEprVxulp(b"\x00\xb9,c\x12\xc6\x82\x81\xfcp\xc8'"), chr(100) + chr(101) + chr(99) + chr(10100 - 9989) + '\144' + '\x65')(chr(117) + chr(2255 - 2139) + '\x66' + chr(0b10101 + 0o30) + '\x38'))(eHpDT_fnrcqV[P6huukvm63lP][-nzTpIcepk0o8('\x30' + '\157' + '\061', 8)])
H4ps7ZOZ7hjR = ftfygxgFas5X(eHpDT_fnrcqV[P6huukvm63lP]) - nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(49), 8)
if FFfXoBR0AEAI in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x0c\x87Kc\t\xf3\x80\xa5\xec@\xd2s'), chr(0b1000101 + 0o37) + '\145' + chr(0b100101 + 0o76) + chr(0b1101111) + chr(0b101101 + 0o67) + '\x65')(chr(0b0 + 0o165) + '\x74' + chr(0b1100110) + chr(1187 - 1142) + '\070')) and FFfXoBR0AEAI in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b"?\xdb\x1d \x1c\xce\xa4\xbe\xf9'\xeeY"), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(6580 - 6469) + chr(0b111 + 0o135) + '\x65')(chr(117) + chr(116) + chr(102) + chr(45) + chr(56))) and (jQW5Rj0FIUWk in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b"?\xdb\x1d \x1c\xce\xa4\xbe\xf9'\xeeY"), '\x64' + chr(101) + '\x63' + chr(0b1000110 + 0o51) + chr(100) + '\145')(chr(0b1110101) + '\x74' + '\146' + '\x2d' + chr(0b111000)))[FFfXoBR0AEAI]):
sYBhPoDoLr5p = XURpmPuEWCNF(XURpmPuEWCNF(CfHgcfsEZnRF), spL00kDdDnQS - nzTpIcepk0o8('\060' + chr(0b1000 + 0o147) + '\x31', 8))
bTZ7d2fRwYg1 = KV9ckIhroIia(KV9ckIhroIia(CfHgcfsEZnRF) - nzTpIcepk0o8(chr(48) + chr(0b1011010 + 0o25) + '\061', 8), spL00kDdDnQS)
if sYBhPoDoLr5p < bTZ7d2fRwYg1:
for ZlbFMSG8gCoF in bbT2xIe5pzk7(sYBhPoDoLr5p, bTZ7d2fRwYg1 + nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(111) + chr(1139 - 1090), 8)):
if ZlbFMSG8gCoF in tPPwt53c3V2p and ZlbFMSG8gCoF not in E1HdBbbUHn2s:
Hd4nWPplSa3h = tPPwt53c3V2p[ZlbFMSG8gCoF]
xa9cX4sedibZ = hXMPsSrOQzbh.tokenMatchesNomAdvVinf(Hd4nWPplSa3h, FFfXoBR0AEAI, jQW5Rj0FIUWk)
if xa9cX4sedibZ and (not q104BzPUok6h):
if roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x17\x84\x0c\x1b\x03\xca\xa0\x82\xefQ\xf2f\x1e*\x16K\x08|'), chr(0b1100100) + chr(1204 - 1103) + chr(99) + '\157' + chr(0b1100001 + 0o3) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(0b1100110) + '\x2d' + '\x38'))(FFfXoBR0AEAI, spL00kDdDnQS, Hd4nWPplSa3h[WmO5LTjo3YUT], tPPwt53c3V2p):
roI3spqORKae(eHpDT_fnrcqV[P6huukvm63lP], roI3spqORKae(ES5oEprVxulp(b'!\x83\x0c2\x18\xd5'), '\x64' + '\145' + chr(4380 - 4281) + chr(111) + chr(0b1100100) + chr(5793 - 5692))(chr(0b100110 + 0o117) + chr(0b1110100) + chr(0b1100110) + chr(0b100111 + 0o6) + chr(0b111000)))(H4ps7ZOZ7hjR, Hd4nWPplSa3h[WmO5LTjo3YUT])
roI3spqORKae(eHpDT_fnrcqV[TRDh5eU8TN7t], roI3spqORKae(ES5oEprVxulp(b'!\x83\x0c2\x18\xd5'), chr(0b1001 + 0o133) + chr(8200 - 8099) + chr(706 - 607) + chr(0b1101111) + '\x64' + chr(0b11001 + 0o114))(chr(0b1101011 + 0o12) + chr(0b1110100) + '\x66' + chr(316 - 271) + '\070'))(H4ps7ZOZ7hjR, roI3spqORKae(ES5oEprVxulp(b'&\x82\x12x\x0b\xc5\xb3'), '\x64' + chr(0b1100101) + chr(99) + chr(9203 - 9092) + chr(0b1011 + 0o131) + chr(101))(chr(117) + chr(116) + chr(0b1100011 + 0o3) + chr(45) + chr(0b111000)))
roI3spqORKae(eHpDT_fnrcqV[nZ78BMoogH8U], roI3spqORKae(ES5oEprVxulp(b'!\x83\x0c2\x18\xd5'), '\x64' + chr(0b1100101) + chr(0b1011101 + 0o6) + chr(0b1101111) + chr(0b10001 + 0o123) + chr(0b1100101))(chr(0b1110101) + chr(0b1011011 + 0o31) + chr(0b1001010 + 0o34) + '\055' + chr(0b111000)))(H4ps7ZOZ7hjR, xa9cX4sedibZ)
roI3spqORKae(E1HdBbbUHn2s, roI3spqORKae(ES5oEprVxulp(b"\x00\xb9,c\x12\xc6\x82\x81\xfcp\xc8'"), chr(0b1100100) + '\x65' + chr(6498 - 6399) + chr(0b1000111 + 0o50) + '\x64' + chr(0b1100101))('\165' + chr(116) + chr(0b1011000 + 0o16) + chr(0b101101) + '\x38'))(Hd4nWPplSa3h[WmO5LTjo3YUT])
q104BzPUok6h = nzTpIcepk0o8('\x30' + chr(111) + chr(0b1 + 0o60), 8)
else:
eHpDT_fnrcqV[UJTA6D41ZvOA] = nzTpIcepk0o8('\060' + chr(0b1000110 + 0o51) + '\x31', 8)
eZIkSCLnjlRG = KV9ckIhroIia(H4NoA26ON7iG(tPPwt53c3V2p.keys()))
for eHpDT_fnrcqV in pOHqW_FNK1BR:
if hvzWTn4ua_8s == eHpDT_fnrcqV[DLXKWZHG1d62] and eHpDT_fnrcqV[UJTA6D41ZvOA]:
if ftfygxgFas5X(eHpDT_fnrcqV[TRDh5eU8TN7t]) == nzTpIcepk0o8(chr(1292 - 1244) + chr(0b1010110 + 0o31) + chr(49), 8) or (ftfygxgFas5X(eHpDT_fnrcqV[TRDh5eU8TN7t]) > nzTpIcepk0o8(chr(1855 - 1807) + '\157' + chr(943 - 894), 8) and eHpDT_fnrcqV[TRDh5eU8TN7t][-nzTpIcepk0o8('\x30' + chr(0b101000 + 0o107) + '\062', 8)] != roI3spqORKae(ES5oEprVxulp(b'n'), chr(4865 - 4765) + chr(0b1100101) + '\143' + chr(111) + '\x64' + chr(0b110110 + 0o57))('\165' + chr(12760 - 12644) + chr(5552 - 5450) + chr(45) + chr(0b100101 + 0o23))):
FFfXoBR0AEAI = eHpDT_fnrcqV[a6lfotXZKsof][-nzTpIcepk0o8('\x30' + '\157' + chr(2357 - 2308), 8)] + roI3spqORKae(ES5oEprVxulp(b'h'), chr(100) + chr(2183 - 2082) + '\143' + chr(111) + chr(10000 - 9900) + chr(101))('\x75' + '\164' + chr(102) + '\x2d' + '\x38') + eHpDT_fnrcqV[WZ1cQUih4WVz]
spL00kDdDnQS = eHpDT_fnrcqV[P6huukvm63lP][-nzTpIcepk0o8('\x30' + chr(10769 - 10658) + chr(49), 8)]
if FFfXoBR0AEAI in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x0c\x87Kc\t\xf3\x80\xa5\xec@\xd2s'), chr(8510 - 8410) + chr(0b110101 + 0o60) + chr(0b100000 + 0o103) + chr(5462 - 5351) + chr(5289 - 5189) + '\145')(chr(1945 - 1828) + chr(0b1011001 + 0o33) + chr(102) + chr(0b10010 + 0o33) + chr(0b111000))) and (not roI3spqORKae(FFfXoBR0AEAI, roI3spqORKae(ES5oEprVxulp(b';\x99\x1e%\x1e\xd2\xb2\x87\xe2w'), '\144' + chr(101) + chr(2135 - 2036) + chr(5864 - 5753) + '\144' + chr(2276 - 2175))('\x75' + '\164' + chr(102) + '\055' + '\x38'))(roI3spqORKae(ES5oEprVxulp(b"'\x81\x1aw"), '\144' + chr(6513 - 6412) + chr(2627 - 2528) + chr(111) + chr(8566 - 8466) + chr(0b110000 + 0o65))(chr(12769 - 12652) + chr(5755 - 5639) + chr(102) + '\x2d' + chr(0b110101 + 0o3)))):
sYBhPoDoLr5p = spL00kDdDnQS - nzTpIcepk0o8(chr(1993 - 1945) + chr(0b1000 + 0o147) + chr(1091 - 1042), 8) if eHpDT_fnrcqV[TRDh5eU8TN7t][nzTpIcepk0o8('\x30' + chr(706 - 595) + chr(48), 8)] != roI3spqORKae(ES5oEprVxulp(b'-\x8a\x1e'), chr(6004 - 5904) + chr(5760 - 5659) + '\143' + '\157' + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b11011 + 0o131) + '\146' + chr(307 - 262) + '\070') else spL00kDdDnQS
HiHzeKKzaxK4 = []
iT0iLKuSRuWw = []
for ZlbFMSG8gCoF in bbT2xIe5pzk7(sYBhPoDoLr5p, eZIkSCLnjlRG + nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(0b1101111) + '\x31', 8)):
if ZlbFMSG8gCoF in tPPwt53c3V2p and ZlbFMSG8gCoF not in E1HdBbbUHn2s:
Hd4nWPplSa3h = tPPwt53c3V2p[ZlbFMSG8gCoF]
if Sj1arYgL6SyA(ZlbFMSG8gCoF, va9olG5Fw2F2):
break
if roI3spqORKae(qYyr53WwPVFz, roI3spqORKae(ES5oEprVxulp(b"\x07\xa3\x10'!\x99\x8c\xa0\xf4*\xae]"), chr(100) + '\145' + '\143' + chr(111) + '\x64' + chr(0b1100011 + 0o2))('\165' + chr(0b100010 + 0o122) + '\146' + chr(45) + '\x38'))(Hd4nWPplSa3h):
nfxWBPPnD4RO = DoDyztMAKsny(Hd4nWPplSa3h, qYyr53WwPVFz)
qnYTYR39V38E = Hd4nWPplSa3h[otAw_H2b5sjH][nfxWBPPnD4RO[nzTpIcepk0o8(chr(0b10111 + 0o31) + chr(10949 - 10838) + chr(599 - 551), 8)]][invlgHm8TzbV]
roI3spqORKae(iT0iLKuSRuWw, roI3spqORKae(ES5oEprVxulp(b"\x00\xb9,c\x12\xc6\x82\x81\xfcp\xc8'"), chr(0b110011 + 0o61) + '\x65' + chr(0b11000 + 0o113) + '\157' + '\x64' + '\x65')(chr(117) + chr(0b1110100) + '\x66' + chr(45) + chr(0b101001 + 0o17)))([ZlbFMSG8gCoF, Hd4nWPplSa3h, roI3spqORKae(ES5oEprVxulp(b'\x1e\xb2'), chr(0b1100100) + '\x65' + chr(7715 - 7616) + chr(111) + chr(0b110011 + 0o61) + chr(3925 - 3824))(chr(0b1110101) + '\164' + chr(0b1100110) + '\x2d' + chr(0b110 + 0o62)) + qnYTYR39V38E])
else:
for (D6B80qQyluxl, oZn2EnaygC8z) in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x0c\x87Kc\t\xf3\x80\xa5\xec@\xd2s'), chr(100) + chr(10190 - 10089) + chr(0b1100011) + '\157' + chr(0b11111 + 0o105) + chr(6210 - 6109))('\165' + chr(12010 - 11894) + chr(102) + chr(0b101101) + chr(0b111000)))[FFfXoBR0AEAI]:
if roI3spqORKae(hXMPsSrOQzbh.nomAdvWordTemplates[D6B80qQyluxl], roI3spqORKae(ES5oEprVxulp(b"\x07\xa3\x10'!\x99\x8c\xa0\xf4*\xae]"), chr(9153 - 9053) + '\145' + chr(5808 - 5709) + chr(0b1101111) + '\x64' + chr(101))(chr(117) + chr(116) + '\146' + chr(951 - 906) + chr(56)))(Hd4nWPplSa3h):
roI3spqORKae(HiHzeKKzaxK4, roI3spqORKae(ES5oEprVxulp(b"\x00\xb9,c\x12\xc6\x82\x81\xfcp\xc8'"), chr(100) + chr(4447 - 4346) + '\x63' + '\157' + chr(0b1100100) + chr(0b1010100 + 0o21))('\x75' + chr(0b1101001 + 0o13) + '\146' + '\x2d' + '\070'))([ZlbFMSG8gCoF, Hd4nWPplSa3h, oZn2EnaygC8z, roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x19\xb4(\x1c=\xdb\x81\xd6\xf0~\xd2&'), chr(0b1010 + 0o132) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b111000)))[D6B80qQyluxl], D6B80qQyluxl])
KecqO6AoGYX7 = hXMPsSrOQzbh._canBeExpanded(FFfXoBR0AEAI, spL00kDdDnQS, HiHzeKKzaxK4, iT0iLKuSRuWw, tPPwt53c3V2p)
if KecqO6AoGYX7:
LuZD35XrnDUE = [HiHzeKKzaxK4[nzTpIcepk0o8('\x30' + chr(0b110101 + 0o72) + chr(579 - 531), 8)][nzTpIcepk0o8(chr(0b110 + 0o52) + chr(111) + chr(1797 - 1749), 8)], KecqO6AoGYX7[nzTpIcepk0o8('\060' + chr(0b1101111) + chr(48), 8)]]
pEufoGxIq_Xf = m4Uq0OLJRI84.ONopK8INb53O(KecqO6AoGYX7[nzTpIcepk0o8(chr(48) + chr(0b1101011 + 0o4) + '\x31', 8)])
lX9o34a3vxP7 = [roI3spqORKae(ES5oEprVxulp(b'&\x82\x12x\x0b\xc5\xb3'), chr(0b1100100) + chr(101) + chr(99) + '\157' + chr(0b1100100) + chr(0b101 + 0o140))('\165' + chr(116) + chr(0b1100110) + '\x2d' + '\070'), roI3spqORKae(ES5oEprVxulp(b"'\x81\x1a"), '\144' + '\x65' + chr(0b10110 + 0o115) + chr(2756 - 2645) + chr(0b1100100) + chr(6824 - 6723))(chr(117) + '\164' + '\146' + chr(1426 - 1381) + chr(0b111000)) if pEufoGxIq_Xf else roI3spqORKae(ES5oEprVxulp(b'>\x88\r5'), chr(0b1100100) + '\145' + '\x63' + '\157' + chr(100) + chr(0b1100101))(chr(8591 - 8474) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(0b111000))]
rUaSSyHgA0xv = [DoDyztMAKsny(HiHzeKKzaxK4[nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(4458 - 4347) + chr(48), 8)][nzTpIcepk0o8(chr(0b11100 + 0o24) + chr(0b11010 + 0o125) + chr(0b100100 + 0o15), 8)], HiHzeKKzaxK4[nzTpIcepk0o8('\060' + '\x6f' + chr(48), 8)][nzTpIcepk0o8(chr(1571 - 1523) + chr(111) + chr(0b1101 + 0o46), 8)]), DoDyztMAKsny(KecqO6AoGYX7[nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001), 8)], qYyr53WwPVFz)]
roI3spqORKae(eHpDT_fnrcqV[P6huukvm63lP], roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), '\x64' + chr(101) + '\143' + chr(0b11110 + 0o121) + chr(0b110000 + 0o64) + chr(0b1100101))(chr(4028 - 3911) + '\x74' + chr(0b1100110) + chr(515 - 470) + chr(0b111000)))(LuZD35XrnDUE)
roI3spqORKae(eHpDT_fnrcqV[TRDh5eU8TN7t], roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), '\144' + '\x65' + chr(0b100001 + 0o102) + chr(111) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(116) + chr(0b1100110) + '\x2d' + chr(1302 - 1246)))(lX9o34a3vxP7)
roI3spqORKae(eHpDT_fnrcqV[nZ78BMoogH8U], roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), '\144' + chr(0b1000011 + 0o42) + '\x63' + chr(111) + chr(100) + '\145')(chr(117) + chr(0b1011101 + 0o27) + chr(0b1010000 + 0o26) + '\055' + '\x38'))(rUaSSyHgA0xv)
roI3spqORKae(E1HdBbbUHn2s, roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), '\x64' + '\x65' + '\x63' + '\x6f' + chr(0b1100100) + chr(0b110100 + 0o61))('\165' + '\x74' + chr(3131 - 3029) + '\x2d' + chr(1891 - 1835)))(LuZD35XrnDUE)
q104BzPUok6h = nzTpIcepk0o8(chr(0b110000) + chr(3786 - 3675) + chr(0b11111 + 0o22), 8)
elif FFfXoBR0AEAI in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x0c\x87Kc\t\xf3\x80\xa5\xec@\xd2s'), '\144' + '\145' + chr(0b111010 + 0o51) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(0b10110 + 0o137) + chr(0b1011111 + 0o25) + chr(102) + chr(0b101101) + chr(0b111000))) and roI3spqORKae(FFfXoBR0AEAI, roI3spqORKae(ES5oEprVxulp(b';\x99\x1e%\x1e\xd2\xb2\x87\xe2w'), '\144' + chr(0b1100101) + chr(99) + '\x6f' + '\144' + '\x65')(chr(117) + chr(116) + chr(0b1001 + 0o135) + chr(106 - 61) + chr(0b11101 + 0o33)))(roI3spqORKae(ES5oEprVxulp(b"'\x81\x1aw"), chr(100) + chr(5057 - 4956) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(4999 - 4898))(chr(117) + chr(0b1011001 + 0o33) + '\x66' + chr(0b101101) + chr(56))):
sYBhPoDoLr5p = spL00kDdDnQS - nzTpIcepk0o8(chr(1633 - 1585) + chr(3832 - 3721) + chr(49), 8) if eHpDT_fnrcqV[TRDh5eU8TN7t][nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(48), 8)] != roI3spqORKae(ES5oEprVxulp(b'-\x8a\x1e'), chr(7232 - 7132) + '\x65' + '\143' + chr(0b1010110 + 0o31) + chr(0b1010101 + 0o17) + chr(101))('\x75' + '\x74' + chr(1678 - 1576) + chr(45) + chr(56)) else spL00kDdDnQS
HiHzeKKzaxK4 = []
iT0iLKuSRuWw = []
for ZlbFMSG8gCoF in bbT2xIe5pzk7(sYBhPoDoLr5p, eZIkSCLnjlRG + nzTpIcepk0o8(chr(48) + '\x6f' + chr(1339 - 1290), 8)):
if ZlbFMSG8gCoF in tPPwt53c3V2p and ZlbFMSG8gCoF not in E1HdBbbUHn2s:
Hd4nWPplSa3h = tPPwt53c3V2p[ZlbFMSG8gCoF]
if roI3spqORKae(qYyr53WwPVFz, roI3spqORKae(ES5oEprVxulp(b"\x07\xa3\x10'!\x99\x8c\xa0\xf4*\xae]"), chr(0b1100100) + '\x65' + chr(1371 - 1272) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(460 - 344) + chr(0b1000110 + 0o40) + '\x2d' + '\070'))(Hd4nWPplSa3h):
nfxWBPPnD4RO = DoDyztMAKsny(Hd4nWPplSa3h, qYyr53WwPVFz)
qnYTYR39V38E = Hd4nWPplSa3h[otAw_H2b5sjH][nfxWBPPnD4RO[nzTpIcepk0o8(chr(0b11000 + 0o30) + chr(0b1101111) + chr(1803 - 1755), 8)]][invlgHm8TzbV]
roI3spqORKae(iT0iLKuSRuWw, roI3spqORKae(ES5oEprVxulp(b"\x00\xb9,c\x12\xc6\x82\x81\xfcp\xc8'"), chr(526 - 426) + chr(0b100011 + 0o102) + chr(99) + chr(0b1101111) + chr(100) + chr(1177 - 1076))(chr(117) + chr(3557 - 3441) + chr(0b0 + 0o146) + chr(0b11000 + 0o25) + '\x38'))([ZlbFMSG8gCoF, Hd4nWPplSa3h, roI3spqORKae(ES5oEprVxulp(b'\x1e\xb2'), chr(0b1100100) + '\145' + chr(99) + chr(111) + chr(0b11000 + 0o114) + '\x65')(chr(0b1000010 + 0o63) + chr(116) + chr(0b111110 + 0o50) + '\055' + chr(0b100110 + 0o22)) + qnYTYR39V38E])
else:
for (D6B80qQyluxl, oZn2EnaygC8z) in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x0c\x87Kc\t\xf3\x80\xa5\xec@\xd2s'), chr(0b1000010 + 0o42) + chr(0b1010011 + 0o22) + chr(0b1100011) + chr(111) + '\x64' + '\x65')(chr(0b1110101) + chr(116) + chr(102) + chr(1005 - 960) + chr(108 - 52)))[FFfXoBR0AEAI]:
if roI3spqORKae(hXMPsSrOQzbh.nomAdvWordTemplates[D6B80qQyluxl], roI3spqORKae(ES5oEprVxulp(b"\x07\xa3\x10'!\x99\x8c\xa0\xf4*\xae]"), chr(0b110011 + 0o61) + chr(101) + chr(2057 - 1958) + chr(5439 - 5328) + chr(0b1100100) + chr(101))('\165' + chr(8133 - 8017) + chr(0b1100110) + '\055' + chr(0b1010 + 0o56)))(Hd4nWPplSa3h):
roI3spqORKae(HiHzeKKzaxK4, roI3spqORKae(ES5oEprVxulp(b"\x00\xb9,c\x12\xc6\x82\x81\xfcp\xc8'"), '\x64' + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(4480 - 4380) + chr(9525 - 9424))(chr(0b1110101) + '\x74' + '\146' + chr(0b101101) + chr(0b110110 + 0o2)))([ZlbFMSG8gCoF, Hd4nWPplSa3h, oZn2EnaygC8z, roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x19\xb4(\x1c=\xdb\x81\xd6\xf0~\xd2&'), '\x64' + chr(0b1001101 + 0o30) + chr(1613 - 1514) + '\157' + chr(9896 - 9796) + chr(8126 - 8025))(chr(12687 - 12570) + chr(116) + chr(6938 - 6836) + chr(0b101010 + 0o3) + chr(56)))[D6B80qQyluxl], D6B80qQyluxl])
if Sj1arYgL6SyA(ZlbFMSG8gCoF, va9olG5Fw2F2):
break
KecqO6AoGYX7 = hXMPsSrOQzbh._canBeExpanded(FFfXoBR0AEAI, spL00kDdDnQS, HiHzeKKzaxK4, iT0iLKuSRuWw, tPPwt53c3V2p)
if KecqO6AoGYX7:
LuZD35XrnDUE = [HiHzeKKzaxK4[nzTpIcepk0o8('\060' + '\157' + chr(0b10010 + 0o36), 8)][nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x30', 8)], KecqO6AoGYX7[nzTpIcepk0o8(chr(0b10101 + 0o33) + '\x6f' + chr(48), 8)]]
pEufoGxIq_Xf = m4Uq0OLJRI84.ONopK8INb53O(KecqO6AoGYX7[nzTpIcepk0o8(chr(1367 - 1319) + chr(111) + chr(0b10011 + 0o36), 8)])
lX9o34a3vxP7 = [roI3spqORKae(ES5oEprVxulp(b'&\x82\x12x\x0b\xc5\xb3'), '\144' + '\x65' + chr(5939 - 5840) + chr(5513 - 5402) + chr(0b1011001 + 0o13) + chr(101))('\165' + chr(0b1110100) + chr(0b1100110) + chr(1258 - 1213) + '\x38'), roI3spqORKae(ES5oEprVxulp(b"'\x81\x1a"), chr(0b100111 + 0o75) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(3022 - 2922) + '\x65')(chr(8899 - 8782) + chr(116) + '\x66' + chr(0b101101) + chr(367 - 311)) if pEufoGxIq_Xf else roI3spqORKae(ES5oEprVxulp(b'>\x88\r5'), chr(8076 - 7976) + chr(0b1100101) + '\x63' + chr(0b1010101 + 0o32) + chr(1677 - 1577) + chr(0b11101 + 0o110))('\x75' + '\x74' + chr(102) + '\x2d' + chr(0b111000))]
rUaSSyHgA0xv = [DoDyztMAKsny(HiHzeKKzaxK4[nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(523 - 475), 8)][nzTpIcepk0o8(chr(48) + chr(0b10100 + 0o133) + chr(0b110001), 8)], HiHzeKKzaxK4[nzTpIcepk0o8('\x30' + chr(111) + chr(669 - 621), 8)][nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\063', 8)]), DoDyztMAKsny(KecqO6AoGYX7[nzTpIcepk0o8('\060' + '\x6f' + chr(2370 - 2321), 8)], qYyr53WwPVFz)]
roI3spqORKae(eHpDT_fnrcqV[P6huukvm63lP], roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), chr(100) + chr(0b1100101) + chr(9195 - 9096) + '\x6f' + chr(3450 - 3350) + chr(561 - 460))(chr(10188 - 10071) + '\164' + chr(102) + chr(298 - 253) + '\070'))(LuZD35XrnDUE)
roI3spqORKae(eHpDT_fnrcqV[TRDh5eU8TN7t], roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), chr(100) + chr(7990 - 7889) + '\x63' + '\157' + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b1010100 + 0o40) + chr(0b1100110) + '\x2d' + '\x38'))(lX9o34a3vxP7)
roI3spqORKae(eHpDT_fnrcqV[nZ78BMoogH8U], roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), chr(0b101011 + 0o71) + '\145' + chr(0b1010100 + 0o17) + chr(0b1101111) + chr(2001 - 1901) + '\x65')(chr(3169 - 3052) + '\164' + '\146' + chr(45) + chr(0b111000)))(rUaSSyHgA0xv)
roI3spqORKae(E1HdBbbUHn2s, roI3spqORKae(ES5oEprVxulp(b'\x1c\xb2L\x1a\x05\xc5\x89\xb9\xc9]\xffc'), chr(0b1001100 + 0o30) + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(0b0 + 0o145))(chr(784 - 667) + '\x74' + chr(0b11 + 0o143) + chr(1934 - 1889) + '\x38'))(LuZD35XrnDUE)
q104BzPUok6h = nzTpIcepk0o8('\x30' + '\157' + '\x31', 8)
return q104BzPUok6h
|
estnltk/estnltk
|
estnltk/wiki/sections.py
|
sectionsParser
|
def sectionsParser(text):
"""
:param text: the whole text of an wikipedia article
:return: a list of nested section objects
[{title: "Rahvaarv",
text: "Eestis elab..."},
{title: "Ajalugu",
text: "..."},
sections: [{title: "Rahvaarv",
text: "Eestis elab..."},
{title: "Ajalugu",
text: "..."}],],
"""
textStart = 0
#Split the text in sections. Hackish part, but seems to work fine.
entries = re.split("\n=", text[textStart:])
stack = [[]]
intro = {}
sectionTitleRegEx = re.compile(r'={1,}.+={2,}')
section = {}
section['text'] = entries[0]
counts = []
#Presumes the first section is always marked with 2 =
#First count is always 3. (\n=)= First Section of an Article ==
#Parens is omitted. Leaves three = marks.
counts.append(3)
sections = []
sections.append(section)
for i in entries[1:]:
section = {}
title = re.match(sectionTitleRegEx, i)
if title:
titleEnd = title.end()
title = title.group()
text = i[titleEnd:]
level = title.count('=')
section['title']=title.strip('= ')
section['text']=text
sections.append(section.copy())
counts.append(level)
#add images, links, references, tables
for section in sections:
text = section['text']
if 'wikitable' in text or '</table>' in text.lower():
section['text'], section['tables'] = tableCollector(text)
section = relatedArticles(section)
if '<ref' in text:
section = reffinder(section)
if imageRegEx.search(text):
section = imageParser(section)
section['text'] = section['text'].strip()
if ExtLinkBracketedRegex.search(text):
section = addExternalLinks(section)
if '[[' in text:
section = addIntLinks(section)
#clean uneven brackets and whatnot
#take extlink start:end w regex.
el = 'external_links'
if el in section.keys():
#section['text'] = section['text'].replace('[', '').replace(']', '')
text = section['text']
for link in section[el]:
label = link['label']
label = re.compile(re.escape(label))
m = label.search(text)
#if there are unbalanced brackets in the external
#links label inside text then it fails to mark the start and end
try:
link['start'] = m.start()
link['end'] = m.end()
except AttributeError:
print('Problem with external links start:end position!')
print(label)
print(text)
#datastructure nesting thanks to Timo!
if counts:
assert len(counts) == len(sections)
n = len(sections)
pos = 0
levels = [counts[0]]
while pos < n:
count = counts[pos]
elem = sections[pos]
level = levels[-1]
if count == level:
stack[-1].append(elem)
elif count >= level:
stack.append([elem])
levels.append(count)
else:
group = stack.pop()
stack[-1][-1]['sections'] = group
levels.pop()
continue
pos += 1
while len(stack) > 1:
group = stack.pop()
stack[-1][-1]['sections'] = group
stack = stack[0]
return stack
|
python
|
def sectionsParser(text):
"""
:param text: the whole text of an wikipedia article
:return: a list of nested section objects
[{title: "Rahvaarv",
text: "Eestis elab..."},
{title: "Ajalugu",
text: "..."},
sections: [{title: "Rahvaarv",
text: "Eestis elab..."},
{title: "Ajalugu",
text: "..."}],],
"""
textStart = 0
#Split the text in sections. Hackish part, but seems to work fine.
entries = re.split("\n=", text[textStart:])
stack = [[]]
intro = {}
sectionTitleRegEx = re.compile(r'={1,}.+={2,}')
section = {}
section['text'] = entries[0]
counts = []
#Presumes the first section is always marked with 2 =
#First count is always 3. (\n=)= First Section of an Article ==
#Parens is omitted. Leaves three = marks.
counts.append(3)
sections = []
sections.append(section)
for i in entries[1:]:
section = {}
title = re.match(sectionTitleRegEx, i)
if title:
titleEnd = title.end()
title = title.group()
text = i[titleEnd:]
level = title.count('=')
section['title']=title.strip('= ')
section['text']=text
sections.append(section.copy())
counts.append(level)
#add images, links, references, tables
for section in sections:
text = section['text']
if 'wikitable' in text or '</table>' in text.lower():
section['text'], section['tables'] = tableCollector(text)
section = relatedArticles(section)
if '<ref' in text:
section = reffinder(section)
if imageRegEx.search(text):
section = imageParser(section)
section['text'] = section['text'].strip()
if ExtLinkBracketedRegex.search(text):
section = addExternalLinks(section)
if '[[' in text:
section = addIntLinks(section)
#clean uneven brackets and whatnot
#take extlink start:end w regex.
el = 'external_links'
if el in section.keys():
#section['text'] = section['text'].replace('[', '').replace(']', '')
text = section['text']
for link in section[el]:
label = link['label']
label = re.compile(re.escape(label))
m = label.search(text)
#if there are unbalanced brackets in the external
#links label inside text then it fails to mark the start and end
try:
link['start'] = m.start()
link['end'] = m.end()
except AttributeError:
print('Problem with external links start:end position!')
print(label)
print(text)
#datastructure nesting thanks to Timo!
if counts:
assert len(counts) == len(sections)
n = len(sections)
pos = 0
levels = [counts[0]]
while pos < n:
count = counts[pos]
elem = sections[pos]
level = levels[-1]
if count == level:
stack[-1].append(elem)
elif count >= level:
stack.append([elem])
levels.append(count)
else:
group = stack.pop()
stack[-1][-1]['sections'] = group
levels.pop()
continue
pos += 1
while len(stack) > 1:
group = stack.pop()
stack[-1][-1]['sections'] = group
stack = stack[0]
return stack
|
[
"def",
"sectionsParser",
"(",
"text",
")",
":",
"textStart",
"=",
"0",
"#Split the text in sections. Hackish part, but seems to work fine.",
"entries",
"=",
"re",
".",
"split",
"(",
"\"\\n=\"",
",",
"text",
"[",
"textStart",
":",
"]",
")",
"stack",
"=",
"[",
"[",
"]",
"]",
"intro",
"=",
"{",
"}",
"sectionTitleRegEx",
"=",
"re",
".",
"compile",
"(",
"r'={1,}.+={2,}'",
")",
"section",
"=",
"{",
"}",
"section",
"[",
"'text'",
"]",
"=",
"entries",
"[",
"0",
"]",
"counts",
"=",
"[",
"]",
"#Presumes the first section is always marked with 2 =",
"#First count is always 3. (\\n=)= First Section of an Article ==",
"#Parens is omitted. Leaves three = marks.",
"counts",
".",
"append",
"(",
"3",
")",
"sections",
"=",
"[",
"]",
"sections",
".",
"append",
"(",
"section",
")",
"for",
"i",
"in",
"entries",
"[",
"1",
":",
"]",
":",
"section",
"=",
"{",
"}",
"title",
"=",
"re",
".",
"match",
"(",
"sectionTitleRegEx",
",",
"i",
")",
"if",
"title",
":",
"titleEnd",
"=",
"title",
".",
"end",
"(",
")",
"title",
"=",
"title",
".",
"group",
"(",
")",
"text",
"=",
"i",
"[",
"titleEnd",
":",
"]",
"level",
"=",
"title",
".",
"count",
"(",
"'='",
")",
"section",
"[",
"'title'",
"]",
"=",
"title",
".",
"strip",
"(",
"'= '",
")",
"section",
"[",
"'text'",
"]",
"=",
"text",
"sections",
".",
"append",
"(",
"section",
".",
"copy",
"(",
")",
")",
"counts",
".",
"append",
"(",
"level",
")",
"#add images, links, references, tables",
"for",
"section",
"in",
"sections",
":",
"text",
"=",
"section",
"[",
"'text'",
"]",
"if",
"'wikitable'",
"in",
"text",
"or",
"'</table>'",
"in",
"text",
".",
"lower",
"(",
")",
":",
"section",
"[",
"'text'",
"]",
",",
"section",
"[",
"'tables'",
"]",
"=",
"tableCollector",
"(",
"text",
")",
"section",
"=",
"relatedArticles",
"(",
"section",
")",
"if",
"'<ref'",
"in",
"text",
":",
"section",
"=",
"reffinder",
"(",
"section",
")",
"if",
"imageRegEx",
".",
"search",
"(",
"text",
")",
":",
"section",
"=",
"imageParser",
"(",
"section",
")",
"section",
"[",
"'text'",
"]",
"=",
"section",
"[",
"'text'",
"]",
".",
"strip",
"(",
")",
"if",
"ExtLinkBracketedRegex",
".",
"search",
"(",
"text",
")",
":",
"section",
"=",
"addExternalLinks",
"(",
"section",
")",
"if",
"'[['",
"in",
"text",
":",
"section",
"=",
"addIntLinks",
"(",
"section",
")",
"#clean uneven brackets and whatnot",
"#take extlink start:end w regex.",
"el",
"=",
"'external_links'",
"if",
"el",
"in",
"section",
".",
"keys",
"(",
")",
":",
"#section['text'] = section['text'].replace('[', '').replace(']', '')",
"text",
"=",
"section",
"[",
"'text'",
"]",
"for",
"link",
"in",
"section",
"[",
"el",
"]",
":",
"label",
"=",
"link",
"[",
"'label'",
"]",
"label",
"=",
"re",
".",
"compile",
"(",
"re",
".",
"escape",
"(",
"label",
")",
")",
"m",
"=",
"label",
".",
"search",
"(",
"text",
")",
"#if there are unbalanced brackets in the external",
"#links label inside text then it fails to mark the start and end",
"try",
":",
"link",
"[",
"'start'",
"]",
"=",
"m",
".",
"start",
"(",
")",
"link",
"[",
"'end'",
"]",
"=",
"m",
".",
"end",
"(",
")",
"except",
"AttributeError",
":",
"print",
"(",
"'Problem with external links start:end position!'",
")",
"print",
"(",
"label",
")",
"print",
"(",
"text",
")",
"#datastructure nesting thanks to Timo!",
"if",
"counts",
":",
"assert",
"len",
"(",
"counts",
")",
"==",
"len",
"(",
"sections",
")",
"n",
"=",
"len",
"(",
"sections",
")",
"pos",
"=",
"0",
"levels",
"=",
"[",
"counts",
"[",
"0",
"]",
"]",
"while",
"pos",
"<",
"n",
":",
"count",
"=",
"counts",
"[",
"pos",
"]",
"elem",
"=",
"sections",
"[",
"pos",
"]",
"level",
"=",
"levels",
"[",
"-",
"1",
"]",
"if",
"count",
"==",
"level",
":",
"stack",
"[",
"-",
"1",
"]",
".",
"append",
"(",
"elem",
")",
"elif",
"count",
">=",
"level",
":",
"stack",
".",
"append",
"(",
"[",
"elem",
"]",
")",
"levels",
".",
"append",
"(",
"count",
")",
"else",
":",
"group",
"=",
"stack",
".",
"pop",
"(",
")",
"stack",
"[",
"-",
"1",
"]",
"[",
"-",
"1",
"]",
"[",
"'sections'",
"]",
"=",
"group",
"levels",
".",
"pop",
"(",
")",
"continue",
"pos",
"+=",
"1",
"while",
"len",
"(",
"stack",
")",
">",
"1",
":",
"group",
"=",
"stack",
".",
"pop",
"(",
")",
"stack",
"[",
"-",
"1",
"]",
"[",
"-",
"1",
"]",
"[",
"'sections'",
"]",
"=",
"group",
"stack",
"=",
"stack",
"[",
"0",
"]",
"return",
"stack"
] |
:param text: the whole text of an wikipedia article
:return: a list of nested section objects
[{title: "Rahvaarv",
text: "Eestis elab..."},
{title: "Ajalugu",
text: "..."},
sections: [{title: "Rahvaarv",
text: "Eestis elab..."},
{title: "Ajalugu",
text: "..."}],],
|
[
":",
"param",
"text",
":",
"the",
"whole",
"text",
"of",
"an",
"wikipedia",
"article",
":",
"return",
":",
"a",
"list",
"of",
"nested",
"section",
"objects",
"[",
"{",
"title",
":",
"Rahvaarv",
"text",
":",
"Eestis",
"elab",
"...",
"}",
"{",
"title",
":",
"Ajalugu",
"text",
":",
"...",
"}",
"sections",
":",
"[",
"{",
"title",
":",
"Rahvaarv",
"text",
":",
"Eestis",
"elab",
"...",
"}",
"{",
"title",
":",
"Ajalugu",
"text",
":",
"...",
"}",
"]",
"]"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/wiki/sections.py#L13-L144
|
train
|
Parses the whole text of an wikipedia article into nested sections.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiY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UhqOt5_BbS,WtdkIpFeYozM,MdkNqd1bagO6,QNQS9e6tJqMV,typojWN5Phrq,gufQJgTAhMnI,uPAcezIXzQNA,i739myaCTbWD,AtYHTsImz86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(1641 - 1591) + '\x31' + chr(51), 0b1000), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(3437 - 3326) + chr(0b110111) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1010000 + 0o37) + '\063' + '\x33' + chr(603 - 552), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(593 - 542) + chr(1027 - 977) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(0b110011 + 0o74) + chr(50) + chr(0b110000 + 0o2) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + chr(49) + '\x35' + chr(1009 - 959), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110001) + '\065' + chr(401 - 347), 43208 - 43200), nzTpIcepk0o8('\060' + chr(0b1101111) + '\063', 38747 - 38739), nzTpIcepk0o8('\060' + '\157' + chr(0b110010) + chr(753 - 700) + chr(54), 0o10), nzTpIcepk0o8('\060' + chr(111) + chr(0b1100 + 0o47) + chr(0b110001) + chr(444 - 390), ord("\x08")), nzTpIcepk0o8('\060' + chr(4392 - 4281) + chr(0b110010) + chr(1489 - 1436) + '\064', 0o10), nzTpIcepk0o8('\060' + chr(1427 - 1316) + '\062' + '\064', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(50) + chr(1613 - 1565) + chr(50), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010 + 0o2), ord("\x08")), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1101111) + chr(50) + chr(0b111 + 0o57), 0b1000), nzTpIcepk0o8(chr(723 - 675) + chr(111) + '\x32' + '\x35' + chr(0b100 + 0o61), 0b1000), nzTpIcepk0o8(chr(1431 - 1383) + chr(111) + '\x31' + chr(0b11000 + 0o36) + chr(50), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b11100 + 0o27) + '\061', ord("\x08")), nzTpIcepk0o8(chr(1685 - 1637) + chr(3286 - 3175) + '\x31' + chr(51) + chr(0b110001), ord("\x08")), nzTpIcepk0o8('\x30' + chr(6442 - 6331) + '\065' + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110001) + chr(51) + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(55) + chr(0b11011 + 0o30), 0o10), nzTpIcepk0o8(chr(1479 - 1431) + chr(0b1101111) + '\x32' + chr(52), 8), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(4413 - 4302) + chr(778 - 726) + chr(52), 0b1000), nzTpIcepk0o8('\060' + chr(8584 - 8473) + '\061' + '\x33', ord("\x08")), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(111) + chr(0b110011) + chr(0b10111 + 0o37) + chr(1370 - 1321), 0o10), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(10520 - 10409) + chr(0b100000 + 0o22) + chr(0b110101) + chr(48), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\061' + chr(54) + '\x37', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(4241 - 4130) + chr(0b110001) + chr(2492 - 2442) + '\065', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(597 - 547) + chr(50) + '\x32', 31790 - 31782), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x33' + chr(50), 0o10), nzTpIcepk0o8(chr(0b10100 + 0o34) + chr(2467 - 2356) + '\061' + chr(0b110110) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(1183 - 1135) + '\157' + chr(0b100110 + 0o15) + chr(52) + chr(48), 43102 - 43094), nzTpIcepk0o8(chr(0b10010 + 0o36) + chr(0b1101111) + chr(0b101011 + 0o6) + chr(0b110001) + chr(50), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b11011 + 0o30) + '\x37' + chr(0b110100), 50179 - 50171), nzTpIcepk0o8(chr(0b110000 + 0o0) + chr(0b11011 + 0o124) + chr(267 - 218) + '\x34' + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101111) + chr(179 - 128) + chr(0b10001 + 0o40) + chr(50), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + '\063' + chr(0b110011), 0o10), nzTpIcepk0o8(chr(117 - 69) + chr(111) + chr(812 - 761) + chr(0b10010 + 0o43) + chr(49), 0b1000), nzTpIcepk0o8(chr(48) + chr(9184 - 9073) + '\x33' + chr(0b100011 + 0o24) + chr(999 - 950), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(2156 - 2103) + chr(48), 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xa5'), chr(0b1100100) + '\x65' + chr(3192 - 3093) + chr(0b1010001 + 0o36) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b101101) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def frw8ts0k6gUr(cpStk7cY1TJd):
DypuWHoTlVhq = nzTpIcepk0o8('\060' + '\157' + chr(48), 0o10)
iFLfP3Ro3ZHs = aoTc4YA2bs2R.LfRrQOxuDvnC(roI3spqORKae(ES5oEprVxulp(b'\x81\x01'), '\144' + chr(0b1100101) + '\x63' + '\x6f' + chr(100) + '\x65')(chr(0b1001011 + 0o52) + chr(450 - 334) + chr(0b1001 + 0o135) + chr(0b101101) + chr(0b111000)), cpStk7cY1TJd[DypuWHoTlVhq:])
GmJYyzXaQAzC = [[]]
SaLDoO7pawcC = {}
qzmibaceSJUy = aoTc4YA2bs2R.compile(roI3spqORKae(ES5oEprVxulp(b'\xb6G\xea\xfc\xedDE>\xd5\xfc\x80i'), chr(100) + chr(1083 - 982) + chr(6774 - 6675) + '\157' + chr(0b1100100) + '\x65')(chr(9276 - 9159) + chr(0b1110100) + '\x66' + chr(107 - 62) + chr(0b111000)))
qpII1aNYuV7Z = {}
qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xffY\xa3\xa4'), '\x64' + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b101101 + 0o67) + chr(101))(chr(12780 - 12663) + '\x74' + '\x66' + chr(45) + chr(56))] = iFLfP3Ro3ZHs[nzTpIcepk0o8('\x30' + '\157' + '\x30', 8)]
gm2kNaWYNE_r = []
roI3spqORKae(gm2kNaWYNE_r, roI3spqORKae(ES5oEprVxulp(b'\xc3h\x88\xe4\xe8\r)l\xc4\xa1\xf9!'), '\144' + chr(0b1100101) + chr(99) + '\x6f' + chr(100) + '\x65')(chr(117) + chr(0b1100011 + 0o21) + chr(0b110010 + 0o64) + '\x2d' + chr(0b10110 + 0o42)))(nzTpIcepk0o8(chr(0b10100 + 0o34) + '\x6f' + chr(2108 - 2057), 8))
LZU8GxZB9Wu1 = []
roI3spqORKae(LZU8GxZB9Wu1, roI3spqORKae(ES5oEprVxulp(b'\xc3h\x88\xe4\xe8\r)l\xc4\xa1\xf9!'), chr(4995 - 4895) + chr(9363 - 9262) + chr(99) + chr(0b1101111) + '\144' + chr(101))(chr(0b1011101 + 0o30) + chr(0b1110100) + chr(102) + '\055' + chr(0b1 + 0o67)))(qpII1aNYuV7Z)
for ZlbFMSG8gCoF in iFLfP3Ro3ZHs[nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b1101111) + chr(0b110001), 57859 - 57851):]:
qpII1aNYuV7Z = {}
OO0tRW9aj_xh = aoTc4YA2bs2R.hk9OijmiC_zA(qzmibaceSJUy, ZlbFMSG8gCoF)
if OO0tRW9aj_xh:
LIaOWyWaLGlR = OO0tRW9aj_xh.NiWVjAWn0l6T()
OO0tRW9aj_xh = OO0tRW9aj_xh.F9lJ8RbIonqb()
cpStk7cY1TJd = ZlbFMSG8gCoF[LIaOWyWaLGlR:]
OHMe9lml54lU = OO0tRW9aj_xh.sQSWKlURp7QK(roI3spqORKae(ES5oEprVxulp(b'\xb6'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + chr(6745 - 6645) + chr(1415 - 1314))(chr(875 - 758) + chr(564 - 448) + chr(102) + chr(269 - 224) + chr(0b111000)))
qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xffU\xaf\xbc\xf5'), chr(100) + chr(101) + chr(99) + '\157' + chr(100) + chr(101))(chr(117) + '\164' + chr(0b101000 + 0o76) + chr(0b1011 + 0o42) + chr(56))] = OO0tRW9aj_xh.kdIDrcwZTCs5(roI3spqORKae(ES5oEprVxulp(b'\xb6\x1c'), chr(100) + '\x65' + chr(0b111101 + 0o46) + chr(0b1010110 + 0o31) + chr(100) + chr(2429 - 2328))(chr(0b10000 + 0o145) + chr(0b1110100) + chr(102) + '\x2d' + chr(56)))
qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xffY\xa3\xa4'), '\x64' + '\145' + chr(0b101110 + 0o65) + chr(0b1101111) + '\x64' + chr(637 - 536))(chr(0b1000001 + 0o64) + chr(5973 - 5857) + chr(1809 - 1707) + chr(0b101101) + chr(0b11010 + 0o36))] = cpStk7cY1TJd
roI3spqORKae(LZU8GxZB9Wu1, roI3spqORKae(ES5oEprVxulp(b'\xc3h\x88\xe4\xe8\r)l\xc4\xa1\xf9!'), '\144' + '\x65' + chr(99) + chr(0b10111 + 0o130) + chr(998 - 898) + chr(101))(chr(0b100111 + 0o116) + chr(0b101010 + 0o112) + chr(0b101001 + 0o75) + chr(45) + '\070'))(roI3spqORKae(qpII1aNYuV7Z, roI3spqORKae(ES5oEprVxulp(b'\xe8S\xab\xa9'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(0b111000 + 0o67) + chr(100) + chr(0b1100101))(chr(0b1110010 + 0o3) + chr(116) + chr(102) + chr(1351 - 1306) + chr(0b1 + 0o67)))())
roI3spqORKae(gm2kNaWYNE_r, roI3spqORKae(ES5oEprVxulp(b'\xc3h\x88\xe4\xe8\r)l\xc4\xa1\xf9!'), '\x64' + '\145' + chr(1833 - 1734) + '\157' + chr(100) + chr(0b1100101))(chr(10517 - 10400) + chr(116) + '\x66' + chr(0b101101) + '\x38'))(OHMe9lml54lU)
for qpII1aNYuV7Z in LZU8GxZB9Wu1:
cpStk7cY1TJd = qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xffY\xa3\xa4'), chr(0b1011010 + 0o12) + chr(8731 - 8630) + '\143' + chr(0b101111 + 0o100) + chr(0b101000 + 0o74) + chr(0b1010001 + 0o24))('\x75' + chr(116) + '\x66' + '\055' + '\070')]
if roI3spqORKae(ES5oEprVxulp(b'\xfcU\xb0\xb9\xe4\x0b\x0co\xcb'), chr(6211 - 6111) + chr(0b101110 + 0o67) + '\143' + chr(111) + chr(0b1100100) + chr(0b11001 + 0o114))(chr(117) + chr(116) + chr(0b1100110) + '\055' + chr(56)) in cpStk7cY1TJd or roI3spqORKae(ES5oEprVxulp(b'\xb7\x13\xaf\xb1\xf2\x06\x0b='), chr(0b1100100) + chr(1290 - 1189) + '\143' + chr(0b1 + 0o156) + chr(0b101010 + 0o72) + '\x65')(chr(0b1110101) + chr(0b1010000 + 0o44) + chr(391 - 289) + chr(0b101101) + chr(56)) in roI3spqORKae(cpStk7cY1TJd, roI3spqORKae(ES5oEprVxulp(b'\xd3R\xe3\x95\xde=#Y\xca\x87\xfe`'), chr(0b1011010 + 0o12) + '\x65' + chr(0b1100011) + chr(111) + chr(0b1100011 + 0o1) + chr(2805 - 2704))('\x75' + '\164' + chr(0b110000 + 0o66) + '\x2d' + chr(0b111000)))():
(qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xffY\xa3\xa4'), chr(0b1011101 + 0o7) + '\x65' + chr(0b1100011) + chr(0b101111 + 0o100) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b10000 + 0o144) + '\146' + '\x2d' + '\070')], qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xff]\xb9\xbc\xf5\x19'), chr(7937 - 7837) + chr(101) + chr(2997 - 2898) + '\x6f' + chr(100) + chr(2324 - 2223))(chr(117) + chr(116) + '\146' + chr(0b100 + 0o51) + '\070')]) = uWjZm7fZZcan(cpStk7cY1TJd)
qpII1aNYuV7Z = Nrpw7zTP6GJQ(qpII1aNYuV7Z)
if roI3spqORKae(ES5oEprVxulp(b'\xb7N\xbe\xb6'), chr(1309 - 1209) + chr(0b1010001 + 0o24) + '\143' + chr(111) + '\x64' + chr(0b1000010 + 0o43))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(45) + chr(1556 - 1500)) in cpStk7cY1TJd:
qpII1aNYuV7Z = yQG3ztKSASs3(qpII1aNYuV7Z)
if roI3spqORKae(V7hapHRIskEp, roI3spqORKae(ES5oEprVxulp(b'\xcf]\x81\xe8\xd9\x04\x14R\xc9\x88\xe6b'), '\x64' + '\145' + chr(9653 - 9554) + chr(7044 - 6933) + chr(100) + chr(0b100000 + 0o105))('\165' + '\164' + chr(0b1100110) + '\x2d' + chr(0b110000 + 0o10)))(cpStk7cY1TJd):
qpII1aNYuV7Z = YRMdiAMbPeVf(qpII1aNYuV7Z)
qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xffY\xa3\xa4'), '\144' + chr(7677 - 7576) + '\143' + chr(111) + chr(0b1100100) + chr(101))(chr(117) + '\x74' + chr(7754 - 7652) + chr(0b101101) + '\070')] = qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xffY\xa3\xa4'), chr(5849 - 5749) + '\x65' + chr(0b1100011) + chr(0b1101111) + '\144' + '\145')(chr(117) + chr(0b10110 + 0o136) + '\x66' + chr(0b101101) + '\x38')].kdIDrcwZTCs5()
if roI3spqORKae(Ak0lCug2VBKd, roI3spqORKae(ES5oEprVxulp(b'\xcf]\x81\xe8\xd9\x04\x14R\xc9\x88\xe6b'), chr(0b1100100) + chr(4638 - 4537) + '\x63' + '\x6f' + chr(5221 - 5121) + chr(0b10000 + 0o125))(chr(8666 - 8549) + chr(116) + '\146' + chr(0b10110 + 0o27) + chr(0b11111 + 0o31)))(cpStk7cY1TJd):
qpII1aNYuV7Z = naZC_GTMt7ej(qpII1aNYuV7Z)
if roI3spqORKae(ES5oEprVxulp(b'\xd0g'), '\x64' + chr(0b1000110 + 0o37) + chr(0b1100011) + chr(111) + chr(0b11111 + 0o105) + chr(0b1110 + 0o127))(chr(0b1101101 + 0o10) + '\x74' + chr(0b1001 + 0o135) + '\055' + chr(56)) in cpStk7cY1TJd:
qpII1aNYuV7Z = fsh0Eq0b9Iig(qpII1aNYuV7Z)
poiEiq5MsMMo = roI3spqORKae(ES5oEprVxulp(b'\xeeD\xaf\xb5\xe2\x04\x0fo\xf1\xa2\xc5z\xe9w'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + '\144' + chr(3632 - 3531))('\165' + '\x74' + chr(6350 - 6248) + chr(45) + chr(0b111000))
if poiEiq5MsMMo in roI3spqORKae(qpII1aNYuV7Z, roI3spqORKae(ES5oEprVxulp(b'\xe0Y\xa2\xa3'), chr(5239 - 5139) + chr(0b111011 + 0o52) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b11101 + 0o110))('\x75' + '\x74' + chr(2694 - 2592) + '\055' + chr(56)))():
cpStk7cY1TJd = qpII1aNYuV7Z[roI3spqORKae(ES5oEprVxulp(b'\xffY\xa3\xa4'), '\144' + '\145' + '\x63' + chr(111) + chr(9560 - 9460) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(7692 - 7590) + chr(45) + '\070')]
for QA8TZurzG25Z in qpII1aNYuV7Z[poiEiq5MsMMo]:
OkDIn6t2Cke6 = QA8TZurzG25Z[roI3spqORKae(ES5oEprVxulp(b'\xe7]\xb9\xb5\xfc'), '\144' + chr(0b1100100 + 0o1) + '\x63' + chr(0b1111 + 0o140) + chr(100) + '\x65')(chr(0b1110101) + chr(0b1000011 + 0o61) + chr(0b1100110) + '\x2d' + chr(56))]
OkDIn6t2Cke6 = aoTc4YA2bs2R.compile(aoTc4YA2bs2R.lfFf1I73PDZv(OkDIn6t2Cke6))
tF75nqoNENFL = OkDIn6t2Cke6.DaZ8InzQgFJv(cpStk7cY1TJd)
try:
QA8TZurzG25Z[roI3spqORKae(ES5oEprVxulp(b'\xf8H\xba\xa2\xe4'), chr(0b1100100) + '\145' + chr(0b1011010 + 0o11) + '\x6f' + chr(0b101 + 0o137) + '\145')(chr(11458 - 11341) + chr(0b1110100) + chr(4689 - 4587) + chr(0b101100 + 0o1) + chr(0b1111 + 0o51))] = tF75nqoNENFL.KQbHFTcl_LKy()
QA8TZurzG25Z[roI3spqORKae(ES5oEprVxulp(b'\xeeR\xbf'), chr(1235 - 1135) + '\145' + chr(0b1100011) + '\157' + chr(0b110111 + 0o55) + '\x65')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b10 + 0o53) + chr(56))] = tF75nqoNENFL.NiWVjAWn0l6T()
except bIsJhlpYrrU2:
v8jsMqaYV6U2(roI3spqORKae(ES5oEprVxulp(b'\xdbN\xb4\xb2\xfc\x0f\x03#\xd9\xa7\xd8|\xa2an\xd9\x17k7K7\x1bxMe\x9a\xdbW&\xe6{\x07\x94p\x99\x0f\xae;\x99\x96\xf8U\xaf\xb9\xff\x04O'), chr(6631 - 6531) + chr(7896 - 7795) + chr(99) + chr(111) + chr(100) + chr(0b1100101))(chr(3506 - 3389) + chr(5389 - 5273) + '\146' + '\x2d' + chr(1462 - 1406)))
v8jsMqaYV6U2(OkDIn6t2Cke6)
v8jsMqaYV6U2(cpStk7cY1TJd)
if gm2kNaWYNE_r:
assert ftfygxgFas5X(gm2kNaWYNE_r) == ftfygxgFas5X(LZU8GxZB9Wu1)
NoZxuO7wjArS = ftfygxgFas5X(LZU8GxZB9Wu1)
IGIA_fu6MbaO = nzTpIcepk0o8('\x30' + chr(0b110000 + 0o77) + '\060', 8)
NcsybIE2o3mI = [gm2kNaWYNE_r[nzTpIcepk0o8(chr(48) + chr(0b111101 + 0o62) + chr(48), 8)]]
while IGIA_fu6MbaO < NoZxuO7wjArS:
sQSWKlURp7QK = gm2kNaWYNE_r[IGIA_fu6MbaO]
Ge7qqaux3bQW = LZU8GxZB9Wu1[IGIA_fu6MbaO]
OHMe9lml54lU = NcsybIE2o3mI[-nzTpIcepk0o8(chr(788 - 740) + '\157' + '\061', 8)]
if sQSWKlURp7QK == OHMe9lml54lU:
roI3spqORKae(GmJYyzXaQAzC[-nzTpIcepk0o8(chr(1786 - 1738) + chr(0b1101111) + chr(49), 8)], roI3spqORKae(ES5oEprVxulp(b'\xc3h\x88\xe4\xe8\r)l\xc4\xa1\xf9!'), chr(0b1001 + 0o133) + chr(0b1100101) + chr(4861 - 4762) + chr(0b100101 + 0o112) + chr(0b101100 + 0o70) + chr(4004 - 3903))('\x75' + '\x74' + '\x66' + chr(45) + chr(1948 - 1892)))(Ge7qqaux3bQW)
elif sQSWKlURp7QK >= OHMe9lml54lU:
roI3spqORKae(GmJYyzXaQAzC, roI3spqORKae(ES5oEprVxulp(b'\xc3h\x88\xe4\xe8\r)l\xc4\xa1\xf9!'), chr(100) + chr(0b110011 + 0o62) + chr(0b1100011) + '\x6f' + '\144' + chr(9318 - 9217))('\165' + chr(0b110011 + 0o101) + '\146' + chr(0b101101) + chr(56)))([Ge7qqaux3bQW])
roI3spqORKae(NcsybIE2o3mI, roI3spqORKae(ES5oEprVxulp(b'\xc3h\x88\xe4\xe8\r)l\xc4\xa1\xf9!'), chr(0b100000 + 0o104) + chr(9094 - 8993) + chr(9556 - 9457) + '\157' + chr(0b111000 + 0o54) + chr(0b1100101))('\x75' + '\164' + chr(7810 - 7708) + '\055' + chr(2021 - 1965)))(sQSWKlURp7QK)
else:
F9lJ8RbIonqb = GmJYyzXaQAzC.uC_Yoybx7J0I()
GmJYyzXaQAzC[-nzTpIcepk0o8(chr(0b1011 + 0o45) + '\157' + chr(49), 8)][-nzTpIcepk0o8(chr(48) + '\x6f' + chr(1360 - 1311), 8)][roI3spqORKae(ES5oEprVxulp(b'\xf8Y\xb8\xa4\xf9\x05\x00p'), chr(0b101100 + 0o70) + chr(0b1000110 + 0o37) + '\143' + chr(111) + '\144' + '\145')('\x75' + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b111000))] = F9lJ8RbIonqb
roI3spqORKae(NcsybIE2o3mI, roI3spqORKae(ES5oEprVxulp(b'\xfe\x7f\x84\x89\xff\x13\x0c{\x99\x84\x9c]'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b1100101 + 0o12) + chr(0b1100100) + chr(0b1111 + 0o126))('\x75' + chr(116) + chr(6390 - 6288) + '\x2d' + '\070'))()
continue
IGIA_fu6MbaO += nzTpIcepk0o8(chr(1249 - 1201) + '\157' + chr(49), 8)
while ftfygxgFas5X(GmJYyzXaQAzC) > nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001), 8):
F9lJ8RbIonqb = GmJYyzXaQAzC.uC_Yoybx7J0I()
GmJYyzXaQAzC[-nzTpIcepk0o8('\060' + '\157' + chr(1450 - 1401), 8)][-nzTpIcepk0o8('\060' + chr(12284 - 12173) + chr(49), 8)][roI3spqORKae(ES5oEprVxulp(b'\xf8Y\xb8\xa4\xf9\x05\x00p'), chr(100) + chr(0b1100101) + '\143' + '\157' + chr(0b1100100) + chr(1608 - 1507))('\x75' + chr(0b1110100) + chr(102) + chr(0b11101 + 0o20) + chr(2963 - 2907))] = F9lJ8RbIonqb
GmJYyzXaQAzC = GmJYyzXaQAzC[nzTpIcepk0o8(chr(482 - 434) + '\157' + '\060', 8)]
return GmJYyzXaQAzC
|
estnltk/estnltk
|
estnltk/textcleaner.py
|
TextCleaner.clean
|
def clean(self, text):
"""Remove all unwanted characters from text."""
return ''.join([c for c in text if c in self.alphabet])
|
python
|
def clean(self, text):
"""Remove all unwanted characters from text."""
return ''.join([c for c in text if c in self.alphabet])
|
[
"def",
"clean",
"(",
"self",
",",
"text",
")",
":",
"return",
"''",
".",
"join",
"(",
"[",
"c",
"for",
"c",
"in",
"text",
"if",
"c",
"in",
"self",
".",
"alphabet",
"]",
")"
] |
Remove all unwanted characters from text.
|
[
"Remove",
"all",
"unwanted",
"characters",
"from",
"text",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a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ZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\x6f' + '\x33' + '\x35' + '\x34', 0b1000), nzTpIcepk0o8(chr(0b100101 + 0o13) + chr(0b1101111) + chr(0b100011 + 0o24) + '\x30', 0b1000), nzTpIcepk0o8('\060' + chr(1035 - 924) + chr(0b110001 + 0o2) + '\x32' + chr(768 - 715), 0b1000), nzTpIcepk0o8(chr(849 - 801) + chr(111) + chr(0b10 + 0o57) + chr(0b110101) + chr(0b110110), 12907 - 12899), nzTpIcepk0o8(chr(1970 - 1922) + chr(0b10011 + 0o134) + chr(0b1010 + 0o55) + chr(1507 - 1452), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1001101 + 0o42) + '\061' + '\x30', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(51) + chr(49) + '\x35', 3444 - 3436), nzTpIcepk0o8(chr(48) + '\157' + '\x33' + '\x34' + chr(2379 - 2330), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1000100 + 0o53) + chr(0b110001) + chr(2194 - 2145) + chr(0b110 + 0o55), 0o10), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(467 - 414) + '\x33', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1399 - 1350) + chr(52) + chr(0b10101 + 0o36), 0o10), nzTpIcepk0o8(chr(2190 - 2142) + chr(10782 - 10671) + chr(873 - 825), 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110110) + chr(1268 - 1215), 0o10), nzTpIcepk0o8(chr(48) + chr(9298 - 9187) + '\061' + chr(50) + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(1097 - 1044) + chr(752 - 703), 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\062' + '\x36' + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + chr(7353 - 7242) + '\x32' + chr(2176 - 2121) + chr(49), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b110000 + 0o77) + chr(51) + chr(0b100 + 0o62) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + chr(456 - 406) + chr(0b110010) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1001 + 0o146) + '\061' + '\x35' + chr(52), 65034 - 65026), nzTpIcepk0o8(chr(48) + '\157' + chr(50) + '\x32' + '\x37', 41901 - 41893), nzTpIcepk0o8('\060' + chr(0b111110 + 0o61) + chr(0b11 + 0o56) + chr(53) + '\066', 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1000101 + 0o52) + '\062' + '\x31' + '\063', 0b1000), nzTpIcepk0o8(chr(934 - 886) + chr(0b1010111 + 0o30) + chr(0b110011) + chr(0b110010) + chr(51), 39868 - 39860), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110011) + '\x37' + chr(1975 - 1926), 0o10), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b0 + 0o62) + chr(0b101010 + 0o14), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1582 - 1533) + '\x35', 26980 - 26972), nzTpIcepk0o8(chr(0b101111 + 0o1) + chr(0b1101101 + 0o2) + '\061' + chr(0b110000), 8), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b10 + 0o64) + chr(0b110 + 0o52), 65462 - 65454), nzTpIcepk0o8(chr(48) + chr(0b0 + 0o157) + chr(0b100100 + 0o17) + '\063' + '\067', 22683 - 22675), nzTpIcepk0o8('\x30' + '\x6f' + chr(50) + chr(0b110111) + chr(48), 0b1000), nzTpIcepk0o8(chr(1644 - 1596) + chr(111) + chr(55) + chr(48), 8), nzTpIcepk0o8(chr(1144 - 1096) + chr(0b1101111) + chr(0b110010) + chr(0b110001) + chr(51), 8), nzTpIcepk0o8('\060' + chr(111) + chr(0b110011) + chr(48) + chr(0b110010 + 0o5), 0o10), nzTpIcepk0o8('\060' + chr(7907 - 7796) + '\x31' + chr(1346 - 1292) + '\x37', 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(49) + chr(51) + chr(0b110011), 0b1000), nzTpIcepk0o8(chr(443 - 395) + chr(111) + chr(0b110001), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(168 - 118) + '\x31' + chr(50), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(5276 - 5165) + chr(697 - 648) + '\x36' + '\063', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\067' + chr(48), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(111) + '\065' + chr(0b10000 + 0o40), 61214 - 61206)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xc2'), chr(4991 - 4891) + chr(1879 - 1778) + chr(0b111000 + 0o53) + chr(0b1010100 + 0o33) + chr(0b1000110 + 0o36) + '\145')(chr(117) + '\164' + chr(0b1100110) + chr(0b101100 + 0o1) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def MY03ioefkAzT(hXMPsSrOQzbh, cpStk7cY1TJd):
return roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b''), chr(0b1100100) + chr(0b1100101) + chr(489 - 390) + chr(0b1010001 + 0o36) + '\144' + '\x65')(chr(0b1110101) + chr(4516 - 4400) + chr(102) + chr(0b101101) + '\070'), roI3spqORKae(ES5oEprVxulp(b'\xb5\x0c\xac#\x06J\xae\x87\x1f(-q'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + chr(100) + chr(0b1100101))(chr(0b100 + 0o161) + '\164' + chr(7764 - 7662) + chr(45) + '\070'))([teUmM7cKWZUa for teUmM7cKWZUa in cpStk7cY1TJd if teUmM7cKWZUa in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\x9c`\xe5\x14v\x7f\x80\x99\r\x00&l'), chr(100) + chr(101) + chr(2612 - 2513) + '\x6f' + chr(100) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(45) + '\070'))])
|
estnltk/estnltk
|
estnltk/textcleaner.py
|
TextCleaner.invalid_characters
|
def invalid_characters(self, text):
"""Give simple list of invalid characters present in text."""
return ''.join(sorted(set([c for c in text if c not in self.alphabet])))
|
python
|
def invalid_characters(self, text):
"""Give simple list of invalid characters present in text."""
return ''.join(sorted(set([c for c in text if c not in self.alphabet])))
|
[
"def",
"invalid_characters",
"(",
"self",
",",
"text",
")",
":",
"return",
"''",
".",
"join",
"(",
"sorted",
"(",
"set",
"(",
"[",
"c",
"for",
"c",
"in",
"text",
"if",
"c",
"not",
"in",
"self",
".",
"alphabet",
"]",
")",
")",
")"
] |
Give simple list of invalid characters present in text.
|
[
"Give",
"simple",
"list",
"of",
"invalid",
"characters",
"present",
"in",
"text",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/textcleaner.py#L49-L51
|
train
|
Give simple list of invalid characters present in text.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bI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nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + '\x6f' + chr(1013 - 962) + '\060' + chr(0b101011 + 0o12), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b11100 + 0o26) + '\x36', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(50), 0o10), nzTpIcepk0o8(chr(2019 - 1971) + chr(0b1101111) + chr(1260 - 1209) + '\063' + chr(2700 - 2645), 56605 - 56597), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110011) + chr(870 - 816) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(7412 - 7301) + chr(2440 - 2390) + '\x36' + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\x6f' + chr(49) + chr(2600 - 2546) + '\x35', ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + '\x31' + '\067', 0b1000), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(0b1101111) + '\x37', 0o10), nzTpIcepk0o8(chr(1171 - 1123) + '\x6f' + chr(0b100101 + 0o20) + chr(50), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110001) + chr(848 - 797) + '\x30', 0o10), nzTpIcepk0o8('\x30' + chr(0b1100011 + 0o14) + '\061' + '\x32' + '\x30', 0b1000), nzTpIcepk0o8('\x30' + chr(0b101100 + 0o103) + '\061' + '\065' + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(1089 - 1038) + '\x33' + chr(927 - 876), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101001 + 0o6) + chr(0b1111 + 0o43) + chr(0b110001) + '\066', ord("\x08")), nzTpIcepk0o8(chr(0b100011 + 0o15) + chr(111) + '\063' + '\x33', 0b1000), nzTpIcepk0o8('\060' + chr(0b11011 + 0o124) + chr(444 - 395) + '\x36' + '\x30', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b110010) + chr(578 - 525) + chr(1859 - 1811), 53284 - 53276), nzTpIcepk0o8(chr(269 - 221) + chr(0b1101111) + '\063' + chr(0b110001), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(655 - 604), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(0b110 + 0o54) + chr(2520 - 2469) + '\063', 29566 - 29558), nzTpIcepk0o8(chr(0b110000) + chr(0b111 + 0o150) + '\061' + '\x37', ord("\x08")), nzTpIcepk0o8(chr(1639 - 1591) + '\157' + chr(0b10101 + 0o36) + chr(0b110100), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x33' + '\064' + chr(1563 - 1509), 5946 - 5938), nzTpIcepk0o8(chr(0b101011 + 0o5) + chr(7922 - 7811) + '\063' + '\x34' + chr(48), 0o10), nzTpIcepk0o8(chr(2278 - 2230) + chr(861 - 750) + chr(0b1001 + 0o54) + chr(0b110000), 20461 - 20453), nzTpIcepk0o8(chr(0b100100 + 0o14) + '\157' + chr(0b1100 + 0o46) + chr(49) + '\x30', 0o10), nzTpIcepk0o8(chr(48) + chr(0b111101 + 0o62) + chr(0b110010) + chr(0b101111 + 0o5) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\062' + '\x33' + '\x37', 0o10), nzTpIcepk0o8(chr(1700 - 1652) + '\157' + '\066' + chr(0b11111 + 0o27), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(704 - 593) + '\062' + '\062' + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(208 - 159) + '\x30' + chr(51), 0b1000), nzTpIcepk0o8(chr(0b100111 + 0o11) + '\x6f' + '\x32' + '\066' + chr(48), 8), nzTpIcepk0o8('\x30' + '\157' + chr(50) + chr(55), 0b1000), nzTpIcepk0o8(chr(1503 - 1455) + chr(2305 - 2194) + chr(0b110011) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(1985 - 1937) + '\157' + '\x32' + '\x37' + chr(1746 - 1695), 0b1000), nzTpIcepk0o8(chr(1482 - 1434) + chr(8004 - 7893) + '\061' + '\x30' + chr(50), 0b1000), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\157' + '\x33' + '\064' + chr(55), 0o10), nzTpIcepk0o8(chr(170 - 122) + chr(111) + '\062' + chr(48) + '\061', 0o10), nzTpIcepk0o8(chr(1137 - 1089) + chr(0b1101111) + '\x35' + '\063', 44183 - 44175)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(3235 - 3124) + '\x35' + chr(2302 - 2254), 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xeb'), chr(0b1000001 + 0o43) + '\145' + '\x63' + chr(111) + '\x64' + chr(0b111 + 0o136))(chr(0b10101 + 0o140) + chr(5274 - 5158) + '\x66' + chr(0b11101 + 0o20) + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def qTxIj04R8CNu(hXMPsSrOQzbh, cpStk7cY1TJd):
return roI3spqORKae(roI3spqORKae(ES5oEprVxulp(b''), '\144' + '\x65' + '\143' + chr(0b101111 + 0o100) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1110011 + 0o1) + '\146' + '\055' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\x9c"{\x92\xcc\xf2\x16\xa9Si\x16!'), '\x64' + chr(101) + chr(0b1100011) + chr(8093 - 7982) + '\144' + chr(0b1100101))('\x75' + chr(6355 - 6239) + chr(0b1100100 + 0o2) + chr(45) + '\070'))(V3OlOVg98A85(Bvi71nNyvlqO([teUmM7cKWZUa for teUmM7cKWZUa in cpStk7cY1TJd if teUmM7cKWZUa not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xb5N2\xa5\xbc\xc78\xb7AA\x1d<'), chr(0b10101 + 0o117) + '\145' + chr(99) + chr(111) + '\x64' + '\145')('\x75' + '\164' + chr(0b1100110) + chr(45) + chr(905 - 849)))])))
|
estnltk/estnltk
|
estnltk/textcleaner.py
|
TextCleaner.find_invalid_chars
|
def find_invalid_chars(self, text, context_size=20):
"""Find invalid characters in text and store information about
the findings.
Parameters
----------
context_size: int
How many characters to return as the context.
"""
result = defaultdict(list)
for idx, char in enumerate(text):
if char not in self.alphabet:
start = max(0, idx-context_size)
end = min(len(text), idx+context_size)
result[char].append(text[start:end])
return result
|
python
|
def find_invalid_chars(self, text, context_size=20):
"""Find invalid characters in text and store information about
the findings.
Parameters
----------
context_size: int
How many characters to return as the context.
"""
result = defaultdict(list)
for idx, char in enumerate(text):
if char not in self.alphabet:
start = max(0, idx-context_size)
end = min(len(text), idx+context_size)
result[char].append(text[start:end])
return result
|
[
"def",
"find_invalid_chars",
"(",
"self",
",",
"text",
",",
"context_size",
"=",
"20",
")",
":",
"result",
"=",
"defaultdict",
"(",
"list",
")",
"for",
"idx",
",",
"char",
"in",
"enumerate",
"(",
"text",
")",
":",
"if",
"char",
"not",
"in",
"self",
".",
"alphabet",
":",
"start",
"=",
"max",
"(",
"0",
",",
"idx",
"-",
"context_size",
")",
"end",
"=",
"min",
"(",
"len",
"(",
"text",
")",
",",
"idx",
"+",
"context_size",
")",
"result",
"[",
"char",
"]",
".",
"append",
"(",
"text",
"[",
"start",
":",
"end",
"]",
")",
"return",
"result"
] |
Find invalid characters in text and store information about
the findings.
Parameters
----------
context_size: int
How many characters to return as the context.
|
[
"Find",
"invalid",
"characters",
"in",
"text",
"and",
"store",
"information",
"about",
"the",
"findings",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/textcleaner.py#L53-L69
|
train
|
Find invalid characters in text and store information about them.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204H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y2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(0b11110 + 0o24) + chr(0b11111 + 0o27) + chr(52), 21839 - 21831), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(1309 - 1259) + chr(0b1010 + 0o55) + chr(205 - 150), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b111011 + 0o64) + '\x31' + '\x32' + chr(0b110001), 0o10), nzTpIcepk0o8('\x30' + chr(4195 - 4084) + chr(50) + '\063' + '\067', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\061' + chr(0b110101) + chr(52), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(7966 - 7855) + '\062' + chr(51) + chr(0b101101 + 0o6), 0b1000), nzTpIcepk0o8('\060' + '\157' + '\x32' + chr(50) + chr(0b11011 + 0o33), 44706 - 44698), nzTpIcepk0o8(chr(0b101001 + 0o7) + '\157' + chr(2042 - 1987) + '\061', 0o10), nzTpIcepk0o8('\060' + chr(0b1000 + 0o147) + '\x31' + '\065', 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110010) + chr(489 - 437) + chr(2037 - 1988), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(1606 - 1556) + chr(1973 - 1923) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(549 - 501) + chr(0b1101111) + '\x37' + '\065', 0b1000), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(11161 - 11050) + chr(50) + chr(0b11111 + 0o27) + chr(0b110100 + 0o0), 8), nzTpIcepk0o8('\060' + chr(3051 - 2940) + chr(50), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + chr(425 - 375) + chr(0b110101) + chr(2222 - 2172), 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b100000 + 0o21), ord("\x08")), nzTpIcepk0o8(chr(1401 - 1353) + '\157' + chr(0b10100 + 0o37) + '\063', 0o10), nzTpIcepk0o8('\060' + '\x6f' + '\061' + '\062' + chr(0b110001), 8), nzTpIcepk0o8(chr(0b100000 + 0o20) + chr(111) + chr(51) + chr(1275 - 1220) + chr(49), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + '\062' + '\x35', 19695 - 19687), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(0b110111) + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(0b100100 + 0o14) + chr(111) + chr(0b110010) + chr(48) + chr(52), 0o10), nzTpIcepk0o8(chr(0b1000 + 0o50) + '\x6f' + chr(49) + chr(0b110111) + chr(0b110000), 0o10), nzTpIcepk0o8(chr(71 - 23) + chr(0b1101111) + chr(1713 - 1664) + chr(1509 - 1460), 0o10), nzTpIcepk0o8(chr(0b11110 + 0o22) + chr(6389 - 6278) + '\x32' + chr(51) + chr(348 - 300), 4626 - 4618), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(0b110001) + '\x34', 0o10), nzTpIcepk0o8('\060' + chr(1977 - 1866) + '\x33' + '\x32' + chr(0b101011 + 0o6), 0o10), nzTpIcepk0o8('\x30' + chr(0b1100001 + 0o16) + chr(50) + chr(0b10111 + 0o32) + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1001011 + 0o44) + '\063' + chr(0b100 + 0o63) + chr(652 - 599), 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\067' + '\x35', 8), nzTpIcepk0o8(chr(0b10101 + 0o33) + '\157' + chr(51) + chr(52) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(48) + chr(111) + chr(2227 - 2176) + '\065' + '\x31', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b1011 + 0o47) + chr(0b110000) + '\064', 8), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(50) + chr(0b101101 + 0o10), ord("\x08")), nzTpIcepk0o8('\060' + chr(6446 - 6335) + chr(0b100000 + 0o21) + '\061' + chr(592 - 542), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + chr(0b10011 + 0o44) + chr(2925 - 2870), 0o10), nzTpIcepk0o8(chr(2097 - 2049) + chr(0b1101111) + chr(0b110 + 0o54) + chr(0b11111 + 0o22) + chr(0b110110), ord("\x08")), nzTpIcepk0o8(chr(1612 - 1564) + chr(0b1101111) + chr(0b100011 + 0o20) + chr(0b110100) + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + chr(111) + chr(142 - 92) + chr(0b110001) + chr(0b110101), 8), nzTpIcepk0o8(chr(0b1111 + 0o41) + '\x6f' + chr(0b110001) + chr(0b110101) + chr(1496 - 1446), 32814 - 32806)][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b1101111) + chr(641 - 588) + '\x30', 57548 - 57540)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x9a'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b100001 + 0o103) + chr(1198 - 1097))('\165' + chr(116) + chr(2856 - 2754) + '\x2d' + chr(0b101010 + 0o16)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Gfcot6ryTtZO(hXMPsSrOQzbh, cpStk7cY1TJd, cRf1yisHAXze=nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(6713 - 6602) + chr(0b110010) + chr(301 - 249), 0o10)):
POx95m7SPOVy = mM1QxhFYKsbc(H4NoA26ON7iG)
for (At3kbMoXzzmV, JZZiMnH571E1) in _kV_Bomx8PZ4(cpStk7cY1TJd):
if JZZiMnH571E1 not in roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xc4\xe7a\xe5%\xec\xdbAK\xca\xd1Q'), chr(0b1100100) + chr(4660 - 4559) + '\x63' + chr(0b1101111) + '\144' + '\145')('\x75' + chr(7397 - 7281) + chr(102) + '\x2d' + chr(535 - 479))):
KQbHFTcl_LKy = KV9ckIhroIia(nzTpIcepk0o8(chr(825 - 777) + chr(0b1101111) + chr(0b11 + 0o55), 32533 - 32525), At3kbMoXzzmV - cRf1yisHAXze)
NiWVjAWn0l6T = XURpmPuEWCNF(ftfygxgFas5X(cpStk7cY1TJd), At3kbMoXzzmV + cRf1yisHAXze)
roI3spqORKae(POx95m7SPOVy[JZZiMnH571E1], roI3spqORKae(ES5oEprVxulp(b'\xfc\xeb\x02\xab\x14\xfc\xd1Vg\xce\xc1\x08'), chr(448 - 348) + '\x65' + chr(0b1100011) + '\157' + chr(0b1100100) + chr(6194 - 6093))(chr(117) + chr(116) + '\146' + chr(45) + '\070'))(cpStk7cY1TJd[KQbHFTcl_LKy:NiWVjAWn0l6T])
return POx95m7SPOVy
|
estnltk/estnltk
|
estnltk/textcleaner.py
|
TextCleaner.compute_report
|
def compute_report(self, texts, context_size=10):
"""Compute statistics of invalid characters on given texts.
Parameters
----------
texts: list of str
The texts to search for invalid characters.
context_size: int
How many characters to return as the context.
Returns
-------
dict of (char -> list of tuple (index, context))
Returns a dictionary, where keys are invalid characters.
Values are lists containign tuples with character indices
and context strings.
"""
result = defaultdict(list)
for text in texts:
for char, examples in self.find_invalid_chars(text, context_size).items():
result[char].extend(examples)
return result
|
python
|
def compute_report(self, texts, context_size=10):
"""Compute statistics of invalid characters on given texts.
Parameters
----------
texts: list of str
The texts to search for invalid characters.
context_size: int
How many characters to return as the context.
Returns
-------
dict of (char -> list of tuple (index, context))
Returns a dictionary, where keys are invalid characters.
Values are lists containign tuples with character indices
and context strings.
"""
result = defaultdict(list)
for text in texts:
for char, examples in self.find_invalid_chars(text, context_size).items():
result[char].extend(examples)
return result
|
[
"def",
"compute_report",
"(",
"self",
",",
"texts",
",",
"context_size",
"=",
"10",
")",
":",
"result",
"=",
"defaultdict",
"(",
"list",
")",
"for",
"text",
"in",
"texts",
":",
"for",
"char",
",",
"examples",
"in",
"self",
".",
"find_invalid_chars",
"(",
"text",
",",
"context_size",
")",
".",
"items",
"(",
")",
":",
"result",
"[",
"char",
"]",
".",
"extend",
"(",
"examples",
")",
"return",
"result"
] |
Compute statistics of invalid characters on given texts.
Parameters
----------
texts: list of str
The texts to search for invalid characters.
context_size: int
How many characters to return as the context.
Returns
-------
dict of (char -> list of tuple (index, context))
Returns a dictionary, where keys are invalid characters.
Values are lists containign tuples with character indices
and context strings.
|
[
"Compute",
"statistics",
"of",
"invalid",
"characters",
"on",
"given",
"texts",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/textcleaner.py#L71-L92
|
train
|
Compute statistics of invalid characters on given texts.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,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Rf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + chr(0b110101) + chr(916 - 866), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1111 + 0o140) + '\x33' + '\x30' + chr(0b101001 + 0o12), 0b1000), nzTpIcepk0o8(chr(48) + chr(11837 - 11726) + chr(546 - 496) + chr(0b110101) + chr(49), 0b1000), nzTpIcepk0o8(chr(544 - 496) + '\x6f' + chr(0b111 + 0o52) + chr(1796 - 1742) + '\065', 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110010) + '\x36' + chr(1358 - 1308), 16755 - 16747), nzTpIcepk0o8(chr(48) + chr(10208 - 10097) + chr(51) + chr(0b110110) + chr(0b11101 + 0o31), ord("\x08")), nzTpIcepk0o8('\060' + chr(4198 - 4087) + chr(0b110001) + chr(795 - 745) + chr(536 - 487), 30055 - 30047), nzTpIcepk0o8('\060' + '\157' + chr(51) + chr(0b101000 + 0o17) + '\x30', 0b1000), nzTpIcepk0o8(chr(1066 - 1018) + '\x6f' + chr(0b110011) + '\x31', ord("\x08")), nzTpIcepk0o8('\x30' + chr(12087 - 11976) + '\061' + chr(1148 - 1093) + chr(0b110110), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110010) + chr(0b110010) + '\x35', 31014 - 31006), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10001 + 0o41) + chr(0b1101 + 0o45) + chr(52), 29004 - 28996), nzTpIcepk0o8('\060' + chr(111) + chr(696 - 645) + chr(0b101000 + 0o17) + '\066', 16187 - 16179), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b10 + 0o57) + chr(54), 56709 - 56701), nzTpIcepk0o8(chr(510 - 462) + chr(0b11111 + 0o120) + chr(1910 - 1859) + chr(0b110011) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(103 - 55) + chr(8810 - 8699) + '\x31' + '\x32' + chr(0b11011 + 0o26), 8), nzTpIcepk0o8(chr(0b100010 + 0o16) + chr(0b1000010 + 0o55) + chr(0b11000 + 0o33) + chr(0b110101), 0o10), nzTpIcepk0o8(chr(254 - 206) + chr(8946 - 8835) + chr(2316 - 2265) + '\x34' + '\063', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(54) + '\064', ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\067' + chr(2100 - 2046), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b110111 + 0o70) + '\062' + chr(83 - 35) + chr(0b11010 + 0o31), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\062' + '\x34' + chr(0b110110), 0b1000), nzTpIcepk0o8(chr(0b101000 + 0o10) + '\x6f' + chr(0b110011) + '\x30' + '\x34', ord("\x08")), nzTpIcepk0o8('\x30' + chr(11480 - 11369) + '\065' + chr(50), ord("\x08")), nzTpIcepk0o8('\060' + '\x6f' + '\063' + '\x32' + chr(1425 - 1375), 20274 - 20266), nzTpIcepk0o8(chr(48) + chr(0b1001 + 0o146) + chr(2910 - 2856) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + chr(0b110010 + 0o1) + '\x33' + chr(0b110000), 63000 - 62992), nzTpIcepk0o8(chr(2025 - 1977) + chr(0b1101111) + '\x33' + chr(736 - 683) + chr(48), ord("\x08")), nzTpIcepk0o8('\060' + chr(10517 - 10406) + chr(52) + '\x31', 0o10), nzTpIcepk0o8(chr(1832 - 1784) + chr(9934 - 9823) + chr(49) + '\067' + chr(2245 - 2194), 0o10), nzTpIcepk0o8('\x30' + chr(111) + chr(0b110010) + chr(55) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b1100 + 0o47) + chr(0b101110 + 0o3), 8), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b11001 + 0o32) + '\x33' + '\062', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(11542 - 11431) + chr(0b1110 + 0o45) + '\061' + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b100101 + 0o16) + chr(51) + chr(0b110000), 8), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + chr(50) + '\x35' + chr(49), 8), nzTpIcepk0o8(chr(0b1100 + 0o44) + chr(111) + chr(0b110011) + chr(2465 - 2410), 0o10), nzTpIcepk0o8(chr(1918 - 1870) + '\x6f' + '\x32' + '\066' + '\060', 49612 - 49604), nzTpIcepk0o8(chr(2101 - 2053) + chr(0b1101111) + chr(0b100011 + 0o23) + chr(48), 31707 - 31699), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + '\x34' + chr(931 - 879), 0o10)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(11428 - 11317) + chr(380 - 327) + '\x30', 561 - 553)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'D'), chr(100) + chr(5823 - 5722) + '\143' + chr(0b1011010 + 0o25) + '\144' + chr(0b1100101))('\165' + '\x74' + chr(4506 - 4404) + '\x2d' + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def Cgh0tvTO_nlR(hXMPsSrOQzbh, p5gYIeSVE6xX, cRf1yisHAXze=nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x31' + chr(0b110010), 0o10)):
POx95m7SPOVy = mM1QxhFYKsbc(H4NoA26ON7iG)
for cpStk7cY1TJd in p5gYIeSVE6xX:
for (JZZiMnH571E1, BnqHauOFE9Uy) in roI3spqORKae(hXMPsSrOQzbh.find_invalid_chars(cpStk7cY1TJd, cRf1yisHAXze), roI3spqORKae(ES5oEprVxulp(b'3\x9c\xc7;\xf7\x8c\x19\xcc*\x08\xcd\xfd'), chr(0b1100100) + '\x65' + chr(0b1010110 + 0o15) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(5551 - 5434) + chr(1902 - 1786) + chr(0b1100110) + chr(654 - 609) + chr(56)))():
roI3spqORKae(POx95m7SPOVy[JZZiMnH571E1], roI3spqORKae(ES5oEprVxulp(b'>\x9c\x9a8\xdd\x92\x1d\xafF<\xf7\xe5'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1011111 + 0o6))(chr(0b1110000 + 0o5) + chr(9392 - 9276) + chr(8900 - 8798) + chr(0b100011 + 0o12) + chr(0b111000)))(BnqHauOFE9Uy)
return POx95m7SPOVy
|
estnltk/estnltk
|
estnltk/textcleaner.py
|
TextCleaner.report
|
def report(self, texts, n_examples=10, context_size=10, f=sys.stdout):
"""Compute statistics of invalid characters and print them.
Parameters
----------
texts: list of str
The texts to search for invalid characters.
n_examples: int
How many examples to display per invalid character.
context_size: int
How many characters to return as the context.
f: file
The file to print the report (default is sys.stdout)
"""
result = list(self.compute_report(texts, context_size).items())
result.sort(key=lambda x: (len(x[1]), x[0]), reverse=True)
s = 'Analyzed {0} texts.\n'.format(len(texts))
if (len(texts)) == 0:
f.write(s)
return
if len(result) > 0:
s += 'Invalid characters and their counts:\n'
for c, examples in result:
s += '"{0}"\t{1}\n'.format(c, len(examples))
s += '\n'
for c, examples in result:
s += 'For character "{0}", found {1} occurrences.\nExamples:\n'.format(c, len(examples))
examples = sample(examples, min(len(examples), n_examples))
for idx, example in enumerate(examples):
s += 'example {0}: {1}\n'.format(idx+1, example)
s += '\n'
f.write(s)
else:
f.write('All OK\n')
|
python
|
def report(self, texts, n_examples=10, context_size=10, f=sys.stdout):
"""Compute statistics of invalid characters and print them.
Parameters
----------
texts: list of str
The texts to search for invalid characters.
n_examples: int
How many examples to display per invalid character.
context_size: int
How many characters to return as the context.
f: file
The file to print the report (default is sys.stdout)
"""
result = list(self.compute_report(texts, context_size).items())
result.sort(key=lambda x: (len(x[1]), x[0]), reverse=True)
s = 'Analyzed {0} texts.\n'.format(len(texts))
if (len(texts)) == 0:
f.write(s)
return
if len(result) > 0:
s += 'Invalid characters and their counts:\n'
for c, examples in result:
s += '"{0}"\t{1}\n'.format(c, len(examples))
s += '\n'
for c, examples in result:
s += 'For character "{0}", found {1} occurrences.\nExamples:\n'.format(c, len(examples))
examples = sample(examples, min(len(examples), n_examples))
for idx, example in enumerate(examples):
s += 'example {0}: {1}\n'.format(idx+1, example)
s += '\n'
f.write(s)
else:
f.write('All OK\n')
|
[
"def",
"report",
"(",
"self",
",",
"texts",
",",
"n_examples",
"=",
"10",
",",
"context_size",
"=",
"10",
",",
"f",
"=",
"sys",
".",
"stdout",
")",
":",
"result",
"=",
"list",
"(",
"self",
".",
"compute_report",
"(",
"texts",
",",
"context_size",
")",
".",
"items",
"(",
")",
")",
"result",
".",
"sort",
"(",
"key",
"=",
"lambda",
"x",
":",
"(",
"len",
"(",
"x",
"[",
"1",
"]",
")",
",",
"x",
"[",
"0",
"]",
")",
",",
"reverse",
"=",
"True",
")",
"s",
"=",
"'Analyzed {0} texts.\\n'",
".",
"format",
"(",
"len",
"(",
"texts",
")",
")",
"if",
"(",
"len",
"(",
"texts",
")",
")",
"==",
"0",
":",
"f",
".",
"write",
"(",
"s",
")",
"return",
"if",
"len",
"(",
"result",
")",
">",
"0",
":",
"s",
"+=",
"'Invalid characters and their counts:\\n'",
"for",
"c",
",",
"examples",
"in",
"result",
":",
"s",
"+=",
"'\"{0}\"\\t{1}\\n'",
".",
"format",
"(",
"c",
",",
"len",
"(",
"examples",
")",
")",
"s",
"+=",
"'\\n'",
"for",
"c",
",",
"examples",
"in",
"result",
":",
"s",
"+=",
"'For character \"{0}\", found {1} occurrences.\\nExamples:\\n'",
".",
"format",
"(",
"c",
",",
"len",
"(",
"examples",
")",
")",
"examples",
"=",
"sample",
"(",
"examples",
",",
"min",
"(",
"len",
"(",
"examples",
")",
",",
"n_examples",
")",
")",
"for",
"idx",
",",
"example",
"in",
"enumerate",
"(",
"examples",
")",
":",
"s",
"+=",
"'example {0}: {1}\\n'",
".",
"format",
"(",
"idx",
"+",
"1",
",",
"example",
")",
"s",
"+=",
"'\\n'",
"f",
".",
"write",
"(",
"s",
")",
"else",
":",
"f",
".",
"write",
"(",
"'All OK\\n'",
")"
] |
Compute statistics of invalid characters and print them.
Parameters
----------
texts: list of str
The texts to search for invalid characters.
n_examples: int
How many examples to display per invalid character.
context_size: int
How many characters to return as the context.
f: file
The file to print the report (default is sys.stdout)
|
[
"Compute",
"statistics",
"of",
"invalid",
"characters",
"and",
"print",
"them",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/textcleaner.py#L94-L128
|
train
|
Compute statistics of invalid characters and print them.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS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PipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\x30' + chr(111) + '\062' + '\067' + '\x34', 0b1000), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + chr(0b110011) + chr(0b101011 + 0o12) + chr(121 - 73), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(111) + '\x32' + chr(1262 - 1208) + chr(2471 - 2418), 0o10), nzTpIcepk0o8(chr(48) + chr(2286 - 2175) + chr(602 - 552) + chr(55) + '\x31', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(50) + chr(0b110001) + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110001 + 0o0) + chr(0b10 + 0o65) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(1914 - 1866) + '\x6f' + chr(0b110100) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(875 - 827) + '\157' + chr(1655 - 1605) + chr(0b110101) + '\063', 19289 - 19281), nzTpIcepk0o8(chr(793 - 745) + chr(111) + chr(0b101100 + 0o7) + '\067' + chr(620 - 571), 0b1000), nzTpIcepk0o8(chr(1708 - 1660) + chr(0b1101111) + chr(0b110010) + chr(348 - 299) + chr(0b101000 + 0o10), 0o10), nzTpIcepk0o8(chr(321 - 273) + '\157' + '\x34' + chr(0b110101), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49) + chr(0b1000 + 0o57) + chr(422 - 374), ord("\x08")), nzTpIcepk0o8(chr(499 - 451) + '\x6f' + '\063' + chr(49), 0o10), nzTpIcepk0o8('\x30' + '\157' + chr(0b110011) + chr(51) + '\066', 0o10), nzTpIcepk0o8('\x30' + chr(0b11111 + 0o120) + '\063' + chr(0b110111) + chr(0b11001 + 0o34), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1100101 + 0o12) + '\x33' + '\066' + chr(1690 - 1640), 0b1000), nzTpIcepk0o8(chr(1161 - 1113) + chr(0b10110 + 0o131) + chr(920 - 865) + '\063', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + '\x34' + chr(0b110101), ord("\x08")), nzTpIcepk0o8(chr(1447 - 1399) + '\157' + '\064' + chr(2080 - 2025), 0b1000), nzTpIcepk0o8('\x30' + chr(3571 - 3460) + '\061' + chr(741 - 688) + chr(2037 - 1986), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b11001 + 0o36) + chr(55), 0b1000), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b10111 + 0o32) + chr(0b1101 + 0o52) + chr(0b111 + 0o60), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(6562 - 6451) + '\062' + '\x32' + chr(2886 - 2831), 26426 - 26418), nzTpIcepk0o8(chr(0b110000) + chr(7870 - 7759) + chr(0b110001) + chr(2017 - 1968) + '\064', 0o10), nzTpIcepk0o8(chr(973 - 925) + chr(111) + chr(2172 - 2122) + chr(785 - 734) + chr(1032 - 979), 24369 - 24361), nzTpIcepk0o8('\060' + '\x6f' + chr(0b110011) + chr(0b110 + 0o57) + chr(129 - 79), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b110010) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b101011 + 0o5) + '\x6f' + chr(0b101110 + 0o5) + chr(0b10001 + 0o41) + chr(0b10111 + 0o35), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110011) + '\x30' + chr(50), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b110010 + 0o75) + chr(0b110001) + '\x32' + chr(0b110011), 0o10), nzTpIcepk0o8(chr(48) + chr(0b11000 + 0o127) + '\061' + chr(51) + '\062', 0b1000), nzTpIcepk0o8(chr(659 - 611) + '\x6f' + '\061' + chr(2782 - 2728), 0b1000), nzTpIcepk0o8('\060' + chr(0b1100110 + 0o11) + chr(50) + '\x33' + '\063', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(0b11100 + 0o25) + '\x35' + chr(3025 - 2970), 0o10), nzTpIcepk0o8(chr(48) + chr(8651 - 8540) + '\065' + chr(2079 - 2031), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1011 + 0o47) + chr(1213 - 1165) + chr(357 - 308), 35883 - 35875), nzTpIcepk0o8('\060' + chr(111) + chr(0b100000 + 0o23) + chr(0b110010) + chr(49), 0b1000), nzTpIcepk0o8(chr(0b1010 + 0o46) + '\x6f' + chr(0b110001) + '\x32' + chr(2080 - 2029), 8), nzTpIcepk0o8(chr(48) + chr(11322 - 11211) + chr(0b110110), 0b1000), nzTpIcepk0o8('\x30' + chr(111) + '\063' + chr(2233 - 2181) + chr(0b1111 + 0o46), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8('\060' + chr(0b10 + 0o155) + chr(0b110101) + '\060', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\x92'), chr(0b101101 + 0o67) + '\145' + chr(99) + chr(0b1101111) + '\144' + chr(101))(chr(13392 - 13275) + '\164' + chr(0b1101 + 0o131) + '\x2d' + chr(56)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def v850snntN8PO(hXMPsSrOQzbh, p5gYIeSVE6xX, atdRvpJG67f4=nzTpIcepk0o8('\x30' + '\x6f' + '\x31' + '\x32', 0o10), cRf1yisHAXze=nzTpIcepk0o8(chr(0b100001 + 0o17) + '\157' + chr(2328 - 2279) + chr(50), 8), _R8IKF5IwAfX=roI3spqORKae(bpyfpu4kTbwL, roI3spqORKae(ES5oEprVxulp(b'\xf9\xdc\xc1\xdc\xc6/\x11\xf2\xb3\xc1F0'), chr(0b110101 + 0o57) + chr(0b1100101) + chr(0b1010110 + 0o15) + chr(3413 - 3302) + '\144' + '\x65')(chr(10343 - 10226) + chr(116) + '\146' + chr(0b101101) + '\070'))):
POx95m7SPOVy = H4NoA26ON7iG(hXMPsSrOQzbh.compute_report(p5gYIeSVE6xX, cRf1yisHAXze).Y_nNEzH43vXi())
roI3spqORKae(POx95m7SPOVy, roI3spqORKae(ES5oEprVxulp(b'\xcf\x87\xc7\xcd'), chr(2255 - 2155) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(100) + '\145')(chr(117) + '\164' + chr(0b1100110) + chr(1651 - 1606) + chr(56)))(key=lambda bI5jsQ9OkQtj: (ftfygxgFas5X(bI5jsQ9OkQtj[nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\061', 0b1000)]), bI5jsQ9OkQtj[nzTpIcepk0o8(chr(0b1011 + 0o45) + '\x6f' + '\x30', 607 - 599)]), reverse=nzTpIcepk0o8('\x30' + chr(735 - 624) + chr(49), 8))
PmE5_h409JAA = roI3spqORKae(ES5oEprVxulp(b'\xfd\x86\xd4\xd5\xf4\x01G\xcf\xd9\xf3\x15\x059\xaa\x98\x8aO\x16\ta'), chr(0b1000101 + 0o37) + '\x65' + chr(0b1100011) + chr(111) + chr(0b110010 + 0o62) + chr(9607 - 9506))('\x75' + chr(0b1110100) + chr(0b110001 + 0o65) + chr(164 - 119) + '\070').q33KG3foQ_CJ(ftfygxgFas5X(p5gYIeSVE6xX))
if ftfygxgFas5X(p5gYIeSVE6xX) == nzTpIcepk0o8(chr(0b110000) + '\157' + chr(48), 8):
roI3spqORKae(_R8IKF5IwAfX, roI3spqORKae(ES5oEprVxulp(b'\xd1\x84\x85\xd1\xe5\x0bT\x9a\xb5\xf8TJ'), chr(0b11010 + 0o112) + chr(0b1100101) + chr(9040 - 8941) + chr(0b1010110 + 0o31) + chr(100) + chr(0b1100101))('\x75' + chr(0b1100100 + 0o20) + '\146' + chr(0b0 + 0o55) + chr(0b111000)))(PmE5_h409JAA)
return
if ftfygxgFas5X(POx95m7SPOVy) > nzTpIcepk0o8('\060' + '\x6f' + '\060', 8):
PmE5_h409JAA += roI3spqORKae(ES5oEprVxulp(b'\xf5\x86\xc3\xd8\xe1\x12F\x8b\x9a\xe0D\nx\xbd\x89\x97I\x16\x07\nQ\x1b\xb78\xf5\x8f}\xa6\xe205{\xf5\x1b[\xbb\xdb'), chr(0b1110 + 0o126) + chr(0b1011001 + 0o14) + '\143' + chr(111) + chr(0b111011 + 0o51) + chr(0b1100101))(chr(117) + chr(0b101 + 0o157) + chr(102) + chr(0b10000 + 0o35) + '\070')
for (teUmM7cKWZUa, BnqHauOFE9Uy) in POx95m7SPOVy:
PmE5_h409JAA += roI3spqORKae(ES5oEprVxulp(b'\x9e\x93\x85\xc4\xafrY\x9a\x84\x82'), '\x64' + '\145' + '\143' + '\157' + '\144' + chr(101))('\165' + chr(0b110101 + 0o77) + '\146' + chr(45) + '\070').q33KG3foQ_CJ(teUmM7cKWZUa, ftfygxgFas5X(BnqHauOFE9Uy))
PmE5_h409JAA += roI3spqORKae(ES5oEprVxulp(b'\xb6'), chr(0b1000011 + 0o41) + '\x65' + '\143' + chr(111) + chr(100) + chr(7112 - 7011))(chr(0b1110101) + chr(3076 - 2960) + chr(0b10010 + 0o124) + '\055' + chr(1071 - 1015))
for (teUmM7cKWZUa, BnqHauOFE9Uy) in POx95m7SPOVy:
PmE5_h409JAA += roI3spqORKae(ES5oEprVxulp(b'\xfa\x87\xc7\x99\xee\x13C\xd9\x98\xebQ\x1dk\xfe\xdf\x89\x0b\x18\x05G\x1f\x19\xf89\xf3\x8e4\xaf\xf3.za\xf8\x0c]\xf3\xa36h\x86\xd9\x9b\x9b\xb3\xc8\x03C\xc6\x89\xe4@\x0b#\xd4'), chr(5031 - 4931) + chr(0b1011000 + 0o15) + '\x63' + chr(0b100110 + 0o111) + chr(2212 - 2112) + chr(0b1000111 + 0o36))(chr(117) + chr(12522 - 12406) + chr(3816 - 3714) + '\055' + '\x38').q33KG3foQ_CJ(teUmM7cKWZUa, ftfygxgFas5X(BnqHauOFE9Uy))
BnqHauOFE9Uy = wQI2PxGBYMEh(BnqHauOFE9Uy, XURpmPuEWCNF(ftfygxgFas5X(BnqHauOFE9Uy), atdRvpJG67f4))
for (At3kbMoXzzmV, MJm1y5Zx1KzE) in _kV_Bomx8PZ4(BnqHauOFE9Uy):
PmE5_h409JAA += roI3spqORKae(ES5oEprVxulp(b'\xd9\x90\xd4\xd4\xfd\x17G\x8b\x82\xb8XB9\xa5\xcc\x8f1'), chr(0b1000110 + 0o36) + chr(0b1100101) + '\143' + '\157' + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b1101 + 0o40) + chr(56)).q33KG3foQ_CJ(At3kbMoXzzmV + nzTpIcepk0o8('\x30' + chr(0b1101100 + 0o3) + chr(469 - 420), 8), MJm1y5Zx1KzE)
PmE5_h409JAA += roI3spqORKae(ES5oEprVxulp(b'\xb6'), chr(100) + chr(0b1100101) + chr(4892 - 4793) + '\157' + chr(100) + '\x65')('\x75' + chr(9515 - 9399) + '\146' + chr(0b11111 + 0o16) + chr(0b111000))
roI3spqORKae(_R8IKF5IwAfX, roI3spqORKae(ES5oEprVxulp(b'\xd1\x84\x85\xd1\xe5\x0bT\x9a\xb5\xf8TJ'), chr(0b1100100) + chr(101) + chr(99) + chr(111) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(102) + chr(0b101001 + 0o4) + '\070'))(PmE5_h409JAA)
else:
roI3spqORKae(_R8IKF5IwAfX, roI3spqORKae(ES5oEprVxulp(b'\xd1\x84\x85\xd1\xe5\x0bT\x9a\xb5\xf8TJ'), '\144' + chr(843 - 742) + chr(0b1100011) + '\157' + '\x64' + chr(101))('\x75' + chr(3714 - 3598) + '\x66' + chr(438 - 393) + '\x38'))(roI3spqORKae(ES5oEprVxulp(b'\xfd\x84\xd9\x99\xc20('), chr(0b1100100) + chr(101) + chr(0b100110 + 0o75) + chr(0b1010011 + 0o34) + chr(427 - 327) + chr(0b111101 + 0o50))('\165' + chr(116) + '\x66' + chr(803 - 758) + chr(0b111000)))
|
estnltk/estnltk
|
estnltk/syntax/parsers.py
|
VISLCG3Parser.parse_text
|
def parse_text(self, text, **kwargs):
""" Parses given text with VISLCG3 based syntactic analyzer.
As a result of parsing, the input Text object will obtain a new
layer named LAYER_VISLCG3, which contains a list of dicts.
Each dicts corresponds to analysis of a single word token, and
has the following attributes (at minimum):
'start' -- start index of the word in Text;
'end' -- end index of the word in Text;
'sent_id' -- index of the sentence in Text, starting from 0;
'parser_out' -- list of analyses from the output of the
syntactic parser;
In the list of analyses, each item has the following structure:
[ syntactic_label, index_of_the_head ]
*) syntactic_label:
surface syntactic label of the word, e.g. '@SUBJ',
'@OBJ', '@ADVL';
*) index_of_the_head:
index of the head (in the sentence);
-1 if the current token is root;
Parameters
-----------
text : estnltk.text.Text
The input text that should be analysed for dependency relations;
apply_tag_analysis : bool
Specifies whether, in case of a missing morphological ANALYSIS
layer, the text is morphologically analysed and disambiguated
via the method *text.tag_analysis* before proceeding with
the syntactic analysis.
Note that the syntactic analyser does its own morphological
disambiguation, but results of that disambiguation do not reach
back to the Text object, so the Text object will contain a layer
of ambiguous morphological analyses at the end of the parsing
step;
You can use *apply_tag_analysis=True* to ensure that at the
end of the parsing step, the input Text is both morphologically
analysed and disambiguated;
Default: False
return_type : string
If return_type=="text" (Default),
returns the input Text object;
If return_type=="vislcg3",
returns VISLCG3's output: a list of strings, each element in
the list corresponding to a line from VISLCG3's output;
If return_type=="trees",
returns all syntactic trees of the text as a list of
EstNLTK's Tree objects (estnltk.syntax.utils.Tree);
If return_type=="dep_graphs",
returns all syntactic trees of the text as a list of NLTK's
DependencyGraph objects
(nltk.parse.dependencygraph.DependencyGraph);
Regardless the return type, the layer containing dependency syntactic
information ( LAYER_VISLCG3 ) will be attached to the text object;
augment_words : bool
Specifies whether words in the input Text are to be augmented with
the syntactic information (SYNTAX_LABEL, SYNTAX_HEAD and DEPREL);
(!) This functionality is added to achieve a compatibility with the
old way syntactic processing, but it will be likely deprecated in
the future.
Default: False
Other arguments are the arguments that can be passed to methods:
vislcg3_syntax.process_lines(),
vislcg3_syntax.align_cg3_with_Text(),
normalise_alignments()
keep_old : bool
Optional argument specifying whether the old analysis lines
should be preserved after overwriting 'parser_out' with new analysis
lines;
If True, each dict will be augmented with key 'init_parser_out'
which contains the initial/old analysis lines;
Default:False
"""
# a) get the configuration:
apply_tag_analysis = False
augment_words = False
all_return_types = ["text","vislcg3","trees","dep_graphs"]
return_type = all_return_types[0]
for argName, argVal in kwargs.items():
if argName.lower() == 'return_type':
if argVal.lower() in all_return_types:
return_type = argVal.lower()
else:
raise Exception(' Unexpected return type: ', argVal)
elif argName.lower() == 'augment_words':
augment_words = bool(argVal)
elif argName.lower() == 'apply_tag_analysis':
apply_tag_analysis = bool(argVal)
kwargs['split_result'] = True
kwargs['clean_up'] = True
kwargs['remove_clo'] = kwargs.get('remove_clo', True)
kwargs['remove_cap'] = kwargs.get('remove_cap', True)
kwargs['keep_old'] = kwargs.get('keep_old', False)
kwargs['double_quotes'] = 'unesc'
# b) process:
if apply_tag_analysis:
text = text.tag_analysis()
result_lines1 = \
self.preprocessor.process_Text(text, **kwargs)
result_lines2 = \
self.vislcg3_processor.process_lines(result_lines1, **kwargs)
alignments = \
align_cg3_with_Text(result_lines2, text, **kwargs)
alignments = \
normalise_alignments( alignments, data_type=VISLCG3_DATA, **kwargs )
# c) attach & return results
text[LAYER_VISLCG3] = alignments
if augment_words:
self._augment_text_w_syntactic_info( text, text[LAYER_VISLCG3] )
if return_type == "vislcg3":
return result_lines2
elif return_type == "trees":
return build_trees_from_text( text, layer=LAYER_VISLCG3, **kwargs )
elif return_type == "dep_graphs":
trees = build_trees_from_text( text, layer=LAYER_VISLCG3, **kwargs )
graphs = [tree.as_dependencygraph() for tree in trees]
return graphs
else:
return text
|
python
|
def parse_text(self, text, **kwargs):
""" Parses given text with VISLCG3 based syntactic analyzer.
As a result of parsing, the input Text object will obtain a new
layer named LAYER_VISLCG3, which contains a list of dicts.
Each dicts corresponds to analysis of a single word token, and
has the following attributes (at minimum):
'start' -- start index of the word in Text;
'end' -- end index of the word in Text;
'sent_id' -- index of the sentence in Text, starting from 0;
'parser_out' -- list of analyses from the output of the
syntactic parser;
In the list of analyses, each item has the following structure:
[ syntactic_label, index_of_the_head ]
*) syntactic_label:
surface syntactic label of the word, e.g. '@SUBJ',
'@OBJ', '@ADVL';
*) index_of_the_head:
index of the head (in the sentence);
-1 if the current token is root;
Parameters
-----------
text : estnltk.text.Text
The input text that should be analysed for dependency relations;
apply_tag_analysis : bool
Specifies whether, in case of a missing morphological ANALYSIS
layer, the text is morphologically analysed and disambiguated
via the method *text.tag_analysis* before proceeding with
the syntactic analysis.
Note that the syntactic analyser does its own morphological
disambiguation, but results of that disambiguation do not reach
back to the Text object, so the Text object will contain a layer
of ambiguous morphological analyses at the end of the parsing
step;
You can use *apply_tag_analysis=True* to ensure that at the
end of the parsing step, the input Text is both morphologically
analysed and disambiguated;
Default: False
return_type : string
If return_type=="text" (Default),
returns the input Text object;
If return_type=="vislcg3",
returns VISLCG3's output: a list of strings, each element in
the list corresponding to a line from VISLCG3's output;
If return_type=="trees",
returns all syntactic trees of the text as a list of
EstNLTK's Tree objects (estnltk.syntax.utils.Tree);
If return_type=="dep_graphs",
returns all syntactic trees of the text as a list of NLTK's
DependencyGraph objects
(nltk.parse.dependencygraph.DependencyGraph);
Regardless the return type, the layer containing dependency syntactic
information ( LAYER_VISLCG3 ) will be attached to the text object;
augment_words : bool
Specifies whether words in the input Text are to be augmented with
the syntactic information (SYNTAX_LABEL, SYNTAX_HEAD and DEPREL);
(!) This functionality is added to achieve a compatibility with the
old way syntactic processing, but it will be likely deprecated in
the future.
Default: False
Other arguments are the arguments that can be passed to methods:
vislcg3_syntax.process_lines(),
vislcg3_syntax.align_cg3_with_Text(),
normalise_alignments()
keep_old : bool
Optional argument specifying whether the old analysis lines
should be preserved after overwriting 'parser_out' with new analysis
lines;
If True, each dict will be augmented with key 'init_parser_out'
which contains the initial/old analysis lines;
Default:False
"""
# a) get the configuration:
apply_tag_analysis = False
augment_words = False
all_return_types = ["text","vislcg3","trees","dep_graphs"]
return_type = all_return_types[0]
for argName, argVal in kwargs.items():
if argName.lower() == 'return_type':
if argVal.lower() in all_return_types:
return_type = argVal.lower()
else:
raise Exception(' Unexpected return type: ', argVal)
elif argName.lower() == 'augment_words':
augment_words = bool(argVal)
elif argName.lower() == 'apply_tag_analysis':
apply_tag_analysis = bool(argVal)
kwargs['split_result'] = True
kwargs['clean_up'] = True
kwargs['remove_clo'] = kwargs.get('remove_clo', True)
kwargs['remove_cap'] = kwargs.get('remove_cap', True)
kwargs['keep_old'] = kwargs.get('keep_old', False)
kwargs['double_quotes'] = 'unesc'
# b) process:
if apply_tag_analysis:
text = text.tag_analysis()
result_lines1 = \
self.preprocessor.process_Text(text, **kwargs)
result_lines2 = \
self.vislcg3_processor.process_lines(result_lines1, **kwargs)
alignments = \
align_cg3_with_Text(result_lines2, text, **kwargs)
alignments = \
normalise_alignments( alignments, data_type=VISLCG3_DATA, **kwargs )
# c) attach & return results
text[LAYER_VISLCG3] = alignments
if augment_words:
self._augment_text_w_syntactic_info( text, text[LAYER_VISLCG3] )
if return_type == "vislcg3":
return result_lines2
elif return_type == "trees":
return build_trees_from_text( text, layer=LAYER_VISLCG3, **kwargs )
elif return_type == "dep_graphs":
trees = build_trees_from_text( text, layer=LAYER_VISLCG3, **kwargs )
graphs = [tree.as_dependencygraph() for tree in trees]
return graphs
else:
return text
|
[
"def",
"parse_text",
"(",
"self",
",",
"text",
",",
"*",
"*",
"kwargs",
")",
":",
"# a) get the configuration:",
"apply_tag_analysis",
"=",
"False",
"augment_words",
"=",
"False",
"all_return_types",
"=",
"[",
"\"text\"",
",",
"\"vislcg3\"",
",",
"\"trees\"",
",",
"\"dep_graphs\"",
"]",
"return_type",
"=",
"all_return_types",
"[",
"0",
"]",
"for",
"argName",
",",
"argVal",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"if",
"argName",
".",
"lower",
"(",
")",
"==",
"'return_type'",
":",
"if",
"argVal",
".",
"lower",
"(",
")",
"in",
"all_return_types",
":",
"return_type",
"=",
"argVal",
".",
"lower",
"(",
")",
"else",
":",
"raise",
"Exception",
"(",
"' Unexpected return type: '",
",",
"argVal",
")",
"elif",
"argName",
".",
"lower",
"(",
")",
"==",
"'augment_words'",
":",
"augment_words",
"=",
"bool",
"(",
"argVal",
")",
"elif",
"argName",
".",
"lower",
"(",
")",
"==",
"'apply_tag_analysis'",
":",
"apply_tag_analysis",
"=",
"bool",
"(",
"argVal",
")",
"kwargs",
"[",
"'split_result'",
"]",
"=",
"True",
"kwargs",
"[",
"'clean_up'",
"]",
"=",
"True",
"kwargs",
"[",
"'remove_clo'",
"]",
"=",
"kwargs",
".",
"get",
"(",
"'remove_clo'",
",",
"True",
")",
"kwargs",
"[",
"'remove_cap'",
"]",
"=",
"kwargs",
".",
"get",
"(",
"'remove_cap'",
",",
"True",
")",
"kwargs",
"[",
"'keep_old'",
"]",
"=",
"kwargs",
".",
"get",
"(",
"'keep_old'",
",",
"False",
")",
"kwargs",
"[",
"'double_quotes'",
"]",
"=",
"'unesc'",
"# b) process:",
"if",
"apply_tag_analysis",
":",
"text",
"=",
"text",
".",
"tag_analysis",
"(",
")",
"result_lines1",
"=",
"self",
".",
"preprocessor",
".",
"process_Text",
"(",
"text",
",",
"*",
"*",
"kwargs",
")",
"result_lines2",
"=",
"self",
".",
"vislcg3_processor",
".",
"process_lines",
"(",
"result_lines1",
",",
"*",
"*",
"kwargs",
")",
"alignments",
"=",
"align_cg3_with_Text",
"(",
"result_lines2",
",",
"text",
",",
"*",
"*",
"kwargs",
")",
"alignments",
"=",
"normalise_alignments",
"(",
"alignments",
",",
"data_type",
"=",
"VISLCG3_DATA",
",",
"*",
"*",
"kwargs",
")",
"# c) attach & return results",
"text",
"[",
"LAYER_VISLCG3",
"]",
"=",
"alignments",
"if",
"augment_words",
":",
"self",
".",
"_augment_text_w_syntactic_info",
"(",
"text",
",",
"text",
"[",
"LAYER_VISLCG3",
"]",
")",
"if",
"return_type",
"==",
"\"vislcg3\"",
":",
"return",
"result_lines2",
"elif",
"return_type",
"==",
"\"trees\"",
":",
"return",
"build_trees_from_text",
"(",
"text",
",",
"layer",
"=",
"LAYER_VISLCG3",
",",
"*",
"*",
"kwargs",
")",
"elif",
"return_type",
"==",
"\"dep_graphs\"",
":",
"trees",
"=",
"build_trees_from_text",
"(",
"text",
",",
"layer",
"=",
"LAYER_VISLCG3",
",",
"*",
"*",
"kwargs",
")",
"graphs",
"=",
"[",
"tree",
".",
"as_dependencygraph",
"(",
")",
"for",
"tree",
"in",
"trees",
"]",
"return",
"graphs",
"else",
":",
"return",
"text"
] |
Parses given text with VISLCG3 based syntactic analyzer.
As a result of parsing, the input Text object will obtain a new
layer named LAYER_VISLCG3, which contains a list of dicts.
Each dicts corresponds to analysis of a single word token, and
has the following attributes (at minimum):
'start' -- start index of the word in Text;
'end' -- end index of the word in Text;
'sent_id' -- index of the sentence in Text, starting from 0;
'parser_out' -- list of analyses from the output of the
syntactic parser;
In the list of analyses, each item has the following structure:
[ syntactic_label, index_of_the_head ]
*) syntactic_label:
surface syntactic label of the word, e.g. '@SUBJ',
'@OBJ', '@ADVL';
*) index_of_the_head:
index of the head (in the sentence);
-1 if the current token is root;
Parameters
-----------
text : estnltk.text.Text
The input text that should be analysed for dependency relations;
apply_tag_analysis : bool
Specifies whether, in case of a missing morphological ANALYSIS
layer, the text is morphologically analysed and disambiguated
via the method *text.tag_analysis* before proceeding with
the syntactic analysis.
Note that the syntactic analyser does its own morphological
disambiguation, but results of that disambiguation do not reach
back to the Text object, so the Text object will contain a layer
of ambiguous morphological analyses at the end of the parsing
step;
You can use *apply_tag_analysis=True* to ensure that at the
end of the parsing step, the input Text is both morphologically
analysed and disambiguated;
Default: False
return_type : string
If return_type=="text" (Default),
returns the input Text object;
If return_type=="vislcg3",
returns VISLCG3's output: a list of strings, each element in
the list corresponding to a line from VISLCG3's output;
If return_type=="trees",
returns all syntactic trees of the text as a list of
EstNLTK's Tree objects (estnltk.syntax.utils.Tree);
If return_type=="dep_graphs",
returns all syntactic trees of the text as a list of NLTK's
DependencyGraph objects
(nltk.parse.dependencygraph.DependencyGraph);
Regardless the return type, the layer containing dependency syntactic
information ( LAYER_VISLCG3 ) will be attached to the text object;
augment_words : bool
Specifies whether words in the input Text are to be augmented with
the syntactic information (SYNTAX_LABEL, SYNTAX_HEAD and DEPREL);
(!) This functionality is added to achieve a compatibility with the
old way syntactic processing, but it will be likely deprecated in
the future.
Default: False
Other arguments are the arguments that can be passed to methods:
vislcg3_syntax.process_lines(),
vislcg3_syntax.align_cg3_with_Text(),
normalise_alignments()
keep_old : bool
Optional argument specifying whether the old analysis lines
should be preserved after overwriting 'parser_out' with new analysis
lines;
If True, each dict will be augmented with key 'init_parser_out'
which contains the initial/old analysis lines;
Default:False
|
[
"Parses",
"given",
"text",
"with",
"VISLCG3",
"based",
"syntactic",
"analyzer",
".",
"As",
"a",
"result",
"of",
"parsing",
"the",
"input",
"Text",
"object",
"will",
"obtain",
"a",
"new",
"layer",
"named",
"LAYER_VISLCG3",
"which",
"contains",
"a",
"list",
"of",
"dicts",
".",
"Each",
"dicts",
"corresponds",
"to",
"analysis",
"of",
"a",
"single",
"word",
"token",
"and",
"has",
"the",
"following",
"attributes",
"(",
"at",
"minimum",
")",
":",
"start",
"--",
"start",
"index",
"of",
"the",
"word",
"in",
"Text",
";",
"end",
"--",
"end",
"index",
"of",
"the",
"word",
"in",
"Text",
";",
"sent_id",
"--",
"index",
"of",
"the",
"sentence",
"in",
"Text",
"starting",
"from",
"0",
";",
"parser_out",
"--",
"list",
"of",
"analyses",
"from",
"the",
"output",
"of",
"the",
"syntactic",
"parser",
";",
"In",
"the",
"list",
"of",
"analyses",
"each",
"item",
"has",
"the",
"following",
"structure",
":",
"[",
"syntactic_label",
"index_of_the_head",
"]",
"*",
")",
"syntactic_label",
":",
"surface",
"syntactic",
"label",
"of",
"the",
"word",
"e",
".",
"g",
".",
"@SUBJ",
"@OBJ",
"@ADVL",
";",
"*",
")",
"index_of_the_head",
":",
"index",
"of",
"the",
"head",
"(",
"in",
"the",
"sentence",
")",
";",
"-",
"1",
"if",
"the",
"current",
"token",
"is",
"root",
";",
"Parameters",
"-----------",
"text",
":",
"estnltk",
".",
"text",
".",
"Text",
"The",
"input",
"text",
"that",
"should",
"be",
"analysed",
"for",
"dependency",
"relations",
";",
"apply_tag_analysis",
":",
"bool",
"Specifies",
"whether",
"in",
"case",
"of",
"a",
"missing",
"morphological",
"ANALYSIS",
"layer",
"the",
"text",
"is",
"morphologically",
"analysed",
"and",
"disambiguated",
"via",
"the",
"method",
"*",
"text",
".",
"tag_analysis",
"*",
"before",
"proceeding",
"with",
"the",
"syntactic",
"analysis",
".",
"Note",
"that",
"the",
"syntactic",
"analyser",
"does",
"its",
"own",
"morphological",
"disambiguation",
"but",
"results",
"of",
"that",
"disambiguation",
"do",
"not",
"reach",
"back",
"to",
"the",
"Text",
"object",
"so",
"the",
"Text",
"object",
"will",
"contain",
"a",
"layer",
"of",
"ambiguous",
"morphological",
"analyses",
"at",
"the",
"end",
"of",
"the",
"parsing",
"step",
";",
"You",
"can",
"use",
"*",
"apply_tag_analysis",
"=",
"True",
"*",
"to",
"ensure",
"that",
"at",
"the",
"end",
"of",
"the",
"parsing",
"step",
"the",
"input",
"Text",
"is",
"both",
"morphologically",
"analysed",
"and",
"disambiguated",
";",
"Default",
":",
"False"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/parsers.py#L143-L269
|
train
|
Parses given text with VISLCG3 based syntactic analyzer and returns a new Text object containing the parsed text.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3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k,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + '\063' + chr(0b101001 + 0o13) + '\x37', 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + '\x32' + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\157' + chr(0b100000 + 0o21) + chr(51) + chr(55), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\x33' + chr(0b1001 + 0o56) + '\061', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001) + chr(48) + '\x30', 19413 - 19405), nzTpIcepk0o8('\060' + chr(0b1011000 + 0o27) + '\062' + chr(55) + '\x32', ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101011 + 0o4) + chr(92 - 42) + chr(48) + chr(0b110101), 0b1000), nzTpIcepk0o8(chr(1092 - 1044) + chr(0b1101111) + chr(283 - 233) + '\x31' + chr(549 - 495), 0o10), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b110001) + chr(0b10100 + 0o37) + chr(0b110111), 8), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(493 - 442) + '\060' + chr(1050 - 1000), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b110000 + 0o77) + '\x32' + chr(0b1000 + 0o50) + chr(0b110001), 43449 - 43441), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110001) + '\060' + '\060', 8), nzTpIcepk0o8('\x30' + chr(1175 - 1064) + '\061' + chr(0b101000 + 0o15) + '\x32', 0o10), nzTpIcepk0o8(chr(0b11111 + 0o21) + chr(4059 - 3948) + '\x35' + chr(0b1010 + 0o46), 0b1000), nzTpIcepk0o8('\060' + '\x6f' + chr(51) + chr(1049 - 1001) + chr(0b110111), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b10101 + 0o36) + chr(2189 - 2139) + '\064', 0o10), nzTpIcepk0o8(chr(1741 - 1693) + chr(0b1100100 + 0o13) + chr(0b110001) + '\x36' + chr(0b10001 + 0o40), 20607 - 20599), nzTpIcepk0o8('\x30' + chr(0b1000 + 0o147) + chr(0b100010 + 0o25) + chr(279 - 231), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\x33' + chr(1175 - 1126) + chr(2172 - 2118), 0b1000), nzTpIcepk0o8(chr(0b11 + 0o55) + chr(1215 - 1104) + chr(980 - 931) + chr(53) + '\067', 6627 - 6619), nzTpIcepk0o8(chr(966 - 918) + chr(0b1101111) + chr(0b110011) + chr(0b1 + 0o63) + chr(0b101101 + 0o7), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(0b110011) + chr(1448 - 1399) + chr(0b100 + 0o56), 63254 - 63246), nzTpIcepk0o8(chr(0b110000) + chr(0b1010111 + 0o30) + chr(0b110001) + chr(53) + chr(1052 - 998), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(1717 - 1606) + chr(1170 - 1121) + '\065' + '\067', 8), nzTpIcepk0o8('\x30' + '\157' + '\x33' + '\065' + chr(51), ord("\x08")), nzTpIcepk0o8(chr(1710 - 1662) + chr(111) + chr(0b110001) + '\060' + chr(2864 - 2809), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + chr(0b1000 + 0o53) + '\062', 38665 - 38657), nzTpIcepk0o8(chr(48) + chr(0b1010100 + 0o33) + chr(162 - 109) + chr(54), 4796 - 4788), nzTpIcepk0o8(chr(0b110000) + chr(0b1011100 + 0o23) + chr(1096 - 1047) + chr(52) + '\067', 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110010) + chr(49) + chr(0b110101), 14234 - 14226), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b11100 + 0o25) + '\x36' + chr(51), 0b1000), nzTpIcepk0o8('\060' + chr(11392 - 11281) + chr(0b110001) + '\x30', 40535 - 40527), nzTpIcepk0o8(chr(2224 - 2176) + chr(111) + '\063' + chr(0b110000) + chr(0b11010 + 0o34), ord("\x08")), nzTpIcepk0o8('\060' + chr(849 - 738) + '\x33' + chr(0b110000) + '\066', 8), nzTpIcepk0o8(chr(1698 - 1650) + '\157' + chr(0b100 + 0o56) + chr(0b10010 + 0o44), 0b1000), nzTpIcepk0o8(chr(48) + chr(1616 - 1505) + chr(0b110010) + '\x36' + chr(0b1000 + 0o56), 0o10), nzTpIcepk0o8('\x30' + chr(0b1010011 + 0o34) + chr(0b11100 + 0o26) + '\x32' + chr(50), 0o10), nzTpIcepk0o8(chr(0b11011 + 0o25) + '\157' + chr(0b110011) + '\063' + chr(996 - 942), 0b1000), nzTpIcepk0o8(chr(952 - 904) + chr(0b1101111) + '\x32' + '\061' + '\064', 4930 - 4922), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\x30' + chr(52), 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b101101 + 0o3) + '\x6f' + chr(53) + '\060', 8)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xc9'), chr(0b1100100) + chr(0b1100101) + chr(0b1001101 + 0o26) + chr(0b111110 + 0o61) + chr(100) + '\145')('\x75' + '\x74' + chr(6213 - 6111) + chr(0b100001 + 0o14) + chr(0b110001 + 0o7)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def ZAMwA8i8PJtp(hXMPsSrOQzbh, cpStk7cY1TJd, **q5n0sHDDTy90):
kA6llgVVcREk = nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110000), 0o10)
vI27iMfkvKXG = nzTpIcepk0o8(chr(48) + chr(0b1010110 + 0o31) + chr(851 - 803), 8)
c8F102vCf32Q = [roI3spqORKae(ES5oEprVxulp(b"\x932'\x8d"), '\144' + chr(101) + chr(639 - 540) + chr(111) + chr(100) + chr(101))(chr(117) + '\x74' + chr(102) + chr(1702 - 1657) + '\x38'), roI3spqORKae(ES5oEprVxulp(b'\x91>,\x95#\xdd\xb6'), chr(3039 - 2939) + chr(0b1100101) + chr(0b100100 + 0o77) + '\157' + '\x64' + chr(7911 - 7810))(chr(0b1110101) + chr(1140 - 1024) + chr(0b111001 + 0o55) + '\x2d' + chr(56)), roI3spqORKae(ES5oEprVxulp(b'\x93%:\x9c3'), chr(4050 - 3950) + chr(5367 - 5266) + chr(0b111001 + 0o52) + '\x6f' + chr(0b11111 + 0o105) + '\x65')(chr(0b1010000 + 0o45) + chr(116) + chr(0b1100110) + chr(0b10101 + 0o30) + chr(197 - 141)), roI3spqORKae(ES5oEprVxulp(b"\x832/\xa6'\xc8\xe4\xfe7\xb1"), '\144' + chr(0b111110 + 0o47) + chr(0b1100011) + '\x6f' + chr(9507 - 9407) + chr(1866 - 1765))(chr(0b1110101) + chr(0b1110100) + chr(672 - 570) + chr(0b101101) + chr(1653 - 1597))]
RKau19fhINQi = c8F102vCf32Q[nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(476 - 428), 8)]
for (NkgRq9tD6uRI, I1WAJiZ060bz) in roI3spqORKae(q5n0sHDDTy90, roI3spqORKae(ES5oEprVxulp(b'\xbe\x081\xb7\x05\xc0\xcd\xbal\xb4\xd9)'), '\x64' + '\x65' + chr(0b11011 + 0o110) + chr(0b1000011 + 0o54) + '\144' + '\145')(chr(2161 - 2044) + chr(0b1110100) + chr(0b110100 + 0o62) + chr(0b101101) + '\x38'))():
if roI3spqORKae(NkgRq9tD6uRI, roI3spqORKae(ES5oEprVxulp(b'\xbf9g\xbc\x0e\xed\xc8\xd4;\x8b\xd34'), chr(0b1000101 + 0o37) + chr(0b1100101) + '\143' + chr(0b1010010 + 0o35) + '\144' + '\x65')(chr(0b1110101) + chr(116) + chr(102) + chr(0b11101 + 0o20) + '\070'))() == roI3spqORKae(ES5oEprVxulp(b'\x952+\x8c2\xd4\xda\xfa&\xb2\xe4'), chr(0b1100100) + '\x65' + chr(99) + '\157' + chr(0b1100100) + chr(101))(chr(117) + chr(0b1000101 + 0o57) + chr(102) + '\x2d' + '\x38'):
if roI3spqORKae(I1WAJiZ060bz, roI3spqORKae(ES5oEprVxulp(b'\xbf9g\xbc\x0e\xed\xc8\xd4;\x8b\xd34'), '\144' + '\145' + '\143' + chr(0b1101111) + '\x64' + chr(101))(chr(3103 - 2986) + '\x74' + chr(0b1010010 + 0o24) + '\055' + '\x38'))() in c8F102vCf32Q:
RKau19fhINQi = I1WAJiZ060bz.Xn8ENWMZdIRt()
else:
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'\xc7\x021\x9c8\xca\xe0\xed+\xa7\xe5`\x18M\xb3\xa1\x03V\xee\x1b\x9d\xba\x0bU\xcb'), '\144' + chr(0b1100010 + 0o3) + chr(99) + '\157' + chr(0b1010111 + 0o15) + chr(0b1100101))(chr(5662 - 5545) + '\164' + chr(102) + chr(858 - 813) + '\070'), I1WAJiZ060bz)
elif roI3spqORKae(NkgRq9tD6uRI, roI3spqORKae(ES5oEprVxulp(b'\xbf9g\xbc\x0e\xed\xc8\xd4;\x8b\xd34'), chr(5907 - 5807) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1000100 + 0o40) + '\145')(chr(0b1000010 + 0o63) + chr(4695 - 4579) + chr(4156 - 4054) + chr(0b101101) + chr(56)))() == roI3spqORKae(ES5oEprVxulp(b'\x86"8\x94%\xd4\xf1\xd1(\xad\xf3$\x19'), '\144' + '\x65' + '\x63' + chr(111) + '\144' + chr(101))('\x75' + chr(814 - 698) + chr(0b11001 + 0o115) + chr(0b100101 + 0o10) + chr(1888 - 1832)):
vI27iMfkvKXG = TVUhqOt5_BbS(I1WAJiZ060bz)
elif roI3spqORKae(NkgRq9tD6uRI, roI3spqORKae(ES5oEprVxulp(b'\xbf9g\xbc\x0e\xed\xc8\xd4;\x8b\xd34'), chr(100) + chr(9397 - 9296) + '\x63' + chr(0b10011 + 0o134) + '\144' + chr(0b110000 + 0o65))(chr(0b111000 + 0o75) + chr(116) + '\x66' + chr(45) + chr(0b10101 + 0o43)))() == roI3spqORKae(ES5oEprVxulp(b"\x86'/\x959\xe5\xf1\xef8\x9d\xe0.\x0bD\xbe\xa7\x18K"), chr(0b11111 + 0o105) + chr(3947 - 3846) + chr(0b100 + 0o137) + '\x6f' + '\x64' + '\145')(chr(117) + chr(0b10011 + 0o141) + '\x66' + '\x2d' + '\070'):
kA6llgVVcREk = TVUhqOt5_BbS(I1WAJiZ060bz)
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b"\x94'3\x904\xe5\xf7\xeb,\xb7\xed4"), chr(986 - 886) + '\x65' + chr(0b100001 + 0o102) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1110101) + chr(0b101000 + 0o114) + '\x66' + chr(485 - 440) + chr(56))] = nzTpIcepk0o8('\x30' + chr(0b111101 + 0o62) + chr(0b11111 + 0o22), 7071 - 7063)
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'\x84;:\x98.\xe5\xf0\xfe'), '\144' + '\x65' + '\x63' + '\x6f' + '\x64' + chr(101))(chr(0b1110101) + '\164' + chr(0b111000 + 0o56) + chr(528 - 483) + '\x38')] = nzTpIcepk0o8(chr(48) + chr(0b100110 + 0o111) + '\x31', 8)
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'\x9522\x966\xdf\xda\xed3\xad'), '\144' + chr(0b100010 + 0o103) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(101))('\165' + chr(116) + chr(0b11010 + 0o114) + chr(0b101101) + '\070')] = q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\x9522\x966\xdf\xda\xed3\xad'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b1101111) + '\x64' + chr(0b1100100 + 0o1))(chr(0b1110101) + '\x74' + chr(7286 - 7184) + chr(826 - 781) + '\x38'), nzTpIcepk0o8(chr(2288 - 2240) + '\x6f' + chr(0b101110 + 0o3), 8))
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'\x9522\x966\xdf\xda\xed>\xb2'), chr(100) + chr(0b1000111 + 0o36) + chr(99) + '\x6f' + chr(0b110010 + 0o62) + '\145')(chr(9504 - 9387) + '\164' + chr(102) + chr(0b100110 + 0o7) + '\070')] = q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\x9522\x966\xdf\xda\xed>\xb2'), '\x64' + chr(101) + '\143' + chr(315 - 204) + '\144' + chr(8128 - 8027))('\165' + chr(116) + chr(0b101010 + 0o74) + '\x2d' + chr(0b100 + 0o64)), nzTpIcepk0o8(chr(150 - 102) + chr(5523 - 5412) + chr(49), 8))
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'\x8c2:\x89\x1f\xd5\xe9\xea'), '\x64' + chr(101) + chr(0b10 + 0o141) + chr(9166 - 9055) + chr(6756 - 6656) + chr(2945 - 2844))('\x75' + '\164' + '\x66' + '\055' + '\x38')] = q5n0sHDDTy90.GUKetu4xaGsJ(roI3spqORKae(ES5oEprVxulp(b'\x8c2:\x89\x1f\xd5\xe9\xea'), '\144' + chr(7677 - 7576) + '\143' + chr(0b11000 + 0o127) + '\x64' + chr(101))('\x75' + chr(0b1110100) + '\x66' + '\x2d' + chr(2000 - 1944)), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(48), 8))
q5n0sHDDTy90[roI3spqORKae(ES5oEprVxulp(b'\x838*\x9b,\xdf\xda\xff*\xad\xf5%\x19'), chr(0b1100100) + chr(8928 - 8827) + '\143' + '\157' + '\x64' + chr(0b1011111 + 0o6))('\165' + chr(0b1110100) + '\x66' + '\x2d' + '\x38')] = roI3spqORKae(ES5oEprVxulp(b'\x929:\x8a#'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(8882 - 8771) + chr(1844 - 1744) + chr(6375 - 6274))('\165' + '\164' + chr(7253 - 7151) + chr(0b101001 + 0o4) + chr(0b111000))
if kA6llgVVcREk:
cpStk7cY1TJd = cpStk7cY1TJd.tag_analysis()
KA96CR5SL43M = hXMPsSrOQzbh.preprocessor.process_Text(cpStk7cY1TJd, **q5n0sHDDTy90)
FmHNzndlVuJz = hXMPsSrOQzbh.vislcg3_processor.process_lines(KA96CR5SL43M, **q5n0sHDDTy90)
b1P1tmiToFXB = Xiks8j1nFL2_(FmHNzndlVuJz, cpStk7cY1TJd, **q5n0sHDDTy90)
b1P1tmiToFXB = Ka8lH6tcB8Ij(b1P1tmiToFXB, data_type=HCImhGZDKDXO, **q5n0sHDDTy90)
cpStk7cY1TJd[hbGY90RLE0bf] = b1P1tmiToFXB
if vI27iMfkvKXG:
roI3spqORKae(hXMPsSrOQzbh, roI3spqORKae(ES5oEprVxulp(b'\xb86*\x9e-\xdf\xeb\xfa\x00\xb6\xe48\x1ew\xb0\x8b\x02A\xa0\x1b\x85\xa9\x1a\x06\x88\x18\xf3@\x01\xe2'), chr(0b1000010 + 0o42) + chr(5706 - 5605) + '\143' + '\157' + chr(2688 - 2588) + chr(8518 - 8417))(chr(0b1100001 + 0o24) + chr(9077 - 8961) + chr(0b1100110) + chr(1420 - 1375) + chr(0b100001 + 0o27)))(cpStk7cY1TJd, cpStk7cY1TJd[hbGY90RLE0bf])
if RKau19fhINQi == roI3spqORKae(ES5oEprVxulp(b'\x91>,\x95#\xdd\xb6'), chr(0b101 + 0o137) + '\145' + chr(99) + chr(0b1101111) + chr(100) + chr(0b11 + 0o142))('\x75' + '\164' + '\x66' + chr(0b10111 + 0o26) + '\x38'):
return FmHNzndlVuJz
elif RKau19fhINQi == roI3spqORKae(ES5oEprVxulp(b'\x93%:\x9c3'), chr(0b110110 + 0o56) + chr(0b1000001 + 0o44) + chr(2879 - 2780) + '\157' + '\x64' + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56)):
return YLJOMpFvHApa(cpStk7cY1TJd, layer=hbGY90RLE0bf, **q5n0sHDDTy90)
elif RKau19fhINQi == roI3spqORKae(ES5oEprVxulp(b"\x832/\xa6'\xc8\xe4\xfe7\xb1"), chr(0b1100100) + '\x65' + chr(0b1011011 + 0o10) + '\x6f' + chr(0b1100100) + chr(0b100000 + 0o105))(chr(12894 - 12777) + chr(0b1110100) + chr(7395 - 7293) + chr(45) + chr(56)):
ygA6tjfxx7CW = YLJOMpFvHApa(cpStk7cY1TJd, layer=hbGY90RLE0bf, **q5n0sHDDTy90)
gdVfrlipfIDw = [BEwy6Gm_1uLr.as_dependencygraph() for BEwy6Gm_1uLr in ygA6tjfxx7CW]
return gdVfrlipfIDw
else:
return cpStk7cY1TJd
|
estnltk/estnltk
|
estnltk/syntax/parsers.py
|
VISLCG3Parser._filter_kwargs
|
def _filter_kwargs(self, keep_list, **kwargs):
''' Filters the dict of *kwargs*, keeping only arguments
whose keys are in *keep_list* and discarding all other
arguments.
Based on the filtring, constructs and returns a new
dict.
'''
new_kwargs = {}
for argName, argVal in kwargs.items():
if argName.lower() in keep_list:
new_kwargs[argName.lower()] = argVal
return new_kwargs
|
python
|
def _filter_kwargs(self, keep_list, **kwargs):
''' Filters the dict of *kwargs*, keeping only arguments
whose keys are in *keep_list* and discarding all other
arguments.
Based on the filtring, constructs and returns a new
dict.
'''
new_kwargs = {}
for argName, argVal in kwargs.items():
if argName.lower() in keep_list:
new_kwargs[argName.lower()] = argVal
return new_kwargs
|
[
"def",
"_filter_kwargs",
"(",
"self",
",",
"keep_list",
",",
"*",
"*",
"kwargs",
")",
":",
"new_kwargs",
"=",
"{",
"}",
"for",
"argName",
",",
"argVal",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"if",
"argName",
".",
"lower",
"(",
")",
"in",
"keep_list",
":",
"new_kwargs",
"[",
"argName",
".",
"lower",
"(",
")",
"]",
"=",
"argVal",
"return",
"new_kwargs"
] |
Filters the dict of *kwargs*, keeping only arguments
whose keys are in *keep_list* and discarding all other
arguments.
Based on the filtring, constructs and returns a new
dict.
|
[
"Filters",
"the",
"dict",
"of",
"*",
"kwargs",
"*",
"keeping",
"only",
"arguments",
"whose",
"keys",
"are",
"in",
"*",
"keep_list",
"*",
"and",
"discarding",
"all",
"other",
"arguments",
".",
"Based",
"on",
"the",
"filtring",
"constructs",
"and",
"returns",
"a",
"new",
"dict",
"."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/parsers.py#L272-L284
|
train
|
Filters the dict of kwargs that are in keep_list and discards all other arguments.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,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86v,pWZq9QOaZbhU,lI5UiuqoXdKZ,qZ4DivK_Doaa,znjnJWK64FDT,iJbw0iNQ06Xw,Jq33HEV_XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b111100 + 0o63) + chr(51) + '\x37' + chr(0b10101 + 0o36), 0b1000), nzTpIcepk0o8('\060' + chr(0b11100 + 0o123) + chr(1251 - 1200) + chr(0b111 + 0o54), 0b1000), nzTpIcepk0o8(chr(864 - 816) + '\157' + chr(0b10111 + 0o34) + '\x37' + chr(0b11010 + 0o35), 0o10), nzTpIcepk0o8('\060' + chr(0b1011101 + 0o22) + chr(0b100001 + 0o20) + chr(0b101101 + 0o10) + '\066', 0b1000), nzTpIcepk0o8(chr(470 - 422) + chr(0b1101111) + chr(1889 - 1836) + chr(0b101100 + 0o7), 0o10), nzTpIcepk0o8(chr(270 - 222) + '\157' + '\x31' + '\x30' + '\x33', 20846 - 20838), nzTpIcepk0o8('\x30' + '\x6f' + chr(49) + chr(2355 - 2304) + chr(52), 0o10), nzTpIcepk0o8(chr(798 - 750) + '\x6f' + chr(0b100101 + 0o15) + chr(0b110011) + chr(440 - 389), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b101011 + 0o104) + chr(0b110011) + chr(51) + chr(50), 54665 - 54657), nzTpIcepk0o8(chr(0b101000 + 0o10) + chr(0b1101111 + 0o0) + chr(0b110001) + chr(48) + chr(82 - 29), 0o10), nzTpIcepk0o8('\060' + chr(0b1001101 + 0o42) + chr(0b110001) + '\065' + '\063', ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(0b1010001 + 0o36) + chr(1914 - 1863) + '\x34' + '\x33', 47967 - 47959), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(0b10011 + 0o134) + chr(360 - 309) + '\066' + chr(0b11011 + 0o32), 0o10), nzTpIcepk0o8(chr(48) + chr(0b110110 + 0o71) + chr(0b111 + 0o53) + chr(0b100101 + 0o13) + '\x34', 22323 - 22315), nzTpIcepk0o8(chr(572 - 524) + '\x6f' + chr(0b110010) + '\062' + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(62 - 14) + chr(11135 - 11024) + '\063' + chr(52) + chr(0b100011 + 0o22), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\063' + chr(0b110001) + chr(48), 52385 - 52377), nzTpIcepk0o8(chr(1570 - 1522) + '\157' + chr(0b110001) + '\062' + '\064', 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(6225 - 6114) + '\062' + chr(1310 - 1259) + chr(0b100011 + 0o22), 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(55) + '\x34', 0o10), nzTpIcepk0o8(chr(48) + chr(0b1010110 + 0o31) + chr(642 - 591) + chr(2375 - 2326), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(597 - 547) + chr(0b10011 + 0o40) + chr(2076 - 2024), ord("\x08")), nzTpIcepk0o8('\060' + chr(0b1101111) + '\x31' + chr(0b110011) + chr(50), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b0 + 0o61) + '\x30' + chr(0b11110 + 0o25), 8), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(0b1001100 + 0o43) + chr(51) + chr(0b0 + 0o67) + '\063', 8), nzTpIcepk0o8(chr(48) + '\157' + chr(49) + '\060' + chr(55), 7413 - 7405), nzTpIcepk0o8(chr(776 - 728) + chr(0b1101111) + '\x32' + '\x33' + '\064', 8), nzTpIcepk0o8(chr(1047 - 999) + chr(0b11010 + 0o125) + '\063' + chr(0b11101 + 0o31) + '\062', 0o10), nzTpIcepk0o8(chr(48) + '\x6f' + chr(2037 - 1987) + '\x30' + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + chr(1780 - 1730) + chr(49), 0o10), nzTpIcepk0o8('\x30' + chr(2421 - 2310) + chr(0b110011) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(0b1 + 0o57) + chr(1023 - 912) + '\061' + '\066' + chr(2320 - 2266), ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\063' + '\065', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b111011 + 0o64) + chr(51) + chr(0b10 + 0o60) + chr(2416 - 2363), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(2722 - 2611) + '\x32' + chr(0b110110) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(51), 8), nzTpIcepk0o8('\060' + chr(0b1001111 + 0o40) + '\x31' + chr(0b110000), 0o10), nzTpIcepk0o8(chr(48) + chr(0b1011001 + 0o26) + chr(0b110001), 0b1000), nzTpIcepk0o8(chr(299 - 251) + chr(0b11011 + 0o124) + chr(1576 - 1527) + chr(90 - 41) + '\065', 10361 - 10353), nzTpIcepk0o8('\060' + '\157' + chr(53) + '\067', 0b1000)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + chr(0b100110 + 0o111) + chr(0b110101) + '\060', 33684 - 33676)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xd5'), chr(100) + chr(0b100110 + 0o77) + '\x63' + '\x6f' + chr(2799 - 2699) + '\x65')(chr(0b1100110 + 0o17) + '\x74' + chr(0b1011100 + 0o12) + chr(45) + '\070') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def bzvJOu_CUSQt(hXMPsSrOQzbh, w4nw3SCmSSsx, **q5n0sHDDTy90):
q8iEVNeiL2KP = {}
for (NkgRq9tD6uRI, I1WAJiZ060bz) in roI3spqORKae(q5n0sHDDTy90, roI3spqORKae(ES5oEprVxulp(b'\xa2D\x91 n9\x14\xaf\xe933\x8a'), '\144' + '\x65' + '\x63' + chr(0b110000 + 0o77) + '\144' + chr(101))('\165' + '\x74' + chr(2621 - 2519) + '\055' + chr(2160 - 2104)))():
if roI3spqORKae(NkgRq9tD6uRI, roI3spqORKae(ES5oEprVxulp(b'\xa3u\xc7+e\x14\x11\xc1\xbe\x0c9\x97'), '\x64' + '\x65' + '\143' + chr(0b1100 + 0o143) + chr(100) + chr(0b1100101))('\165' + '\x74' + chr(102) + chr(0b1001 + 0o44) + '\x38'))() in w4nw3SCmSSsx:
q8iEVNeiL2KP[NkgRq9tD6uRI.Xn8ENWMZdIRt()] = I1WAJiZ060bz
return q8iEVNeiL2KP
|
estnltk/estnltk
|
estnltk/syntax/parsers.py
|
VISLCG3Parser._augment_text_w_syntactic_info
|
def _augment_text_w_syntactic_info( self, text, text_layer ):
''' Augments given Text object with the syntactic information
from the *text_layer*. More specifically, adds information
about SYNTAX_LABEL, SYNTAX_HEAD and DEPREL to each token
in the Text object;
(!) Note: this method is added to provide some initial
consistency with MaltParser based syntactic parsing;
If a better syntactic parsing interface is achieved in
the future, this method will be deprecated ...
'''
j = 0
for sentence in text.divide( layer=WORDS, by=SENTENCES ):
for i in range(len(sentence)):
estnltkToken = sentence[i]
vislcg3Token = text_layer[j]
parse_found = False
if PARSER_OUT in vislcg3Token:
if len( vislcg3Token[PARSER_OUT] ) > 0:
firstParse = vislcg3Token[PARSER_OUT][0]
# Fetch information about the syntactic relation:
estnltkToken['s_label'] = str(i)
estnltkToken['s_head'] = str(firstParse[1])
# Fetch the name of the surface syntactic relation
deprels = '|'.join( [p[0] for p in vislcg3Token[PARSER_OUT]] )
estnltkToken['s_rel'] = deprels
parse_found = True
if not parse_found:
raise Exception("(!) Unable to retrieve syntactic analysis for the ",\
estnltkToken, ' from ', vislcg3Token )
j += 1
|
python
|
def _augment_text_w_syntactic_info( self, text, text_layer ):
''' Augments given Text object with the syntactic information
from the *text_layer*. More specifically, adds information
about SYNTAX_LABEL, SYNTAX_HEAD and DEPREL to each token
in the Text object;
(!) Note: this method is added to provide some initial
consistency with MaltParser based syntactic parsing;
If a better syntactic parsing interface is achieved in
the future, this method will be deprecated ...
'''
j = 0
for sentence in text.divide( layer=WORDS, by=SENTENCES ):
for i in range(len(sentence)):
estnltkToken = sentence[i]
vislcg3Token = text_layer[j]
parse_found = False
if PARSER_OUT in vislcg3Token:
if len( vislcg3Token[PARSER_OUT] ) > 0:
firstParse = vislcg3Token[PARSER_OUT][0]
# Fetch information about the syntactic relation:
estnltkToken['s_label'] = str(i)
estnltkToken['s_head'] = str(firstParse[1])
# Fetch the name of the surface syntactic relation
deprels = '|'.join( [p[0] for p in vislcg3Token[PARSER_OUT]] )
estnltkToken['s_rel'] = deprels
parse_found = True
if not parse_found:
raise Exception("(!) Unable to retrieve syntactic analysis for the ",\
estnltkToken, ' from ', vislcg3Token )
j += 1
|
[
"def",
"_augment_text_w_syntactic_info",
"(",
"self",
",",
"text",
",",
"text_layer",
")",
":",
"j",
"=",
"0",
"for",
"sentence",
"in",
"text",
".",
"divide",
"(",
"layer",
"=",
"WORDS",
",",
"by",
"=",
"SENTENCES",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"sentence",
")",
")",
":",
"estnltkToken",
"=",
"sentence",
"[",
"i",
"]",
"vislcg3Token",
"=",
"text_layer",
"[",
"j",
"]",
"parse_found",
"=",
"False",
"if",
"PARSER_OUT",
"in",
"vislcg3Token",
":",
"if",
"len",
"(",
"vislcg3Token",
"[",
"PARSER_OUT",
"]",
")",
">",
"0",
":",
"firstParse",
"=",
"vislcg3Token",
"[",
"PARSER_OUT",
"]",
"[",
"0",
"]",
"# Fetch information about the syntactic relation:",
"estnltkToken",
"[",
"'s_label'",
"]",
"=",
"str",
"(",
"i",
")",
"estnltkToken",
"[",
"'s_head'",
"]",
"=",
"str",
"(",
"firstParse",
"[",
"1",
"]",
")",
"# Fetch the name of the surface syntactic relation",
"deprels",
"=",
"'|'",
".",
"join",
"(",
"[",
"p",
"[",
"0",
"]",
"for",
"p",
"in",
"vislcg3Token",
"[",
"PARSER_OUT",
"]",
"]",
")",
"estnltkToken",
"[",
"'s_rel'",
"]",
"=",
"deprels",
"parse_found",
"=",
"True",
"if",
"not",
"parse_found",
":",
"raise",
"Exception",
"(",
"\"(!) Unable to retrieve syntactic analysis for the \"",
",",
"estnltkToken",
",",
"' from '",
",",
"vislcg3Token",
")",
"j",
"+=",
"1"
] |
Augments given Text object with the syntactic information
from the *text_layer*. More specifically, adds information
about SYNTAX_LABEL, SYNTAX_HEAD and DEPREL to each token
in the Text object;
(!) Note: this method is added to provide some initial
consistency with MaltParser based syntactic parsing;
If a better syntactic parsing interface is achieved in
the future, this method will be deprecated ...
|
[
"Augments",
"given",
"Text",
"object",
"with",
"the",
"syntactic",
"information",
"from",
"the",
"*",
"text_layer",
"*",
".",
"More",
"specifically",
"adds",
"information",
"about",
"SYNTAX_LABEL",
"SYNTAX_HEAD",
"and",
"DEPREL",
"to",
"each",
"token",
"in",
"the",
"Text",
"object",
";",
"(",
"!",
")",
"Note",
":",
"this",
"method",
"is",
"added",
"to",
"provide",
"some",
"initial",
"consistency",
"with",
"MaltParser",
"based",
"syntactic",
"parsing",
";",
"If",
"a",
"better",
"syntactic",
"parsing",
"interface",
"is",
"achieved",
"in",
"the",
"future",
"this",
"method",
"will",
"be",
"deprecated",
"..."
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/parsers.py#L287-L317
|
train
|
Augments given Text object with the syntactic information about each token in the text_layer. More specifically adds information
about SYNTAX_LABEL SYNTAX_HEAD and DEPREL to each token in the text_layer. More specifically adds information
about SYNTAX_HEAD and DEPREL to each token in the Text object.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJ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,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8('\060' + chr(0b1101111) + chr(51) + chr(54) + chr(54), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110011 + 0o0) + chr(0b110100), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b110111) + '\x34', 0b1000), nzTpIcepk0o8('\x30' + '\157' + chr(0b10110 + 0o33) + '\060' + chr(55), 0o10), nzTpIcepk0o8('\x30' + chr(6281 - 6170) + chr(0b101001 + 0o12) + chr(0b1101 + 0o47) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b100101 + 0o13) + '\x6f' + '\062' + chr(50) + '\065', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\x32' + chr(135 - 81) + chr(52), 45124 - 45116), nzTpIcepk0o8(chr(48) + chr(111) + '\x37' + '\x31', 0b1000), nzTpIcepk0o8(chr(152 - 104) + chr(111) + '\061' + '\061' + chr(0b110111), 0b1000), nzTpIcepk0o8(chr(1146 - 1098) + chr(111) + '\x32' + chr(0b101100 + 0o12) + chr(52), 8), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\063' + chr(1910 - 1861) + '\063', 56688 - 56680), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110100) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(50) + chr(0b110101) + chr(0b10000 + 0o44), 0o10), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110010 + 0o1) + '\060' + chr(946 - 894), 0b1000), nzTpIcepk0o8('\060' + chr(10612 - 10501) + chr(49) + chr(0b110000) + chr(2260 - 2206), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b10010 + 0o44), 15796 - 15788), nzTpIcepk0o8(chr(341 - 293) + '\157' + chr(1291 - 1242) + chr(0b10011 + 0o43) + '\x35', 24656 - 24648), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + chr(49), ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(54) + chr(0b10100 + 0o40), ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(0b110011) + chr(525 - 476) + '\x37', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1010000 + 0o37) + chr(0b111 + 0o52) + chr(0b110101) + '\067', ord("\x08")), nzTpIcepk0o8(chr(0b100 + 0o54) + chr(111) + chr(0b1101 + 0o44) + chr(0b101001 + 0o7) + '\x30', 24181 - 24173), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x33' + chr(1488 - 1436) + '\x32', 0b1000), nzTpIcepk0o8(chr(0b100110 + 0o12) + '\157' + chr(51) + '\x37' + chr(0b110101), 64095 - 64087), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b101100 + 0o7) + '\x37' + '\x33', 0b1000), nzTpIcepk0o8(chr(0b101100 + 0o4) + chr(2004 - 1893) + chr(50) + chr(0b110001) + chr(52), 43061 - 43053), nzTpIcepk0o8(chr(0b0 + 0o60) + chr(0b1101111) + chr(50) + '\064' + '\065', 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(49) + chr(0b110110) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101111) + '\063' + '\066' + '\064', ord("\x08")), nzTpIcepk0o8(chr(129 - 81) + chr(0b111011 + 0o64) + chr(54) + '\066', 46610 - 46602), nzTpIcepk0o8(chr(247 - 199) + '\x6f' + chr(2084 - 2035) + chr(51) + chr(49), 19014 - 19006), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(1758 - 1703) + chr(0b100001 + 0o25), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x33' + '\x33' + chr(0b110001), 0o10), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1869 - 1820) + chr(0b101001 + 0o14) + '\060', 0b1000), nzTpIcepk0o8(chr(0b10000 + 0o40) + chr(0b1101111) + chr(0b110101) + chr(55), ord("\x08")), nzTpIcepk0o8(chr(0b100001 + 0o17) + chr(111) + chr(0b110001) + chr(0b10101 + 0o40) + chr(54), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x34' + '\063', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(755 - 706) + chr(0b1110 + 0o42) + chr(0b110110), 8), nzTpIcepk0o8('\060' + chr(0b1010001 + 0o36) + chr(0b111 + 0o52) + chr(0b110100), 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\x34' + chr(54), ord("\x08"))][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(0b1110 + 0o42) + chr(111) + '\x35' + chr(48), 50757 - 50749)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xd8'), chr(0b1100100) + chr(101) + chr(99) + chr(111) + chr(100) + '\x65')('\165' + '\164' + '\146' + chr(0b10011 + 0o32) + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def xFOfbDQMkDiX(hXMPsSrOQzbh, cpStk7cY1TJd, g7Xlu8RDtpWV):
sChW4gUsXrIC = nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1000110 + 0o51) + chr(0b101001 + 0o7), 0b1000)
for v3YfwzoUholR in roI3spqORKae(cpStk7cY1TJd, roI3spqORKae(ES5oEprVxulp(b'\x92uJ.\x80\xf0'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(111) + '\144' + '\x65')(chr(117) + '\164' + chr(9558 - 9456) + chr(0b101101) + '\x38'))(layer=dwqZnwPLrnLJ, by=DUoBUczr5TtH):
for ZlbFMSG8gCoF in bbT2xIe5pzk7(ftfygxgFas5X(v3YfwzoUholR)):
blOAuBQXwSZC = v3YfwzoUholR[ZlbFMSG8gCoF]
QmKL0DHo9R7E = g7Xlu8RDtpWV[sChW4gUsXrIC]
zj7z9kbIR4cr = nzTpIcepk0o8('\060' + chr(5996 - 5885) + chr(0b110000), 8)
if v_R2BDa6ICLe in QmKL0DHo9R7E:
if ftfygxgFas5X(QmKL0DHo9R7E[v_R2BDa6ICLe]) > nzTpIcepk0o8(chr(0b100 + 0o54) + chr(10650 - 10539) + chr(0b1011 + 0o45), 8):
ijZKmohDhozd = QmKL0DHo9R7E[v_R2BDa6ICLe][nzTpIcepk0o8('\060' + chr(6935 - 6824) + '\x30', 8)]
blOAuBQXwSZC[roI3spqORKae(ES5oEprVxulp(b'\x85CP&\x86\xf0\xd8'), chr(100) + '\x65' + chr(9021 - 8922) + '\x6f' + chr(6860 - 6760) + chr(0b1100101))(chr(3835 - 3718) + chr(7580 - 7464) + chr(0b100101 + 0o101) + chr(45) + chr(0b100110 + 0o22))] = N9zlRy29S1SS(ZlbFMSG8gCoF)
blOAuBQXwSZC[roI3spqORKae(ES5oEprVxulp(b'\x85CT"\x85\xf1'), '\144' + '\x65' + '\x63' + chr(111) + '\144' + chr(3686 - 3585))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(411 - 366) + chr(1416 - 1360))] = N9zlRy29S1SS(ijZKmohDhozd[nzTpIcepk0o8('\060' + '\157' + '\061', 0o10)])
GRgiMfkLmwhM = roI3spqORKae(ES5oEprVxulp(b'\x8a'), chr(9362 - 9262) + chr(0b1100101) + chr(6024 - 5925) + chr(111) + '\x64' + '\x65')(chr(0b1110101) + chr(0b10010 + 0o142) + '\x66' + '\x2d' + chr(56)).Y4yM9BcfTCNq([fSdw5wwLo9MO[nzTpIcepk0o8(chr(0b110000) + chr(3785 - 3674) + chr(0b110000), 8)] for fSdw5wwLo9MO in QmKL0DHo9R7E[v_R2BDa6ICLe]])
blOAuBQXwSZC[roI3spqORKae(ES5oEprVxulp(b'\x85CN"\x88'), chr(100) + chr(7820 - 7719) + '\x63' + chr(2729 - 2618) + chr(0b1100100) + chr(101))(chr(13601 - 13484) + chr(7815 - 7699) + chr(0b110111 + 0o57) + '\055' + '\x38')] = GRgiMfkLmwhM
zj7z9kbIR4cr = nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(49), 8)
if not zj7z9kbIR4cr:
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'\xde=\x15g\xb1\xfb\xd5[#\xd1\xeb\x13\xc3\xe44s\x01k]\xaa\x19%\xc2\x8e\x82\xe2\xd1\x15\x97B0\x1d\xf9\tA\x0fO?\x7f\x8f\x85<Z(\x96\xb5\xc0Q*\x94'), '\x64' + chr(0b11001 + 0o114) + chr(2916 - 2817) + chr(111) + chr(1388 - 1288) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + '\055' + chr(1815 - 1759)), blOAuBQXwSZC, roI3spqORKae(ES5oEprVxulp(b'\xd6zN(\x89\xb5'), '\144' + chr(4288 - 4187) + '\x63' + chr(7472 - 7361) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(853 - 797)), QmKL0DHo9R7E)
sChW4gUsXrIC += nzTpIcepk0o8('\060' + chr(11639 - 11528) + chr(0b110001), 8)
|
estnltk/estnltk
|
estnltk/syntax/maltparser_support.py
|
_create_clause_based_dep_links
|
def _create_clause_based_dep_links( orig_text, layer=LAYER_CONLL ):
''' Rewrites dependency links in the text from sentence-based linking to clause-
based linking:
*) words which have their parent outside-the-clause will become root
nodes (will obtain link value -1), and
*) words which have their parent inside-the-clause will have parent index
according to word indices inside the clause;
'''
sent_start_index = 0
for sent_text in orig_text.split_by( SENTENCES ):
# 1) Create a mapping: from sentence-based dependency links to clause-based dependency links
mapping = dict()
cl_ind = sent_text.clause_indices
for wid, word in enumerate(sent_text[WORDS]):
firstSyntaxRel = sent_text[layer][wid][PARSER_OUT][0]
parentIndex = firstSyntaxRel[1]
if parentIndex != -1:
if cl_ind[parentIndex] != cl_ind[wid]:
# Parent of the word is outside the current clause: make root
# node from the current node
mapping[wid] = -1
else:
# Find the beginning of the clause
clause_start = cl_ind.index( cl_ind[wid] )
# Find the index of parent label in the clause
j = 0
k = 0
while clause_start + j < len(cl_ind):
if clause_start + j == parentIndex:
break
if cl_ind[clause_start + j] == cl_ind[wid]:
k += 1
j += 1
assert clause_start + j < len(cl_ind), '(!) Parent index not found for: '+str(parentIndex)
mapping[wid] = k
else:
mapping[wid] = -1
# 2) Overwrite old links with new ones
for local_wid in mapping.keys():
global_wid = sent_start_index + local_wid
for syntax_rel in orig_text[layer][global_wid][PARSER_OUT]:
syntax_rel[1] = mapping[local_wid]
# 3) Advance the index for processing the next sentence
sent_start_index += len(cl_ind)
return orig_text
|
python
|
def _create_clause_based_dep_links( orig_text, layer=LAYER_CONLL ):
''' Rewrites dependency links in the text from sentence-based linking to clause-
based linking:
*) words which have their parent outside-the-clause will become root
nodes (will obtain link value -1), and
*) words which have their parent inside-the-clause will have parent index
according to word indices inside the clause;
'''
sent_start_index = 0
for sent_text in orig_text.split_by( SENTENCES ):
# 1) Create a mapping: from sentence-based dependency links to clause-based dependency links
mapping = dict()
cl_ind = sent_text.clause_indices
for wid, word in enumerate(sent_text[WORDS]):
firstSyntaxRel = sent_text[layer][wid][PARSER_OUT][0]
parentIndex = firstSyntaxRel[1]
if parentIndex != -1:
if cl_ind[parentIndex] != cl_ind[wid]:
# Parent of the word is outside the current clause: make root
# node from the current node
mapping[wid] = -1
else:
# Find the beginning of the clause
clause_start = cl_ind.index( cl_ind[wid] )
# Find the index of parent label in the clause
j = 0
k = 0
while clause_start + j < len(cl_ind):
if clause_start + j == parentIndex:
break
if cl_ind[clause_start + j] == cl_ind[wid]:
k += 1
j += 1
assert clause_start + j < len(cl_ind), '(!) Parent index not found for: '+str(parentIndex)
mapping[wid] = k
else:
mapping[wid] = -1
# 2) Overwrite old links with new ones
for local_wid in mapping.keys():
global_wid = sent_start_index + local_wid
for syntax_rel in orig_text[layer][global_wid][PARSER_OUT]:
syntax_rel[1] = mapping[local_wid]
# 3) Advance the index for processing the next sentence
sent_start_index += len(cl_ind)
return orig_text
|
[
"def",
"_create_clause_based_dep_links",
"(",
"orig_text",
",",
"layer",
"=",
"LAYER_CONLL",
")",
":",
"sent_start_index",
"=",
"0",
"for",
"sent_text",
"in",
"orig_text",
".",
"split_by",
"(",
"SENTENCES",
")",
":",
"# 1) Create a mapping: from sentence-based dependency links to clause-based dependency links",
"mapping",
"=",
"dict",
"(",
")",
"cl_ind",
"=",
"sent_text",
".",
"clause_indices",
"for",
"wid",
",",
"word",
"in",
"enumerate",
"(",
"sent_text",
"[",
"WORDS",
"]",
")",
":",
"firstSyntaxRel",
"=",
"sent_text",
"[",
"layer",
"]",
"[",
"wid",
"]",
"[",
"PARSER_OUT",
"]",
"[",
"0",
"]",
"parentIndex",
"=",
"firstSyntaxRel",
"[",
"1",
"]",
"if",
"parentIndex",
"!=",
"-",
"1",
":",
"if",
"cl_ind",
"[",
"parentIndex",
"]",
"!=",
"cl_ind",
"[",
"wid",
"]",
":",
"# Parent of the word is outside the current clause: make root ",
"# node from the current node ",
"mapping",
"[",
"wid",
"]",
"=",
"-",
"1",
"else",
":",
"# Find the beginning of the clause ",
"clause_start",
"=",
"cl_ind",
".",
"index",
"(",
"cl_ind",
"[",
"wid",
"]",
")",
"# Find the index of parent label in the clause",
"j",
"=",
"0",
"k",
"=",
"0",
"while",
"clause_start",
"+",
"j",
"<",
"len",
"(",
"cl_ind",
")",
":",
"if",
"clause_start",
"+",
"j",
"==",
"parentIndex",
":",
"break",
"if",
"cl_ind",
"[",
"clause_start",
"+",
"j",
"]",
"==",
"cl_ind",
"[",
"wid",
"]",
":",
"k",
"+=",
"1",
"j",
"+=",
"1",
"assert",
"clause_start",
"+",
"j",
"<",
"len",
"(",
"cl_ind",
")",
",",
"'(!) Parent index not found for: '",
"+",
"str",
"(",
"parentIndex",
")",
"mapping",
"[",
"wid",
"]",
"=",
"k",
"else",
":",
"mapping",
"[",
"wid",
"]",
"=",
"-",
"1",
"# 2) Overwrite old links with new ones",
"for",
"local_wid",
"in",
"mapping",
".",
"keys",
"(",
")",
":",
"global_wid",
"=",
"sent_start_index",
"+",
"local_wid",
"for",
"syntax_rel",
"in",
"orig_text",
"[",
"layer",
"]",
"[",
"global_wid",
"]",
"[",
"PARSER_OUT",
"]",
":",
"syntax_rel",
"[",
"1",
"]",
"=",
"mapping",
"[",
"local_wid",
"]",
"# 3) Advance the index for processing the next sentence",
"sent_start_index",
"+=",
"len",
"(",
"cl_ind",
")",
"return",
"orig_text"
] |
Rewrites dependency links in the text from sentence-based linking to clause-
based linking:
*) words which have their parent outside-the-clause will become root
nodes (will obtain link value -1), and
*) words which have their parent inside-the-clause will have parent index
according to word indices inside the clause;
|
[
"Rewrites",
"dependency",
"links",
"in",
"the",
"text",
"from",
"sentence",
"-",
"based",
"linking",
"to",
"clause",
"-",
"based",
"linking",
":",
"*",
")",
"words",
"which",
"have",
"their",
"parent",
"outside",
"-",
"the",
"-",
"clause",
"will",
"become",
"root",
"nodes",
"(",
"will",
"obtain",
"link",
"value",
"-",
"1",
")",
"and",
"*",
")",
"words",
"which",
"have",
"their",
"parent",
"inside",
"-",
"the",
"-",
"clause",
"will",
"have",
"parent",
"index",
"according",
"to",
"word",
"indices",
"inside",
"the",
"clause",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/maltparser_support.py#L267-L312
|
train
|
Create dependency links from sentence - based linking to clause - based linking.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJUSN6g,Awc2QmWaiVq8,fPFTJxVnGShv,Kqv3Zaj1M9P0,uKsHT175xV8E,ah0DLMBSEU5j,EsFcqWRT9elq,d9st0HqZDng1,knUxyjfq07F9,Fc8q2OvvlH7d,KSw3AkHkJy1a,JD7LadPikpPw,VwkB9reRDydR,aHxuT4bIDdeg,Qn0k4xGfJpuL,NfwEQ1VKf5DV,WdoB9EK8ABTr,Y1otPTwLRJvi,zsedrPqY_EmW,CJFGX4uBWMak,DB9Ra8FNEf7o,DHq8A6v2Wg4n,Migy1gLCcYvQ,IAGRfZDRyjN_,ze1AhR_jfpze,ej204HIOxzoZ,_1qUu0gKi9gH,Wa8JM2k53wi5,aFaxROHyT7UJ,ZOdpVDJPWn4I,LqOf4dRsAg72,K3alqetBMgas,ZtIuyIq3ta7g,UIHY5MV5X5uS,C60ELahXqfKV,FB4_7GjVy3pW,wXIYU_4UfQFa,jZIjKu8IFANs,REazVyvp6OIp,pZy5DBJ8WJod,aP29ipGsOVzf,YikXQdxs3VoO,UBvEeZympYSz,mRTjFWUmjlQA,QhZRiM1qvaW7,WbNHlDKpyPtQ,z18h6aCn31dg,oxjHmqoBrCHG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uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(0b1011101 + 0o22) + chr(0b110011) + chr(0b1110 + 0o46) + chr(0b11 + 0o62), 0o10), nzTpIcepk0o8('\x30' + chr(6968 - 6857) + chr(1044 - 994) + chr(0b11101 + 0o27) + chr(0b110001), 22959 - 22951), nzTpIcepk0o8(chr(48) + chr(111) + '\x33' + '\x34' + chr(0b110010), 0o10), nzTpIcepk0o8(chr(1524 - 1476) + chr(0b11100 + 0o123) + chr(1410 - 1359) + '\066' + '\060', 0b1000), nzTpIcepk0o8(chr(109 - 61) + '\157' + chr(2189 - 2139) + '\064' + chr(0b110011), 55059 - 55051), nzTpIcepk0o8('\x30' + chr(10365 - 10254) + chr(1059 - 1008) + chr(983 - 930), 0o10), nzTpIcepk0o8(chr(0b11001 + 0o27) + '\x6f' + chr(51) + chr(695 - 642) + chr(0b110100), 0b1000), nzTpIcepk0o8('\060' + chr(0b1011011 + 0o24) + chr(1234 - 1185) + chr(54) + '\063', 47772 - 47764), nzTpIcepk0o8(chr(48) + '\x6f' + '\x35' + '\x37', 0o10), nzTpIcepk0o8(chr(0b1111 + 0o41) + chr(111) + chr(51) + chr(0b110010) + '\065', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + '\064', 0o10), nzTpIcepk0o8('\x30' + '\157' + '\061' + chr(0b100010 + 0o16) + chr(0b110000), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + chr(0b100000 + 0o117) + chr(51) + chr(0b11110 + 0o27) + '\x32', ord("\x08")), nzTpIcepk0o8('\x30' + '\157' + chr(49) + chr(0b100 + 0o62) + '\x32', 0b1000), nzTpIcepk0o8(chr(48) + chr(111) + '\063' + chr(0b110010) + chr(0b110010), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(327 - 276) + chr(0b101000 + 0o16) + '\067', 0o10), nzTpIcepk0o8('\060' + '\157' + chr(0b110001) + chr(0b110110), 59560 - 59552), nzTpIcepk0o8(chr(48) + chr(111) + chr(0b1110 + 0o51), 12277 - 12269), nzTpIcepk0o8(chr(0b11011 + 0o25) + chr(0b1101100 + 0o3) + chr(1976 - 1927) + '\061', 0b1000), nzTpIcepk0o8('\060' + '\x6f' + '\061' + chr(0b110111) + chr(0b110 + 0o60), 53813 - 53805), nzTpIcepk0o8(chr(0b110000) + chr(111) + chr(1626 - 1577) + '\067', 39223 - 39215), nzTpIcepk0o8('\x30' + chr(0b1101111) + '\x31' + chr(55) + chr(0b110111), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b100010 + 0o17) + '\067' + '\x32', 29644 - 29636), nzTpIcepk0o8(chr(2227 - 2179) + '\157' + chr(50) + chr(646 - 591) + '\x32', 44509 - 44501), nzTpIcepk0o8(chr(48) + chr(0b101010 + 0o105) + '\062' + '\064' + chr(0b110101), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(0b110011) + chr(50) + chr(498 - 450), 0o10), nzTpIcepk0o8('\x30' + chr(111) + '\x31' + chr(51) + chr(2287 - 2238), ord("\x08")), nzTpIcepk0o8(chr(0b1000 + 0o50) + chr(0b1101111) + chr(1868 - 1818) + chr(0b110110) + chr(0b110100), 7380 - 7372), nzTpIcepk0o8(chr(0b100110 + 0o12) + chr(7182 - 7071) + '\x32' + chr(0b110101) + '\x30', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b1101111) + '\x32' + '\060' + chr(49), 0o10), nzTpIcepk0o8(chr(0b100 + 0o54) + '\x6f' + '\x32' + chr(1388 - 1339), 0o10), nzTpIcepk0o8(chr(48) + chr(111) + '\062' + chr(0b11001 + 0o33), ord("\x08")), nzTpIcepk0o8(chr(390 - 342) + chr(0b1101111) + '\061' + chr(53) + chr(0b110110), ord("\x08")), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(0b1010 + 0o47) + chr(1415 - 1366) + chr(2262 - 2212), 25197 - 25189), nzTpIcepk0o8(chr(0b110000) + chr(2126 - 2015) + chr(0b100101 + 0o14) + chr(51), ord("\x08")), nzTpIcepk0o8(chr(0b11010 + 0o26) + chr(11535 - 11424) + chr(0b110010) + chr(0b110101) + chr(52), ord("\x08")), nzTpIcepk0o8('\x30' + '\x6f' + chr(0b1001 + 0o52) + chr(0b110111) + chr(0b11101 + 0o23), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x31' + chr(2215 - 2164), 8), nzTpIcepk0o8(chr(1137 - 1089) + chr(0b1010100 + 0o33) + chr(49) + chr(0b1101 + 0o45) + '\064', 46177 - 46169), nzTpIcepk0o8(chr(0b111 + 0o51) + chr(7869 - 7758) + chr(1142 - 1093) + '\x36' + chr(51), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(48) + '\x6f' + chr(0b101101 + 0o10) + '\060', 65021 - 65013)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b'\xcb'), '\x64' + chr(0b101110 + 0o67) + chr(0b1100011) + chr(0b1001000 + 0o47) + chr(0b1001100 + 0o30) + '\145')(chr(3166 - 3049) + chr(5558 - 5442) + '\146' + '\x2d' + chr(0b111000)) + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def vyQoKcKg7X0u(CvxpFhuAK9VA, GHz9Ad9ZLlU5=XGRJklmxieCQ):
sgrs8RQVnT7H = nzTpIcepk0o8(chr(1480 - 1432) + '\x6f' + chr(1293 - 1245), 65290 - 65282)
for vMvP6QU9bh4B in roI3spqORKae(CvxpFhuAK9VA, roI3spqORKae(ES5oEprVxulp(b'\x96\xd1\x8e\x99\xd7B\x8e\n'), chr(0b111001 + 0o53) + '\x65' + '\143' + chr(0b1101111) + chr(0b1100100) + chr(630 - 529))(chr(0b1110101) + chr(9053 - 8937) + '\146' + chr(45) + '\x38'))(DUoBUczr5TtH):
lq9M6RYMdyT1 = znjnJWK64FDT()
lqoxOz8Fj09g = vMvP6QU9bh4B.clause_indices
for (IKFdte6kz0Ez, JXVFyF8k4nGR) in _kV_Bomx8PZ4(vMvP6QU9bh4B[dwqZnwPLrnLJ]):
RkYfe1Wwzi7r = vMvP6QU9bh4B[GHz9Ad9ZLlU5][IKFdte6kz0Ez][v_R2BDa6ICLe][nzTpIcepk0o8(chr(0b110000) + '\157' + chr(48), 8)]
UavvEFQVS8cA = RkYfe1Wwzi7r[nzTpIcepk0o8(chr(48) + '\157' + chr(99 - 50), 20645 - 20637)]
if UavvEFQVS8cA != -nzTpIcepk0o8(chr(48) + '\157' + '\061', 8):
if lqoxOz8Fj09g[UavvEFQVS8cA] != lqoxOz8Fj09g[IKFdte6kz0Ez]:
lq9M6RYMdyT1[IKFdte6kz0Ez] = -nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(1634 - 1585), 8)
else:
ce0mDBeAmaPv = lqoxOz8Fj09g.ZpfN5tSLaZze(lqoxOz8Fj09g[IKFdte6kz0Ez])
sChW4gUsXrIC = nzTpIcepk0o8('\x30' + chr(111) + chr(0b110000), 8)
B6UAF1zReOyJ = nzTpIcepk0o8(chr(0b1001 + 0o47) + chr(7761 - 7650) + '\x30', 8)
while ce0mDBeAmaPv + sChW4gUsXrIC < ftfygxgFas5X(lqoxOz8Fj09g):
if ce0mDBeAmaPv + sChW4gUsXrIC == UavvEFQVS8cA:
break
if lqoxOz8Fj09g[ce0mDBeAmaPv + sChW4gUsXrIC] == lqoxOz8Fj09g[IKFdte6kz0Ez]:
B6UAF1zReOyJ += nzTpIcepk0o8(chr(0b110000) + chr(11963 - 11852) + '\x31', 8)
sChW4gUsXrIC += nzTpIcepk0o8(chr(0b110000) + chr(11340 - 11229) + chr(49), 8)
assert ce0mDBeAmaPv + sChW4gUsXrIC < ftfygxgFas5X(lqoxOz8Fj09g), roI3spqORKae(ES5oEprVxulp(b'\xcd\x80\xcb\xd0\xf3|\x9e\x16A\xa1$)\x84\x16\xb7\x8f.if\n/\x19\x15\xcf\xcb\xb4y\xd2\xc7\xf3+4'), chr(3736 - 3636) + '\145' + chr(0b1100011) + chr(0b1001100 + 0o43) + chr(100) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(3528 - 3426) + '\055' + '\x38') + N9zlRy29S1SS(UavvEFQVS8cA)
lq9M6RYMdyT1[IKFdte6kz0Ez] = B6UAF1zReOyJ
else:
lq9M6RYMdyT1[IKFdte6kz0Ez] = -nzTpIcepk0o8(chr(0b10011 + 0o35) + chr(0b1101111) + '\x31', 8)
for HuBmCDEEYVaq in roI3spqORKae(lq9M6RYMdyT1, roI3spqORKae(ES5oEprVxulp(b'\x8e\xc4\x9b\x83'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + chr(2454 - 2354) + '\145')(chr(0b1110101) + '\164' + '\146' + chr(0b101101) + '\x38'))():
FdFoHU7cQjsh = sgrs8RQVnT7H + HuBmCDEEYVaq
for S047KQUlKRDh in CvxpFhuAK9VA[GHz9Ad9ZLlU5][FdFoHU7cQjsh][v_R2BDa6ICLe]:
S047KQUlKRDh[nzTpIcepk0o8(chr(48) + chr(0b1101010 + 0o5) + chr(0b110001), 8)] = lq9M6RYMdyT1[HuBmCDEEYVaq]
sgrs8RQVnT7H += ftfygxgFas5X(lqoxOz8Fj09g)
return CvxpFhuAK9VA
|
estnltk/estnltk
|
estnltk/syntax/maltparser_support.py
|
__sort_analyses
|
def __sort_analyses(sentence):
''' Sorts analysis of all the words in the sentence.
This is required for consistency, because by default, analyses are
listed in arbitrary order; '''
for word in sentence:
if ANALYSIS not in word:
raise Exception( '(!) Error: no analysis found from word: '+str(word) )
else:
word[ANALYSIS] = sorted(word[ANALYSIS], \
key=lambda x : "_".join( [x[ROOT],x[POSTAG],x[FORM],x[CLITIC]] ))
return sentence
|
python
|
def __sort_analyses(sentence):
''' Sorts analysis of all the words in the sentence.
This is required for consistency, because by default, analyses are
listed in arbitrary order; '''
for word in sentence:
if ANALYSIS not in word:
raise Exception( '(!) Error: no analysis found from word: '+str(word) )
else:
word[ANALYSIS] = sorted(word[ANALYSIS], \
key=lambda x : "_".join( [x[ROOT],x[POSTAG],x[FORM],x[CLITIC]] ))
return sentence
|
[
"def",
"__sort_analyses",
"(",
"sentence",
")",
":",
"for",
"word",
"in",
"sentence",
":",
"if",
"ANALYSIS",
"not",
"in",
"word",
":",
"raise",
"Exception",
"(",
"'(!) Error: no analysis found from word: '",
"+",
"str",
"(",
"word",
")",
")",
"else",
":",
"word",
"[",
"ANALYSIS",
"]",
"=",
"sorted",
"(",
"word",
"[",
"ANALYSIS",
"]",
",",
"key",
"=",
"lambda",
"x",
":",
"\"_\"",
".",
"join",
"(",
"[",
"x",
"[",
"ROOT",
"]",
",",
"x",
"[",
"POSTAG",
"]",
",",
"x",
"[",
"FORM",
"]",
",",
"x",
"[",
"CLITIC",
"]",
"]",
")",
")",
"return",
"sentence"
] |
Sorts analysis of all the words in the sentence.
This is required for consistency, because by default, analyses are
listed in arbitrary order;
|
[
"Sorts",
"analysis",
"of",
"all",
"the",
"words",
"in",
"the",
"sentence",
".",
"This",
"is",
"required",
"for",
"consistency",
"because",
"by",
"default",
"analyses",
"are",
"listed",
"in",
"arbitrary",
"order",
";"
] |
28ae334a68a0673072febc318635f04da0dcc54a
|
https://github.com/estnltk/estnltk/blob/28ae334a68a0673072febc318635f04da0dcc54a/estnltk/syntax/maltparser_support.py#L315-L325
|
train
|
Sorts all the analyses in the sentence.
|
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF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XqZE,_kV_Bomx8PZ4,Z5xOfqIptFuc,_9cznYtBZk6k,ZurjcUL1ssA8,qEahrGEDF7Tq,jLW6pRf2DSRk,q33KG3foQ_CJ,PNaRkv8AjHWU,roI3spqORKae,CFUos7dinCa7,dRKdVnHPFq7C,dMJNtLk2mncQ,Mq8h41ilRngb,vgO67Nkl7Kt9,maLnLg8O5zPT,QnTXOd5N96r1,nzTpIcepk0o8,suIjIS24Zkqw,CmsH_0IVxIiZ,b8MSkfijeeBr,ftfygxgFas5X,xM0vTMWcJQBa,H4NoA26ON7iG,y0cCpS6dh4OT,VVP82lOIz6CD,KV9ckIhroIia,D2M3XQk26HKr,XURpmPuEWCNF,ltB3XhPy2rYf,mxgO6GAb3Xup,llEg6op6Lr8F,DnU3Rq9N5ala,RmKXV0QRcrJP,JEroPXRTriYU,v8jsMqaYV6U2,X1QyyvXSAOQt,PWTqT_PKIfuW,bbT2xIe5pzk7,VWshwTzZfwvC,DoS4vLAglV8A,sOS7b2Ofrbne,Bvi71nNyvlqO,lCf1uzpaIUMv,nDEnDEV3Lc5Z,V3OlOVg98A85,WsP3Nc3n6e0b,N9zlRy29S1SS,oclC8DLjA_lV,CO2YiXoIEhJY,nfNqtJL5aRaY,MJ07XsN5uFgW,cL4sFo6RhVJa,TxMFWa_Xzviv,bpTSxj4JFQ8o,zL_YcxPEZPhm,yfEeqQiUoqWT,OHWDi_URd_WF,NKGkaWkPPkT2,AYtDRlqeP0tq,vQqJeSQfHM0X,FUdwyfT9sfj2=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
ES5oEprVxulp = lambda R7ltlgvcKSD4: QNQS9e6tJqMV([bI5jsQ9OkQtj ^ [nzTpIcepk0o8(chr(0b110000) + chr(0b1010100 + 0o33) + '\061' + '\063' + chr(0b110010), 58671 - 58663), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(51) + chr(0b101001 + 0o10) + '\x37', ord("\x08")), nzTpIcepk0o8('\060' + '\157' + chr(52) + chr(50), 50796 - 50788), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x32' + chr(0b1111 + 0o41) + chr(49), 0o10), nzTpIcepk0o8('\x30' + chr(7887 - 7776) + '\x33' + '\060' + chr(0b1000 + 0o51), 8292 - 8284), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(0b101001 + 0o11) + chr(54) + chr(0b101010 + 0o11), 63119 - 63111), nzTpIcepk0o8(chr(0b110000) + '\157' + '\062' + '\061' + '\x34', ord("\x08")), nzTpIcepk0o8(chr(0b1100 + 0o44) + '\157' + chr(0b100100 + 0o17) + chr(0b110001), ord("\x08")), nzTpIcepk0o8(chr(0b1011 + 0o45) + chr(170 - 59) + chr(0b110001) + '\x34' + '\x35', 43499 - 43491), nzTpIcepk0o8(chr(0b110000) + '\x6f' + chr(50) + chr(0b110000) + chr(0b100110 + 0o16), ord("\x08")), nzTpIcepk0o8(chr(0b110000 + 0o0) + '\157' + chr(50) + chr(0b110100), 0b1000), nzTpIcepk0o8(chr(858 - 810) + chr(0b1000011 + 0o54) + chr(0b10101 + 0o36) + chr(1014 - 960) + chr(0b110001), 0b1000), nzTpIcepk0o8('\060' + chr(0b1010 + 0o145) + chr(0b110001) + chr(55) + chr(133 - 84), 0o10), nzTpIcepk0o8('\060' + chr(0b1101111) + chr(50) + '\x32' + '\061', 0b1000), nzTpIcepk0o8(chr(0b101101 + 0o3) + chr(0b1101111) + chr(51) + '\x37' + '\061', ord("\x08")), nzTpIcepk0o8(chr(48) + chr(0b1101111) + '\x31' + '\x33' + chr(0b110100), 40502 - 40494), nzTpIcepk0o8(chr(166 - 118) + chr(0b1101111) + chr(0b100101 + 0o20) + '\x34', ord("\x08")), nzTpIcepk0o8(chr(48) + '\157' + chr(54) + '\x34', 0o10), nzTpIcepk0o8(chr(0b110000) + chr(0b111001 + 0o66) + '\063' + chr(0b110100) + chr(53), ord("\x08")), nzTpIcepk0o8(chr(0b1101 + 0o43) + '\x6f' + chr(0b11101 + 0o25) + chr(0b1 + 0o60) + chr(0b1101 + 0o52), 0b1000), nzTpIcepk0o8(chr(0b110000) + '\157' + '\x32' + chr(48) + chr(53), 0o10), nzTpIcepk0o8(chr(0b110000) + '\157' + chr(51) + chr(0b100001 + 0o22) + chr(0b110000), 0b1000), nzTpIcepk0o8(chr(2245 - 2197) + chr(9611 - 9500) + '\062' + '\062' + '\063', 0b1000), nzTpIcepk0o8('\060' + '\157' + chr(0b11100 + 0o26) + chr(0b110111) + chr(1228 - 1179), 64340 - 64332), nzTpIcepk0o8('\060' + chr(111) + chr(1937 - 1888) + chr(50) + chr(2295 - 2247), 0b1000), nzTpIcepk0o8('\x30' + chr(0b1011111 + 0o20) + chr(1268 - 1218) + chr(212 - 162) + chr(0b110010), ord("\x08")), nzTpIcepk0o8(chr(0b101 + 0o53) + chr(111) + chr(0b110010) + chr(312 - 257), 0b1000), nzTpIcepk0o8(chr(2212 - 2164) + '\157' + chr(1002 - 951) + '\060' + chr(0b110011), ord("\x08")), nzTpIcepk0o8('\060' + chr(7227 - 7116) + chr(49) + chr(0b10001 + 0o40) + '\x30', 0b1000), nzTpIcepk0o8('\060' + chr(0b101 + 0o152) + chr(907 - 858) + chr(0b110111) + chr(51), 0o10), nzTpIcepk0o8(chr(0b100001 + 0o17) + '\x6f' + chr(49) + chr(2245 - 2193) + chr(2755 - 2701), ord("\x08")), nzTpIcepk0o8(chr(0b110000) + '\x6f' + '\x33' + chr(0b110111), ord("\x08")), nzTpIcepk0o8('\060' + chr(8624 - 8513) + chr(50) + chr(1427 - 1378) + '\x33', ord("\x08")), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + '\063', 0b1000), nzTpIcepk0o8('\x30' + chr(0b1101111) + chr(2206 - 2154) + '\x35', 0b1000), nzTpIcepk0o8(chr(48) + '\x6f' + '\x32' + '\066' + chr(232 - 180), 0b1000), nzTpIcepk0o8('\060' + chr(0b100001 + 0o116) + chr(482 - 431) + chr(48) + chr(0b110011), 8), nzTpIcepk0o8(chr(0b101110 + 0o2) + '\x6f' + chr(0b100101 + 0o15) + '\x33' + '\x34', 0b1000), nzTpIcepk0o8(chr(48) + chr(0b1101111) + chr(49) + chr(0b110110) + '\x31', 0b1000), nzTpIcepk0o8('\x30' + '\x6f' + '\x32' + chr(52), 8)][ZlbFMSG8gCoF % nzTpIcepk0o8(chr(1608 - 1560) + '\157' + '\065' + '\x30', 0o10)] for (ZlbFMSG8gCoF, bI5jsQ9OkQtj) in _kV_Bomx8PZ4(R7ltlgvcKSD4)])
def rFFUeiYWzOhx(pOp6HxxfV61L, pXRQUD7VR93J):
try:
return zGgTE_CdZfvi(pOp6HxxfV61L + roI3spqORKae(ES5oEprVxulp(b't'), chr(100) + chr(0b1100101) + chr(7542 - 7443) + chr(7268 - 7157) + chr(100) + chr(0b1100101))(chr(7455 - 7338) + chr(0b111110 + 0o66) + chr(0b1100110) + '\x2d' + '\x38') + pXRQUD7VR93J)
except fPFTJxVnGShv:
return zGgTE_CdZfvi(pOp6HxxfV61L)
def xAPYjAiYZFvg(v3YfwzoUholR):
for JXVFyF8k4nGR in v3YfwzoUholR:
if otAw_H2b5sjH not in JXVFyF8k4nGR:
raise zfo2Sgkz3IVJ(roI3spqORKae(ES5oEprVxulp(b'r\xee\x0b\xa1\x84\xc1\xfev\x17\xbe4\x9f\x16\xb1\x982MX\x9c\xfc\xec\xab\xb3\xdf?\xe7y\xa7h\x1d\x14p\xe63R\xdb\xb1\xf8K4'), chr(0b1100100) + '\145' + chr(0b11010 + 0o111) + '\x6f' + '\144' + chr(101))('\165' + chr(116) + chr(102) + '\055' + chr(0b111000)) + N9zlRy29S1SS(JXVFyF8k4nGR))
else:
JXVFyF8k4nGR[otAw_H2b5sjH] = V3OlOVg98A85(JXVFyF8k4nGR[otAw_H2b5sjH], key=lambda bI5jsQ9OkQtj: roI3spqORKae(ES5oEprVxulp(b'\x05'), chr(8497 - 8397) + '\x65' + chr(0b1100011) + '\x6f' + chr(100) + chr(101))(chr(0b1100110 + 0o17) + '\x74' + '\146' + '\055' + chr(56)).Y4yM9BcfTCNq([bI5jsQ9OkQtj[XsvoTOpX8A2b], bI5jsQ9OkQtj[QivUjX90e7n8], bI5jsQ9OkQtj[invlgHm8TzbV], bI5jsQ9OkQtj[wh2l35lgVgt0]]))
return v3YfwzoUholR
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.