topics

全部话题 - 话题: parser
首页 2 3 4 5 6 末页 (共10页)
d***a
发帖数: 13752
1
来自主题: Programming版 - 最高大上的 atoi
我觉得yacc还行。很早以前我用yacc写过SQL的parser。
yacc是LALR类型的parser生成器,生成的语法树不太直观,
但运行效率比较好,用于SQL解析还是不错的。
G***l
发帖数: 355
2
lz你的标题误导人了。你在标题里说文本分析,结果一堆回复perl/python的,那些做
文本处理是很好。但你这个不是文本的问题,因为你这不是单纯的文本,是有语义的。
你这个基本就是需要个compiler frontend。比如你那个c语言的问题。你要用compiler
把代码转换为abstract syntax tree。有了这个ast之后,所有的变量定义都能准确定
位到,这时候你把ast上所有变量定义后面加一个初始化,再把ast反过来写成source
code,就成了。
如果你的需求很简单,比如只是变量定义加上初始化,那用纯文本regular expression
处理就可以了,perl,python很适合,哪怕sed/awk都可以搞定。如果复杂的话就需要
parser了,你可以用antlr,yacc之类的,那些常见语言的grammar都有现成的,不过要
是你自己特定的语法的话,就要自己写lexer/parer了,用上面提到的parser
generator的工具也挺容易。
a*****e
发帖数: 1700
3
来自主题: Programming版 - Scala有一点不好
我不是很理解你说的用 monad 描述 parsing 和 monad 表述 I/O 有什么关系,
是说 parser combinator 可以用 monad 实现吗?parser combinator 同样可以用
applicative 或者 arrows 实现,和 monad 的实现各有优劣。
我说 I/O compose like monads 前面还要加一个定语: sequential,这是因为需要
确保副作用发生的先后顺序。不加限制的 function composition 做不到这点,但
不加限制的 monad composition 可以做到这点。
而且 text composition 明显是个 monoid,先后顺序不重要,结果一致就好。
为什么说 sequential I/O 可以用 Monad 表述,是因为 sequential I/O 之间的
composition 满足 monad laws,而不是源程序可以写成什么样子,同时它也
不依赖于语言本身的求值顺序等特征。
g*****g
发帖数: 34805
4
来自主题: Programming版 - 如何动态定义类和方法
你现在承认那俩是装逼对象了?是个语言parse个配置文件都能把这做了,需要traits
干啥?
我老再跟你讲讲为什么你是傻逼吧。就说这个parse配置文件,假定刚开始你支持加减
乘除。后来形状复杂了,什么sin/cos都来了,怎么办?改parser。接下来更复杂了,
什么一阶二阶导数都来了,怎么办,继续改parser。要保证没regression可难了。相比
之下我就加个形状实现,如果我的实现错了,也就是这个新的形状面积算错而已,其他
形状相关的代码完全没动,是不会产生regression的。你啥不用改代码只不过一厢情愿
而已。
你小在软件工程上的道行跟我差了很多光年,还是不要出来丢脸了。
b*******s
发帖数: 5216
5
来自主题: Programming版 - 如何动态定义类和方法
traits是干什么的?你没做过就少乱说,parser不用traits?
加一个parser功能,所有shapes都用,比你重复写哪个更合理
就一嘴硬的傻b

traits
g*****g
发帖数: 34805
6
来自主题: Programming版 - 如何动态定义类和方法
你丫被实例完全击垮,已经开始语无伦次了。你丫这破东西需要啥traits,就是几个参
数替代而已。改parser和增加shape的区别,更是你完全不能理解的。你要觉得加配置
文件改parser比加一个Shape好,我们就不需要继续讨论了。
你反正跟太监是一个路数。
g*****g
发帖数: 34805
7
来自主题: Programming版 - 如何动态定义类和方法
实现个不同形状面积的算法哪里重复了?你丫能再弱智一些吗?什么东西不是多一层
indirection一样都能做,但没有好处地放弃compiler的类型检查,毫无意义地去写个
多余parser,本来就是个弱智的做法。我可能写几百上千个类写了后面忘了前面,那是
因为后面跟前面完全无关,我可不像你parser一会不够用了又得改一次。
g*****g
发帖数: 34805
8
来自主题: Programming版 - 如何动态定义类和方法
我没做过复杂的parser是没错,我只知道C++加新类的事情常有,改compiler的事情很
少,像你这样为了避免加新类改parser的傻逼是生平仅见。

