-
大小: 80.65MB文件类型: .7z金币: 1下载: 0 次发布日期: 2022-06-16
- 语言: 其他
- 标签: XunFeiYuyinW unity C#
资源简介
XunFeiYuyinWebApi完整版---语音识别和语音合成
webapi对接,需要的同学下载使用 感谢下载
代码片段和文件信息
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.Serialization;
using System.Text;
namespace ZenFulcrum.embeddedBrowser
{
/**
* Stand-in class for a javascript value that can be one of many different types.
*
* Bad lookups are safe. That is if you try to look up something that doesn‘t exist you will not get an exception
* but an “invalid“ node. Use Check() if you want an exception on invalid lookups:
*
* var node = JSONNode.Parse(@“{““a““:1}“);
* node[“a“].IsValid == true;
* node[“bob“].IsValid == false
* node[“bob“][“foo“].IsValid == false //but doesn‘t throw an exception
* node[“a“].Check() //okay
* node[“bob“].Check() //throw exception
*
* Values can be implicitly converted to JSONNodes and back. That means you don‘t have to use properties like
* “IntValue“ and “StringValue“. Simply try to use the node as that type and it will convert to the value
* if it‘s that type or return a default value if it isn‘t:
*
* var node = JSONNode.Parse(@“{““a““:1 ““b““: ““apples““}“);
* int a = node[“a“];
* a == 1;
* string b = node[“b“];
* b == “apples“;
* string str = node[“a“];
* str == null; //null is the default value for a string.
*
* You can also use new JSONNode(value) for many different types though often it‘s easier to just assign a
* value and let it auto-convert.
*
* Because they act a little special use node.IsNull and node.IsValid to check for null and invalid values.
* Real null still acts like null though so use JSONNode.NullNode to create a “null“ JSONNode.
* You can also use JSONNode.InvalidNode to get an invalid JSONNode outright.
*
* Note that while reading blind is safe assignment is not. Attempting to assign object keys to an integer for example
* will throw an exception. To append to an array call .Add() or assign to -1. To remove an object key or array element
* assign JSONNode.InvalidNode to it.
*
*/
public class JSONNode : IEnumerable
{
/** Parses the given JSON document to a JSONNode. Throws a SerializationException on parse error. */
public static JSONNode Parse(string json)
{
return JSONParser.Parse(json);
}
public static readonly JSONNode InvalidNode = new JSONNode(NodeType.Invalid);
public static readonly JSONNode NullNode = new JSONNode(NodeType.Null);
public enum NodeType
{
/** Getting this value would result in undefined or ordinarily throw some type of exception trying to fetch it. */
Invalid
String
Number
object
Array
Bool
Null
}
private NodeType _type = NodeTyp
评论
共有 条评论