def testJSTranlation_JS_To_Python_SerializableSubclass2(self): sObj = executeJS("SerializableTestClass2.js", self.jsdir, getBasePath()) token = makeNative(sObj) x = untokenizeObject(token) self.assertIsInstance(x, TestClass2) self.assertEqual(type(x), TestClass2) self.assertEqual(x._statement, "AAA")
def testJSTranlation_JS_To_Python_BasicSerializable(self): sObj = executeJS("SerializableTestClass0.js", self.jsdir, getBasePath()) token = makeNative(sObj) x = untokenizeObject(token) self.assertIsInstance(x, Serializable) self.assertEqual(type(x), Serializable)
def testJSTranlation_JS_To_Python_Serializable_UndefVal(self): sObj = executeJS("SerializableTestClassUndef.js", self.jsdir, getBasePath()) token = makeNative(sObj) x = untokenizeObject(token) self.assertIsInstance(x, TestClass) self.assertEqual(type(x), TestClass) self.assertIsNone(x._value)
def __init__(self): self._regexBank = [] SynFile = os.path.join(getBasePath(),'AWS_Core_Services', 'TextProcessing','syn.txt') with open(SynFile, 'rb') as aFile: for line in aFile.readlines(): aSet = line.strip().lower() aSet = set(aSet.split(self.DELIM)) aSet.remove('') self._regexBank.append(aSet)
def __init__(self): self._regexBank = [] SynFile = os.path.join(getBasePath(), 'AWS_Core_Services', 'TextProcessing', 'syn.txt') with open(SynFile, 'rb') as aFile: for line in aFile.readlines(): aSet = line.strip().lower() aSet = set(aSet.split(self.DELIM)) aSet.remove('') self._regexBank.append(aSet)
def __init__(self, mappings=None, filePath=None, fileName='Dictionary.csv'): if filePath is None: filePath = os.path.join(getBasePath(), *self.DEFAULT_PATH) fileName = os.path.join(filePath, fileName) if mappings is None: mappings = (FormulaStringParser(), PhraseMapping(fileName), NumbersMapping()) self._mappings = mappings