本文整理汇总了Python中UI.setup方法的典型用法代码示例。如果您正苦于以下问题:Python UI.setup方法的具体用法?Python UI.setup怎么用?Python UI.setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UI
的用法示例。
在下文中一共展示了UI.setup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import UI [as 别名]
# 或者: from UI import setup [as 别名]
def run() -> None:
"""Initializes program"""
# global corpus
# may want to load excel files on a case by case basis later on
if load_excel_files:
print("Loading excel files...")
excel_setup()
print("Done")
UI.setup()
# if corpus != None:
# corpus = eval(corpus)
# UI.return_data(analyze(word))
print(
"""
Notes: some 2 part words can be analyzed, however, the results
- of the analysis of such words may be inconsistant depending on
- whether the input uses a space or an underscore to seperate them
entering default as an option when it is available will run the
- given function using a set of predetermined common words
- (see common words.txt)"""
)
while True:
interface_data = UI.interface()
if interface_data[0] == "quit":
break
elif interface_data == (None, None):
continue
UI.output_data(collect_data(interface_data))
return
示例2: corupus_setup
# 需要导入模块: import UI [as 别名]
# 或者: from UI import setup [as 别名]
def corupus_setup(file, name: str)->bool:
'''sets up a new corpus to be selected from'''
try:
listing = open('corpora.txt', 'a')
corpora = open('corpora.txt', 'r')
index = int(corpora.read().splitlines()[-1].split()[0]) + 1
listing.write('\n{}\t{}\t{}'.format(index,name,file))
listing.close()
corpora.close()
UI.setup()
except:
print("Could not install new corpus...")
return False
return True
示例3: corupus_setup
# 需要导入模块: import UI [as 别名]
# 或者: from UI import setup [as 别名]
def corupus_setup(file, name: str) -> bool:
"""sets up a new corpus to be selected from"""
try:
listing = open("corpora.txt", "a")
corpora = open("corpora.txt", "r")
index = int(corpora.read().splitlines()[-1].split()[0]) + 1
listing.write("\n{}\t{}\t{}".format(index, name, file))
listing.close()
file.close()
UI.setup()
# UI.corpora.append('{}\t{}\t{}'.format(index,name,file))
# UI.max_index = index
except:
print("Could not install new corpus...")
return True
示例4: run
# 需要导入模块: import UI [as 别名]
# 或者: from UI import setup [as 别名]
def run()->None:
"""Initializes program"""
#global corpus
#may want to load excel files on a case by case basis later on
print("""
Please cite as:
Lawrence, J., & Krueger, N. (2016). Bifrost: Bridging linguistic, cognitive and computer science resources (Version Master). Retrieved from https://github.com/Malthanatos/Bifrost
This program was developed with support from the University of California Academic Senate Council on Research, Computing, and Libraries (CORCL).
Please contract Joshua Lawrence at [email protected] for any of the following papers that have used from data derived from the Bifrost program:
Lawrence, J. F., Hwang, J. K., Hagen, A., & Lin, G. (n.d.). What makes an academic word difficult to know?: Exploring lexical dimensions across novel measures of word knowledge.
Lawrence, J.F., Hagen, A., Hwang, J. K., Lin, G., & Arne, L. (n.d.). Academic vocabulary and reading comprehension: Exploring the relationships across measures of vocabulary knowledge.
Lawrence, J. F., Lin, G., Jaeggi, S., Krueger, N., Hwang, J. K., & Hagen, A. (n.d.). Polysemy and semantic precision: Standardized semantic measures extracted from Wordnet for 100,000 words in English.
Lawrence, J. F., (n.d.) Semantic precision and polysemy: Key indices of word difficulty and utility for reading.
""")
if load_excel_files:
print("\nLoading excel files...")
excel_setup()
print("Done")
UI.setup()
print('''
Notes: some 2 part words can be analyzed, however, the results
- of the analysis of such words may be inconsistant depending on
- whether the input uses a space or an underscore to seperate them
currently, when data from a corpus is loaded using mwac the related
- words and dispersion plots will be displayed before any other
- data such as definitions and statistics''')
while True:
interface_data = UI.interface()
if interface_data[0] == 'quit':
break
elif interface_data == (None,None):
continue
UI.output_data(collect_data(interface_data))
return