-
Notifications
You must be signed in to change notification settings - Fork 23
/
html.py
41 lines (32 loc) · 994 Bytes
/
html.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
try:
import expand_to_word
import expand_to_subword
import expand_to_quotes
import expand_to_xml_node
except:
from . import expand_to_word
from . import expand_to_subword
from . import expand_to_quotes
from . import expand_to_xml_node
def expand(string, start, end):
expand_stack = []
expand_stack.append("subword")
result = expand_to_subword.expand_to_subword(string, start, end)
if result:
result["expand_stack"] = expand_stack
return result
expand_stack.append("word")
result = expand_to_word.expand_to_word(string, start, end)
if result:
result["expand_stack"] = expand_stack
return result
expand_stack.append("quotes")
result = expand_to_quotes.expand_to_quotes(string, start, end)
if result:
result["expand_stack"] = expand_stack
return result
expand_stack.append("xml_node")
result = expand_to_xml_node.expand_to_xml_node(string, start, end)
if result:
result["expand_stack"] = expand_stack
return result