Skip to content

API 文档 文本库

xerysherry edited this page Nov 7, 2019 · 1 revision

目录

说明

function SetTextWeightList(name, table)

name: 字符串, 文本表名 table: 表, 权重文本表

设置权重文本表

SetTextWeightList("family_name", 
{
    {"", 2000},
    {"", 2000},
    {"", 2000},
    {"", 2000},
    {"", 1500},
    {"", 1500},
    {"", 1500},
    {"", 1500},
})

function SetTextList(name, table)

name: 字符串, 文本表名 table: 表, 文本表

设置文本表

SetTextWeightList("family_name", 
{
    "",
    "",
    "",
    "",
    "",
    "",
    "",
    "",
})

function GetTextListCount(name)

name: 字符串, 文本表名

获取文本表中文本条目数

function GetTextListWeight(name)

name: 字符串, 文本表名

获取文本表的总权重值, 如果非权重表, 权重值等于条目数

function GetTextByIndex(name, index)

name: 字符串, 文本表名 index: 数值, 索引值

获取文本表中某一条文本

function GetTextByWeight(name, weight)

name: 字符串, 文本表名 weight: 数值, 权重值

获取文本表中某一条文本, 并返回该文本索引

Clone this wiki locally