コード例 #1
0
ファイル: phrases.py プロジェクト: BHX2/BottlenoseDB
 def __init__(self, name):
   self.isVerb = False
   if re.match('.*\*$', name.strip()):
     name = name[:-1]
   if not utilities.sanitize(name).istitle():
     type = utilities.sanitize(name).split()[-1]
   else:
     type = None
   Concept.__init__(self, name, type)
コード例 #2
0
ファイル: phrases.py プロジェクト: BHX2/BottlenoseDB
 def __init__(self, name):
   self.isVerb = False
   quantitative = re.search('^[0-9.]+', name)
   if not quantitative:
     quantitative = re.search('^-[0-9.]+', name)
   if quantitative:
     self.quantity = float(quantitative.group(0))
     self.isQuantity = True
     type = 'quantity'
   else:
     self.quantity = None
     self.isQuantity = False
     type = name
   Concept.__init__(self, name, type)
コード例 #3
0
ファイル: phrases.py プロジェクト: BHX2/BottlenoseDB
 def __init__(self, name):
   self.isVerb = True
   type = str(utilities.sanitize(name).split()[0])
   Concept.__init__(self, name, type)