我在JavaScript上有这行代码,但我想知道在Python中这行代码的等价物是什么
const { entities, classification } = obj
完整的功能是:
function extractActionEntities (lang, expressionsFilePath, obj) {
return new Promise(async (resolve, reject) => {
log.title('NER')
log.info('Searching for entities...')
// Need to instanciate on the fly to flush entities
this.nerManager = new NerManager()
const { entities, classification } = obj
// Remove end-punctuation and add an end-whitespace
const query = `${string.removeEndPunctuation(obj.query)} `
const expressionsObj = JSON.parse(fs.readFileSync(expressionsFilePath, 'utf8'))
const { module, action } = classification
const promises = []
});
}
Python不使用常量,因此您必须只移植分解结构,而Python也没有(至少不像ES6那样)
但是,您可以执行以下操作:
或者,根据this,使用
itemgetter
相关问题 更多 >
编程相关推荐