{"id":209853,"date":"2020-11-29T02:50:57","date_gmt":"2020-11-28T18:50:57","guid":{"rendered":"http:\/\/4563.org\/?p=209853"},"modified":"2020-11-29T02:50:57","modified_gmt":"2020-11-28T18:50:57","slug":"java-%e6%83%b3%e8%af%b7%e6%95%99%e6%9c%89%e6%b2%a1%e4%bb%80%e4%b9%88%e6%96%b9%e6%b3%95%e8%83%bd%e5%af%b9%e8%bf%99%e7%a7%8d%e5%ad%97%e7%ac%a6%e4%b8%b2%e8%bd%ac%e6%8d%a2%e6%9c%89%e9%ab%98%e6%95%88","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=209853","title":{"rendered":"Java , \u60f3\u8bf7\u6559\u6709\u6ca1\u4ec0\u4e48\u65b9\u6cd5\u80fd\u5bf9\u8fd9\u79cd\u5b57\u7b26\u4e32\u8f6c\u6362\u6709\u9ad8\u6548\u64cd\u4f5c"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Java , \u60f3\u8bf7\u6559\u6709\u6ca1\u4ec0\u4e48\u65b9\u6cd5\u80fd\u5bf9\u8fd9\u79cd\u5b57\u7b26\u4e32\u8f6c\u6362\u6709\u9ad8\u6548\u64cd\u4f5c               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : IMCA1024 <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u73b0\u5728\u6709\u4e00\u6bb5\u7c7b\u4f3c\u8fd9\u6837\u7684\u683c\u5f0f String<\/p>\n<pre><code>[0:1.520,0:2.460,0]  \u5582\uff0c\u4f60\u597d\u3002 [0:4.300,0:7.920,0]  xxxxxxxx [0:8.750,0:10.440,0]  xxxxxxxx [0:10.690,0:16.460,0] xxxxxxxxxx \u3002  <\/code><\/pre>\n<p>[]\u91cc\u9762\u7684 \u7b2c\u4e00\u4f4d\u662f\u5f00\u59cb\u65f6\u95f4\u6233\uff0c\u7b2c\u4e8c\u4f4d\u662f\u7ed3\u675f\u65f6\u95f4\u6233\uff0c\u7b2c\u4e09\u4f4d\u662f\u89d2\u8272\u6807\u8bc6\u3002 \u540e\u9762\u8ddf\u7740\u7684\u662f\u6587\u672c\u5185\u5bb9<\/p>\n<p>\u8981\u8f6c\u6362\u6210\u8fd9\u79cd:<\/p>\n<pre><code>[ {\"begin\":1000,\"end\":2000,\"role\":\"\u89d2\u8272 1\",\"words\":\"  xxxx\"}, {\"begin\":4000,\"end\":6000,\"role\":\"\u89d2\u8272 1\",\"words\":\"  xxxxx \u3002\"}, {\"begin\":8000,\"end\":9000,\"role\":\"\u89d2\u8272 2\",\"words\":\"  xxxxxx \u3002\"}, {\"begin\":12000,\"end\":13000,\"role\":\"\u89d2\u8272 2\",\"words\":\"  xxxxxx\"}, ]  <\/code><\/pre>\n<p>\u76ee\u524d\u6211\u662f\u975e\u5e38\u4f4e\u6548\u7684\u505a\u6cd5: \u5148\u6839\u636e\u6362\u884c\u7b26 spilit(&#8220;n&#8221;);\u5207\u5272\u51fa\u6bcf\u4e00\u884c<\/p>\n<p>\u6bd4\u5982\u4e00\u884c: [0:1.520,0:2.460,0] \u5582\uff0c\u4f60\u597d<\/p>\n<p>\u7136\u540e splitResult[0] \u5c31\u662f \u6574\u4e2a[0:1.520,0:2.460,0] \u5185\u5bb9 \uff0csplitResult[1]\u5c31\u662f\u6587\u672c\u5185\u5bb9 \u518d\u5bf9 splitResult[0] \u8fdb\u884c\u5904\u7406\uff0c subString \u51fa 0:1.520,0:2.460,0 \u7136\u540e\u518d\u7528 split(&#8220;,&#8221;)\u5207\u5272\u51fa \u65f6\u95f4\u6233 \u4ee5\u53ca \u89d2\u8272\u6807\u8bc6\u3002<\/p>\n<p>\u6709\u6ca1\u4ec0\u4e48\u5176\u4ed6\u9ad8\u6548\u65b9\u6cd5\uff0c\u5bf9\u5b57\u7b26\u4e32\u64cd\u4f5c\u4e0d\u592a\u719f\u6089<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>6<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4360272\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : liuxey <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u201c\u9ad8\u6548\u201c\u7684\u505a\u6cd5\u5c31\u662f\u628a\u4f60\u7684\u8fd9\u6bb5\u5904\u7406\u8fc7\u7a0b\u5199\u6210\u5de5\u5177\u7c7b\uff0c\u7136\u540e\uff1a<br \/>String json = Util.parse(text).toJSON();<br \/>\u5b8c\u7f8e\uff01<br \/>\u6b63\u7ecf\u6765\u8bf4\uff0c\u67e5\u770b\u4e0b\u4f60\u7684\u8fd9\u6bb5 Text \u662f\u5426\u662f\u67d0\u79cd\u6807\u51c6\u534f\u8bae\u7684\u62a5\u6587\uff0c\u4e00\u822c\u90fd\u6709 Java \u89e3\u6790\u5e93\u7684\uff0c\u5982\u679c\u4e0d\u662f\u6807\u51c6\u7684\u90a3\u4e48\u4f60\u81ea\u5df1\u5b9e\u73b0\u4e5f\u662f OK \u7684\uff0c\u4e3b\u8981\u5173\u6ce8\u4e0b\u6709\u6ca1\u6709\u8fb9\u754c\u60c5\u51b5\u548c\u5f02\u5e38\u60c5\u51b5\u5bfc\u81f4 BUG \uff1b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4360273\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : msg7086 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5\u7528\u6b63\u5219\uff0c\u4f46\u662f\u5904\u7406\u662f\u5c11\u4e0d\u4e86\u7684\u3002\u80fd\u505a\u7684\u5c31\u662f\u8ba9\u4ee3\u7801\u5c3d\u53ef\u80fd\u6e05\u6670\uff0c\u65b9\u4fbf\u7ef4\u62a4\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4360274\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : IMCA1024 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @liuxey <br \/>\u76ee\u524d\u8fb9\u754c\u60c5\u51b5\u5f02\u5e38\u60c5\u51b5 \u4ee3\u7801\u91cc\u90fd\u6709\u5904\u7406\uff0c\u6211\u5c31\u662f\u89c9\u5f97\u8fd9\u79cd\u65b9\u6cd5\u5904\u7406\u8d77\u6765\u6548\u7387\u597d\u50cf\u633a\u4f4e\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4360275\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : songzblin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5229\u7528\u4e86\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u5e0c\u671b\u6709\u5e2e\u52a9<br \/>String sourceInfo = &#8220;[0:1.520,0:2.460,0] \u5582\uff0c\u4f60\u597d\u3002&#8221;;<br \/>String TimeRegex = &#8220;\\d+:\\d+.\\d+&#8221;;<br \/>Pattern pattern = Pattern.compile(TimeRegex);<br \/>Matcher matcher = pattern.matcher(sourceInfo);<br \/>while (matcher.find()) {<br \/>\/\/ \u4e24\u4e2a\u65f6\u95f4<br \/> System.out.println(matcher.group());<br \/>}<br \/>String roleRegex = &#8220;,\\d+]&#8221;;<br \/>pattern = Pattern.compile(roleRegex);<br \/>matcher = pattern.matcher(sourceInfo);<br \/>while (matcher.find()) {<br \/>\/\/ \u8eab\u4efd<br \/> System.out.println(matcher.group().replaceAll(&#8220;,|]&#8221;, &#8220;&#8221;));<br \/>}<br \/>String infoRegex = &#8220;] .*&#8221;;<br \/>pattern = Pattern.compile(infoRegex);<br \/>matcher = pattern.matcher(sourceInfo);<br \/>while (matcher.find()) {<br \/>\/\/ \u4fe1\u606f<br \/> System.out.println(matcher.group().replaceAll(&#8220;] &#8220;,&#8221;&#8221;));<br \/>}                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4360276\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yunyi93 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u822c\u60c5\u51b5\uff0cJSON \u6620\u5c04\u5c31\u53ef\u4ee5\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4360277\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tairan2006 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8001\u5b9e\u8bb2\uff0c\u6b63\u5219\u8bf4\u4e0d\u5b9a\u8fd8\u6ca1 split \u5feb\u2026\u4f60\u8981\u81ea\u5df1\u6d4b\u4e00\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Java , \u60f3\u8bf7\u6559\u6709\u6ca1\u4ec0\u4e48\u65b9\u6cd5\u80fd&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/209853"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=209853"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/209853\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=209853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=209853"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=209853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}