google
g*****g
发帖数: 34805
9
来自主题: Programming版 - 如何动态定义类和方法
Sure, you are too native to think my architecture cannot incorporate a
parser for your white noise garbage formula, the builder pattern is there
for it. The truth is, most system may need a dozen shapes, and I don't need
to change my existing codes when adding a new one. And yours is exactly an
anti-pattern.
A parser can be used when it makes sense, not as a catch-all solution.

and
g*****g
发帖数: 34805
10
来自主题: Programming版 - 如何动态定义类和方法
LOL, you are so full of shit. My solution can easily call your parser to
solve the shapes you can handle, and handle shapes your parser can't handle
without single line of wasted code. If you believe your parse can solve all,
let's find out.

way.
g*****g
发帖数: 34805
11
来自主题: Programming版 - 如何动态定义类和方法
你现在承认那俩是装逼对象了?是个语言parse个配置文件都能把这做了,需要traits
干啥?
我老再跟你讲讲为什么你是傻逼吧。就说这个parse配置文件,假定刚开始你支持加减
乘除。后来形状复杂了,什么sin/cos都来了,怎么办?改parser。接下来更复杂了,
什么一阶二阶导数都来了,怎么办,继续改parser。要保证没regression可难了。相比
之下我就加个形状实现,如果我的实现错了,也就是这个新的形状面积算错而已,其他
形状相关的代码完全没动,是不会产生regression的。你啥不用改代码只不过一厢情愿
而已。
你小在软件工程上的道行跟我差了很多光年,还是不要出来丢脸了。
b*******s
发帖数: 5216
12
来自主题: Programming版 - 如何动态定义类和方法
traits是干什么的?你没做过就少乱说,parser不用traits?
加一个parser功能,所有shapes都用,比你重复写哪个更合理
就一嘴硬的傻b

traits
g*****g
发帖数: 34805
13
来自主题: Programming版 - 如何动态定义类和方法
你丫被实例完全击垮,已经开始语无伦次了。你丫这破东西需要啥traits,就是几个参
数替代而已。改parser和增加shape的区别,更是你完全不能理解的。你要觉得加配置
文件改parser比加一个Shape好,我们就不需要继续讨论了。
你反正跟太监是一个路数。
g*****g
发帖数: 34805
14
来自主题: Programming版 - 如何动态定义类和方法
实现个不同形状面积的算法哪里重复了?你丫能再弱智一些吗?什么东西不是多一层
indirection一样都能做,但没有好处地放弃compiler的类型检查,毫无意义地去写个
多余parser,本来就是个弱智的做法。我可能写几百上千个类写了后面忘了前面,那是
因为后面跟前面完全无关,我可不像你parser一会不够用了又得改一次。
g*****g
发帖数: 34805
15
来自主题: Programming版 - 如何动态定义类和方法
我没做过复杂的parser是没错,我只知道C++加新类的事情常有,改compiler的事情很
少,像你这样为了避免加新类改parser的傻逼是生平仅见。

google
g*****g
发帖数: 34805
16
来自主题: Programming版 - 如何动态定义类和方法
Sure, you are too native to think my architecture cannot incorporate a
parser for your white noise garbage formula, the builder pattern is there
for it. The truth is, most system may need a dozen shapes, and I don't need
to change my existing codes when adding a new one. And yours is exactly an
anti-pattern.
A parser can be used when it makes sense, not as a catch-all solution.

and
g*****g
发帖数: 34805
17
来自主题: Programming版 - 如何动态定义类和方法
LOL, you are so full of shit. My solution can easily call your parser to
solve the shapes you can handle, and handle shapes your parser can't handle
without single line of wasted code. If you believe your parse can solve all,
let's find out.

