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
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)