当前位置: 首页>>代码示例>>Python>>正文


Python Base.getClassAsInt方法代码示例

本文整理汇总了Python中Base.getClassAsInt方法的典型用法代码示例。如果您正苦于以下问题:Python Base.getClassAsInt方法的具体用法?Python Base.getClassAsInt怎么用?Python Base.getClassAsInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Base的用法示例。


在下文中一共展示了Base.getClassAsInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parenLetter

# 需要导入模块: import Base [as 别名]
# 或者: from Base import getClassAsInt [as 别名]
def parenLetter(word, postbase):
	""" returns the letter that should be picked from inside of the ()'s in postbase notation """
	letter = ''
	classnum = Base.getClassAsInt(word)

	for c in getParenOptions(postbase):
		if c == 'g' and classnum == 2:
			letter = 'g'
		elif c == 'ng' and classnum <= 4:
			letter = 'ng'
		elif c == 's' and classnum <= 4:
			letter = 's'
		elif c == 't' and classnum >= 5:
			letter = 't'
		elif c == 'u' and classnum >= 3:
			letter = 'c'

	return letter
开发者ID:WileESpaghetti,项目名称:learn-yupik,代码行数:20,代码来源:Postbase.py

示例2: stripPostbase

# 需要导入模块: import Base [as 别名]
# 或者: from Base import getClassAsInt [as 别名]
def stripPostbase(word, postbase):
	""" removes a postbase from a word. see wiki for info reguarding postbase syntax """
	print("Removing postbase:\t%s" % postbase)

	word = stripEZStuff(word, postbase)

	# detect which letters in parenthesis we need to remove if any
	removeParen = isParensStripped(word, postbase)
	if removeParen:
		word = word[:-1]

	if word[-1] == "\'":
		word = word[:-1] + 'e'
	elif not removeParen and Base.getClassAsInt(word) >= 5:
		# for postbases with 't' in parenthesis: 't' only gets added if word ends in consonant
		# if we removed a 't' then the word must be class V or VI. If we didn't need to remove
		# a 't' then then the word must end in a vowel. If the word claims to be V or VI but we
		# didn't need to remove anything then the word should be a class III or IV instead.
		word = word + 'e'

	print("Base Form:\t\t%s" % word)
	print('')
开发者ID:WileESpaghetti,项目名称:learn-yupik,代码行数:24,代码来源:Postbase.py


注:本文中的Base.getClassAsInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。