way.
w***g
发帖数: 5958
18
来自主题: Programming版 - FP的教材是怎么误导人的
很多人学FP后第一反应就是用FP写出来的代码太他妈漂亮了。
这个其实在很大程度上是被FP教材误导的。用FP写一些离散数学
算法,用来写parser,确实很漂亮。但是有多少实战编程要用到
离散数学算法要写parser的?一碰到屎一般的business logic,
再FP也写不出漂亮的代码来。
d****n
发帖数: 1637
19
来自主题: Programming版 - 如何快速处理大量网上xml文件?
你抛出了个XML parser干毛?你知道楼主要存啥啊?
再说你这个xml parser+thread,看看你的破玩意一共多少行?再把编译配置写好,不
然累死
T********i
发帖数: 2416
20
来自主题: Programming版 - 请教一个C++的设计问题
不仅仅是干活出活的问题。还有几个更重要的原因。
1。代码清晰易读。
2。省代码。
3。 减少代码耦合度。
20多个parser,小团队,parser数量可能今后几年都没有改变。当然无脑if then else
。而且极有可能能够写出decision tree而不用一个个iteration来判断,速度都是最优
化的。
写一大堆template,读代码的还要去理解,上上下下去来回读。写的麻烦,读也麻烦。
而且可能还要register。一旦忘了可能半天找不到毛病。
多一事不如少一事,别没事找事。
e*******o
发帖数: 4654
21
来自主题: Programming版 - 怎么设计这个client
server都把数据format给你了
你要做的就是很根据format 来动态改变你的parser
难点在不再传输 在于你这个format 有多变态
如果太复杂 你就把server给你的format 和数据保存到一起
另一个程序负责来处理数据 处理完成无误删掉 这样万一新format handle不了 你可以
介入手动改parser.
g****t
发帖数: 31659
22
来自主题: Programming版 - 成功无偶然啊
Node.js之前,这哥们下的功夫真是不少
BostInno: What were you trying to solve when you created node?
Dahl: I was often involved with writing small event based programs. I liked
the design of event based servers because I felt they were easier to
understand: state is kept in some struct and you go around and around
modifying the state. There were no infinite while loops making blocking
reads or accepts from sockets (which has always struck me as a very strange
pattern). I would be able to make very low latency s... 阅读全帖
c*******r
发帖数: 5
23
来自主题: XML版 - 从哪里开始学习XML?

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
据我所知,好像大多数的XML parser(包括大公司的)都是免费的。
http://www.alphaworks.ibm.com 上就有IBM的Free parser for java and C++
好像还有源代码(这一点不肯定)。
d*****r
发帖数: 18
24
来自主题: XML版 - help!
Can you tell me where I can download it?
I only find the XML parser for JAVA or C++, but I need a
parser for c. Thanks,
l*******d
发帖数: 4
25
来自主题: XML版 - 想写一个XML开发的系列
Which xml parser supports chinese?
i can not do chinese in Perl, XML::Parser
THnaks
l*******d
发帖数: 4
26
来自主题: XML版 - Perl+XML+GB
Hi, Anyone knows how to use Perl XML::Parser
with GB chinese? i know it supports UTF-8,
but when there has GB code in XML document,
parser generates errors even the encoding is "UTF-8".
I have tried to chang the xml file encoding attribute.
useless.
thanks.
linkspeed
a*****a
发帖数: 438
27
why do you need a java parser? I am not familiar with java
but can't java consume a native xml parser (by native I mean
c/c++)?
I am pretty sure there must be a way to do that in .NET
framework because of the CLR (Common Language Runtime). At
least I've seen people consuming native COM objects in C# or
ManagedC++. In PDC I think Fujitsu demonstrates doing that
in COBOL!
w*****h
发帖数: 28
28
【 以下文字转载自 Java 讨论区 】
【 原文由 txvoilet 所发表 】
If a XML's DTD has two roots, but the XML just has one root.
Is the XML valid?
Another one question, who know which parser can deal with
the XML with more
than one root? How about Oracle parser?
i*****t
发帖数: 220
29
来自主题: XML版 - one simple question
Thanks... but why DOM parser is the only choice here? May I use a DOM parser
to generate an XML file? Thanks.

happens.
file
xml
k****j
发帖数: 10
30
来自主题: XML版 - 用于 parse xml的script
if your XML is simple without DTD, use XML::Simple, then handle the data
in hash or list
otherwise, XML::Parser::Expat, XML::Parser::Lite
k***o
发帖数: 1
31
来自主题: XML版 - [转载] help! XML parse problem
In MS DOM parser, you can use LoadXML to load a xml in a string. I will expect
Java DOM parser should have the same thing...
m**c
发帖数: 90
32
来自主题: XML版 - [转载] help! XML parse problem

