def setUp(self): WithTempDir.setUp(self) self.matrix = [[0.0, 0.5, 0.67, 0.8, 0.2], [0.5, 0.0, 0.4, 0.7, 0.6], [0.67, 0.4, 0.0, 0.8, 0.8], [0.8, 0.7, 0.8, 0.0, 0.3], [0.2, 0.6, 0.8, 0.3, 0.0]] self.taxa = ['German', 'Swedish', 'Icelandic', 'English', 'Dutch']
def setUp(self): WithTempDir.setUp(self) self.part = Partial(test_data('partial_cognates.tsv'), segments='segments', split_on_tones=True) self.part2 = Partial(test_data('partial_cognates-scored.tsv'), segments='segments')
def setUp(self): WithTempDir.setUp(self) self.gls = [('Haerbin', 0), ('Beijing', 0), ('Xi’an', 0), ('Lanzhou', 0), ('Kunming', 1), ('Tianjin', 0), ('edge.13', 1), ('edge.11', 0)] self.scenarios = [['p1', self.gls], [ 'p2', [('Taiyuan', 0), ('Nanning', 0), ('Wenzhou', 0), ('Lanzhou', 0), ('edge.24', 0), ('Pingyao', 0), ('Jinan', 1), ('edge.6', 0), ('Kunming', 0), ('Zhengzhou', 0), ('Xi’an', 0), ('edge.10', 0), ('edge.14', 0), ('Shexian', 0), ('edge.26', 1), ('Suzhou', 0)] ]] self.tree = "((((((((Taiyuan,Pingyao,Huhehaote)," \ "((((Xi’an,Xining,Zhengzhou)," \ "(Lanzhou,Yinchuan,Wulumuqi))," \ "(((Tianjin,Jinan),Qingdao),Beijing,Haerbin))," \ "(((Guiyang,Kunming),Chengdu,Wuhan)," \ "(Nanjing,Hefei)))),(Xiangtan,Changsha)),Nanchang)," \ "(Shexian,Tunxi)),((Shanghai,Suzhou,Hangzhou),Wenzhou))," \ "(((Xianggang,Guangzhou),Nanning),(Meixian,Taoyuan)))," \ "((((Xiamen,Taibei),Shantou,Haikou),Fuzhou),Jian’ou));"
def setUp(self): WithTempDir.setUp(self) self.lex = LexStat(test_data('KSL.qlc')) self.part = Partial(test_data('partial_cognates.tsv'), segments='segments') self.part.add_entries('pid1', 'partial_cognate_sets', lambda x: x) self.part.add_entries('pid2', 'partialids2', lambda x: [int(y) for y in x.split(' ')])
def setUp(self): WithTempDir.setUp(self) self.hlc = link_clustering.HLC( { "a": set(["b", "c"]), "b": set(["c"]), "c": set(["a"]) }, set([("a", "b"), ("b", "c"), ("a", "c")]))
def setUp(self): WithTempDir.setUp(self) self.hlc = link_clustering.HLC( { "a": {"b", "c"}, "b": {"c"}, "c": {"a"} }, {("a", "b"), ("b", "c"), ("a", "c")})
def setUp(self): WithTempDir.setUp(self) self.lex = LexStat(test_data('KSL.qlc')) self.part = Partial(test_data('partial_cognates.tsv'), segments='segments') self.part.add_entries('pid1', 'partial_cognate_sets', lambda x: x) self.part.add_entries('pid2', 'partialids2', lambda x: [int(y) for y in x.split(' ')])
def setUp(self): WithTempDir.setUp(self) self.hlc = link_clustering.HLC( {"a": {"b", "c"}, "b": {"c"}, "c": {"a"} }, {("a", "b"), ("b", "c"), ("a", "c")} )
def setUp(self): WithTempDir.setUp(self) self.tmp_path('_test').mkdir() with self.tmp_path('_test', 'converter').open(mode='w', encoding='utf8') as fp: fp.write("""\ p : p, ɸ, p͡f b : b, β, b͡v f : f v : v m : m, ɱ w : w, ɰ, ʋ, ʍ 8 : θ, θ, Ɵ, ð""") with self.tmp_path('_test', 'scorer').open(mode='w', encoding='utf8') as fp: fp.write(SCORER)
def setUp(self): WithTempDir.setUp(self) self.gls = [('Haerbin', 0), ('Beijing', 0), ('Xi’an', 0), ('Lanzhou', 0), ('Kunming', 1), ('Tianjin', 0), ('edge.13', 1), ('edge.11', 0)] self.scenarios = [ ['p1', self.gls], ['p2', [('Taiyuan', 0), ('Nanning', 0), ('Wenzhou', 0), ('Lanzhou', 0), ('edge.24', 0), ('Pingyao', 0), ('Jinan', 1), ('edge.6', 0), ('Kunming', 0), ('Zhengzhou', 0), ('Xi’an', 0), ('edge.10', 0), ('edge.14', 0), ('Shexian', 0), ('edge.26', 1), ('Suzhou', 0)]]] self.tree = "((((((((Taiyuan,Pingyao,Huhehaote)," \ "((((Xi’an,Xining,Zhengzhou)," \ "(Lanzhou,Yinchuan,Wulumuqi))," \ "(((Tianjin,Jinan),Qingdao),Beijing,Haerbin))," \ "(((Guiyang,Kunming),Chengdu,Wuhan)," \ "(Nanjing,Hefei)))),(Xiangtan,Changsha)),Nanchang)," \ "(Shexian,Tunxi)),((Shanghai,Suzhou,Hangzhou),Wenzhou))," \ "(((Xianggang,Guangzhou),Nanning),(Meixian,Taoyuan)))," \ "((((Xiamen,Taibei),Shantou,Haikou),Fuzhou),Jian’ou));"
def setUp(self): WithTempDir.setUp(self) self.cfg = os.path.join(self.tmp.as_posix(), '.config')
def setUp(self): WithTempDir.setUp(self) self.wordlist = Wordlist(test_data('KSL.qlc')) self.wordlist2 = Wordlist(test_data('good_file.tsv'))
def setUp(self): WithTempDir.setUp(self) self.ifile = test_data('phybo.qlc')
def setUp(self): WithTempDir.setUp(self) self.wordlist = Wordlist(test_data('KSL.qlc')) self.wordlist2 = Wordlist(test_data('KSL4.qlc'))
def setUp(self): WithTempDir.setUp(self) self.newick = '(((a,b),(c,d)),e);' self.tree = Tree(self.newick)
def setUp(self): WithTempDir.setUp(self) self.wordlist = Wordlist(test_data('colexification.tsv')) self.cols = colx._get_colexifications(self.wordlist)
def setUp(self): WithTempDir.setUp(self) self.wordlist = Wordlist(test_data('KSL.qlc')) self.wordlist2 = Wordlist(test_data('KSL4.qlc'))
def setUp(self): WithTempDir.setUp(self) self.lex = self._make_one(test_data('KSL.qlc')) self.log = get_log() self.get_scorer_kw = dict(runs=10, rands=10, limit=100)
def setUp(self): WithTempDir.setUp(self) self.inputfile = os.path.join( os.path.dirname(lingpy.__file__), 'tests', 'test_data', 'phybo.qlc')
def setUp(self): WithTempDir.setUp(self) self.wordlist = Wordlist(test_data('GER.tsv'))
def setUp(self): WithTempDir.setUp(self) self.alm = Alignments(test_data('KSL2.qlc'), loans=False, _interactive=False) self.alm.align()
def setUp(self): WithTempDir.setUp(self) self.wordlist = Wordlist(test_data('KSL.qlc')) self.wordlist2 = Wordlist(test_data('good_file.tsv'))
def setUp(self): WithTempDir.setUp(self) self.cfg = os.path.join(self.tmp.as_posix(), '.config')
def setUp(self): WithTempDir.setUp(self) self.part = Partial(test_data('partial_cognates.tsv'), segments='segments') self.part2 = Partial(test_data('partial_cognates-scored.tsv'), segments='segments')
def setUp(self): WithTempDir.setUp(self) self.ifile = test_data('phybo.qlc')
def setUp(self): WithTempDir.setUp(self) self.alm = Alignments(test_data('KSL2.qlc'), loans=False, _interactive=False) self.alm.align()
def setUp(self): WithTempDir.setUp(self) self.wordlist = Wordlist(test_data('colexification.tsv')) self.cols = colx._get_colexifications(self.wordlist)