-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.py
More file actions
49 lines (37 loc) · 1.59 KB
/
Copy pathApplication.py
File metadata and controls
49 lines (37 loc) · 1.59 KB
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
42
43
44
45
46
47
48
49
#!/usr/bin/env python
import tornado.web
from Regex_Handler import Regex_Handler
from Settings import Settings
from Modules.Dictionary import Dictionary
from Modules.Context import Context
class Application(tornado.web.Application):
def __init__(self):
tornado.web.Application.__init__(self, Regex_Handler, **Settings)
self.__CoreDict = Dictionary("CoreDict.dct")
self.__BiGramDict = Dictionary("BiGramDict.dct")
self.__LexicalContext = Context("LexicalContext.ctx")
self.__PlaceDict = Dictionary("PlaceDict.dct")
self.__PlaceContext = Context("PlaceContext.ctx")
self.__PersonDict = Dictionary("PersonDict.dct")
self.__PersonContext = Context("PersonContext.ctx")
self.__ForeignPersonDict = Dictionary("ForeignPersonDict.dct")
self.__ForeignPersonContext = Context("ForeignPersonContext.ctx")
self.__DictionarySet = dict(
CoreDict = self.__CoreDict,
BiGramDict = self.__BiGramDict,
PlaceDict = self.__PlaceDict,
PersonDict = self.__PersonDict,
ForeignPersonDict = self.__ForeignPersonDict,
)
self.__ContextSet = dict(
PlaceContext = self.__PlaceContext,
PersonContext = self.__PersonContext,
ForeignPersonContext = self.__ForeignPersonContext,
LexicalContext = self.__LexicalContext
)
@property
def DictionarySet(self):
return self.__DictionarySet
@property
def ContextSet(self):
return self.__ContextSet