You can create a InputSource object which contains input string (wrapped
inside StringReader object):
...
StringReader sr = new StringReader(inputStr);
InputSource is = new InputSource(sr);
saxParser.parse(is, xxx); // SAX parser
domParser.parse(is, xxx); // DOM parser
...
c********e
发帖数: 383
33
来自主题: XML版 - 如何把HTML 转换成XML 文档
this will be very hard, because the semantic is not defined.
If i got you right, my suggestion is to build a dtd basing on html first the
n u can generate xml for any html file with the help of a html parser.
if you have to write everything by yourself..its a big project.
basically u need:
1. a html parser including a databackend
2. XML generator (there are lots of such tools like UDM. Xerces...which dose
xml generation and validation)
l***y
发帖数: 25
34
来自主题: XML版 - Help: Several questions on XML
1. Is there any kind of "polymorphism" in XML like
in Java? Can type substitution do this?
2. Having defined an XML schema(*.xsd), How can I
validate my XML instance file using any XML parser?
I am using SAX parser.
3. And given a *.xsd file, if I want to define any
instance file, I can use the global element and
global attribute. Can I directly use the global types
(either simple or complex) defined in the schema?
Maybe the questions are trivial or not well stated, but
your help will be highly
c***z
发帖数: 6348
35
来自主题: DataSciences版 - [Road map] From ClickStream to ConsumerInsight
In case you are curious about what data scientists do, this is one case that
has multiple projects and involves multiple teams.
It is a big thing and not completely in my scope, but I will try my best to
describe it.
Stage 1. We need the clickstream data. It is the crawler/parser team's job
to get the urls (optimally, the whole pages as well) from websites and
classify them, and the hadoop admin team's job to store them in place. It is
a monster in its own sake, and I am no expert on this at all... 阅读全帖
m***r
发帖数: 359
36
来自主题: DataSciences版 - 机器学习日报 2015年3月楼
机器学习日报 2015-03-14
@好东西传送门 出品, 过刊见
http://ml.memect.com
订阅:给 [email protected]
/* */ 发封空信, 标题: 订阅机器学习日报
更好看的HTML版
http://ml.memect.com/archive/2015-03-14/short.html
1) 【LINE模型大规模网络降维公布论文以及源代码】 by @chuckpku
关键词:应用, 社交网络
我们的论文“LINE: Large-scale Information Network Embedding”被WWW2015接收。
该论文提出的LINE模型能够在单机上把大规模网络降维到低维空间表示,稍后我们将公
布论文以及源代码 @张铭PKUCS
2) 【概率图模型基础总结】 by @数盟社区
关键词:算法
【概率图模型基础总结】在这一过程中,模型往往是必须的,什么样的模型才是相对正
确的?这又是我们需要解决的问题。这些问题出现在很多领域,包括模式识别、差错控
制编码等。概率图模型是解决这些问题的工具之一。 [1]
[1] http://dat... 阅读全帖
m***r
发帖数: 359
37
来自主题: DataSciences版 - 机器学习日报 2015年3月楼
机器学习日报 2015-03-14
@好东西传送门 出品, 过刊见
http://ml.memect.com
订阅:给 [email protected]
/* */ 发封空信, 标题: 订阅机器学习日报
更好看的HTML版
http://ml.memect.com/archive/2015-03-14/short.html
1) 【LINE模型大规模网络降维公布论文以及源代码】 by @chuckpku
关键词:应用, 社交网络
我们的论文“LINE: Large-scale Information Network Embedding”被WWW2015接收。
该论文提出的LINE模型能够在单机上把大规模网络降维到低维空间表示,稍后我们将公
布论文以及源代码 @张铭PKUCS
2) 【概率图模型基础总结】 by @数盟社区
关键词:算法
【概率图模型基础总结】在这一过程中,模型往往是必须的,什么样的模型才是相对正
确的?这又是我们需要解决的问题。这些问题出现在很多领域,包括模式识别、差错控
制编码等。概率图模型是解决这些问题的工具之一。 [1]
[1] http://dat... 阅读全帖
h******k
发帖数: 13418
38
来自主题: Military版 - 大家给程序大师排个名么
看来你是明白人,VBS可以,但是性能很差,模拟运算的结果是海量的,用Tex做几天的
,用VBS要跑上月了。而且word对VBS的接口也相对复杂,word又没有对公式的parser.
你做这个VBS也要搞个把月。Tex几小时就搞定了。
J*****l
发帖数: 252
39
来自主题: Military版 - Bank Holds patent on changing your emotion
SYSTEMS FOR INDUCING CHANGE IN A HUMAN PHYSIOLOGICAL CHARACTERISTIC
United States Patent Application, August 18, 2011
By Bank of America
Patent Abstract
Systems and methods for inducing a change in a human physiological
characteristic. The physiological characteristic may correspond to an
emotional state of a dialogue participant. The dialogue participant
may be
an individual participating in a conversation. The outcome of the
conversation may be related to a business objective, such as providin... 阅读全帖
p**********6
发帖数: 3408
40
来自主题: Military版 - 为啥放飞员是两个
没有足够快的parser。
c****3
发帖数: 10787
41
来自主题: Military版 - 歧视码工的也别得瑟
这其实是字符和内存处理的基本功。
现在的码农,如果不靠库函数,让他自己写个简单的字符串parser,十个有九个都不会
D***r
发帖数: 7511
42
来自主题: Military版 - 面试要求解方程
实际上就是让写个parser
要考虑各种括号
如果面试问这种题要当场全做对不是很容易的,讲下思路还差不多

