Esempio n. 1
0
    def __init__(self, handler):
        Parser.__init__(self, handler)

        ## ul, li 列表处理
        self.addRule(ListRule())
        self.addRule(ListItemRule())

        ## 文章标题处理
        self.addRule(TitleRule())

        ## 一级标题
        self.addRule(Header1Rule())

        ## 普通段落处理
        self.addRule(ParagraphRule())

        ###############################################################
        ##                        特殊标记处理
        ###############################################################
        
        ## 斜体
        self.addFilter(r'\*(.+?)\*', 'emphasis')
        ## url
        self.addFilter(r'(http://[\.a-zA-Z/]+)', 'url')
        ## email
        self.addFilter(r'([\.a-zA-Z]+@[\.a-zA-Z]+[a-zA-z]+)', 'mail')
Esempio n. 2
0
    def __init__(self, it, reporter):
        self.b = ['\n{']
        self.comments = False
        self.inSimutaneous = False

        # keep track of list indexing, for commas
        self.first = True
        Parser.__init__(self, it, reporter)
Esempio n. 3
0
 def __init__(self):
     """ Load the shared BIN grammar if not already there, then initialize
         the Parser parent class """
     g = BIN_Parser._grammar
     if g is None:
         g = Grammar()
         g.read("Reynir.grammar")
         BIN_Parser._grammar = g
     Parser.__init__(self, g)
Esempio n. 4
0
    def __init__(self, handler):
        Parser.__init__(self, handler)
        self.addRule(ListRule())
        self.addRule(ListItemRule())
        self.addRule(TitleRule())
        self.addRule(HeadingRule())
        self.addRule(ParagraphRule())

        self.addFilter(r'\*(.+?)\*', 'emphasis')
        self.addFilter(r'(http://[\.a-zA-Z/]+)', 'url')
        self.addFilter(r'([\.a-zA-Z]+@[\.a-zA-Z]+[a-zA-Z]+)', 'mail')
Esempio n. 5
0
 def __init__(self,
              start_sym,
              grammar,
              scanner,
              dictionaries=None,
              debug=False):
     Parser.__init__(self, start_sym, grammar, scanner.tokens.keys())
     self.scanner = scanner
     self.dictionaries = dictionaries or {}
     self.results = []
     self.debug_mode = debug
Esempio n. 6
0
 def __init__(self, verbose, repository_tag, repository_chunk, airr_map, repository):
     # Initialize the base class
     Parser.__init__(self, verbose, repository_tag, repository_chunk, airr_map, repository)
     # Each rearrangement parser is used to parse data from an annotation tool.
     # This keeps track of the annotation tool being used and is used
     # to insert annotation tool information into the repository.
     # Subclasses that process data files from a specific type of 
     # annotation tool should set this value.
     # This is only used for rearrangement files.
     self.annotation_tool = ""
     # Each file has fields in it. This variable holds the mapping column
     # from the AIRR Mapping file to use for this parser. Again, subclasses
     # for specific file types should explicitly set this to the correct
     # column.
     self.file_mapping = ""
Esempio n. 7
0
 def __init__(self, module_properties):
   Parser.__init__(self)
   self._m = 0
   if module_properties.has_key('hash_dimensions'):
       self._m = int(module_properties['hash_dimensions'])
   self._regular_features = 4
Esempio n. 8
0
 def __init__(self, it, reporter):
     self.b = []
     self.tree = Score()
     Parser.__init__(self, it, reporter)
Esempio n. 9
0
 def __init__(self):
     Parser.__init__(self)
     self.last_chunk_name = None
Esempio n. 10
0
 def __init__(self):
     self.site = 'lashou'
     Parser.__init__(self)
Esempio n. 11
0
 def __init__(self, logger):
     Parser.__init__(self, logger)
Esempio n. 12
0
 def __init__(self):
     self.site = 'nuomi'
     Parser.__init__(self)
Esempio n. 13
0
 def __init__(self, tokens):
   Parser.__init__(self, [t for t in tokens if t.type is not WSPACE])
Esempio n. 14
0
 def __init__(self, input_lexer, k):
     Parser.__init__(self, input_lexer, k)
Esempio n. 15
0
 def __init__(self, input_file):
     # call the base class constructor
     Parser.__init__(self, input_file)
     logging.debug("Yml parser initialized")
Esempio n. 16
0
 def __init__(self, logger=None):
     Parser.__init__(self, logger)
Esempio n. 17
0
 def __init__(self):
     self.site = 'meituan'
     Parser.__init__(self)
Esempio n. 18
0
 def __init__(self, start_sym, grammar, scanner, dictionaries=None, debug=False):
     Parser.__init__(self, start_sym, grammar, scanner.tokens.keys())
     self.scanner = scanner
     self.dictionaries = dictionaries or {}
     self.results = []
     self.debug_mode = debug
 def __init__(self,fileName):
     Parser.__init__(self,fileName)
Esempio n. 20
0
 def __init__(self):
     Parser.__init__(self, logger=Logger())
Esempio n. 21
0
 def __init__(self, settings, language):
     Parser.__init__(self, settings, language)
     self.meaning = 0
Esempio n. 22
0
File: moc.py Progetto: phuang/rob
 def __init__(self):
   Parser.__init__(self)
Esempio n. 23
0
 def __init__(self, tokens):
     Parser.__init__(self, [t for t in tokens if t.type is not WSPACE])
Esempio n. 24
0
 def __init__(self, settings, language):
     Parser.__init__(self, settings, language)
Esempio n. 25
0
 def __init__(self, rules):
     Parser.__init__(self, rules)
Esempio n. 26
0
 def __init__(self, _ext):
     Parser.__init__(self)
     self.ext = _ext
     self.links = []
 def __init__(self, verbose, repository_tag, repository_chunk, airr_map, repository):
     Parser.__init__(self, verbose, repository_tag, repository_chunk, airr_map, repository)
Esempio n. 28
0
 def __init__(self, fileName):
     Parser.__init__(self, fileName)
Esempio n. 29
0
	def __init__(self, logger=None):
		Parser.__init__(self, logger)
		self.laparams.char_margin = 1.0
		self.first_section = True
Esempio n. 30
0
 def __init__(self):
     self.site = 'dianping'
     Parser.__init__(self)
 def __init__(self, input_lexer):
     Parser.__init__(self, input_lexer)
     self.list_memo = {}