发帖数: 1
43
来自主题: Military版 - 面试要求解方程
我靠!面试题目这么难!写个 parser 就三个钟头过去了,还要解?怎么解啊?唉,看
来马工饭不能吃啊!
c*******a
发帖数: 1879
44
/**
* Parser for JSON text. Please note that JSONParser is NOT thread-safe.
*
* @author FangYidong<[email protected]>
*/
public class JSONParser {
public static final int S_INIT=0;
public static final int S_IN_FINISHED_VALUE=1;//string,number,boolean,
null,object,array
public static final int S_IN_OBJECT=2;
public static final int S_IN_ARRAY=3;
public static final int S_PASSED_PAIR_KEY=4;
public static final int S_IN_PAIR_VALUE=5;
public static final int S_END=6;... 阅读全帖

发帖数: 1
45
写parser决斗?

发帖数: 1
46
来自主题: Military版 - CS根本不应该成为一个独立专业
parser 和 AI 不是一个量级的东西。
c*****y
发帖数: 1028
47
出身清华姚班,斯坦福博士毕业,她的毕业论文成了「爆款」
机器之心 Today
机器之心报道
机器之心编辑部
很少有人的博士论文能够成为「爆款文章」,但陈丹琦做到了。这位近日从斯坦福毕业
的计算机科学博士引发了人们的广泛关注。据斯坦福大学图书馆介绍,她长达 156 页
的毕业论文《Neural Reading Comprehension and Beyond》上传仅四天就获得了上千
次的阅读量,成为了斯坦福大学近十年来最热门的毕业论文之一。
斯坦福大学还因此对陈丹琦进行了一次简单采访。
陈丹琦激动人心的研究迅速在社交网络和其他专注机器学习的新闻网站上传播。她的指
导老师——斯坦福 AI 实验室负责人、人工智能领域著名学者、斯坦福大学语言学和计
算机科学教授克里斯托弗·曼宁(Christopher Manning)在采访中表示:「陈丹琦是
使用神经网络方法解决自然语言理解问题方面的先驱。她简单、干净、高成功率的模型
吸引了众人的目光……她的这篇毕业论文主要研究神经网络阅读理解和问答,这些新兴
技术正在带来更好的信息访问方式——它可以让计算机系统可以真正回答你的实际问题
,而不是简单地返回... 阅读全帖

发帖数: 1
48
来自主题: Military版 - 新转CS的千老
parser, 现在叫AI。
T*******x
发帖数: 8565
49
来自主题: Military版 - 新转CS的千老
Grammar 不就是parser吗?
T*******x
发帖数: 8565
50
来自主题: Military版 - 新转CS的千老
NLP有语法吗?parser怎么写?
首页 2 3 4 5 6 末页 (共10页)