wavii / pfp Goto Github PK
View Code? Open in Web Editor NEWPretty fast parser for probabilistic context free grammars
Pretty fast parser for probabilistic context free grammars
The empty string causes pfp to segfault (either in Python bindings or on the commandline), as does whitespace (\n, \t, ' ', combinations thereof).
When I run make
on OS X Snow Leopard 10.6.4 I get the following error:
/usr/bin/c++ -Dpfp_EXPORTS -DNDEBUG -fPIC -Iwavii-pfp-40d9e5a/include -I/usr/include/python2.6 -Wall -O3 -march=native -mtune=native `getconf LFS_CFLAGS` -o CMakeFiles/pfp.dir/src/pfp/config.o -c wavii-pfp-40d9e5a/src/pfp/config.cpp
getconf: no such configuration parameter `LFS_CFLAGS'
wavii-pfp-40d9e5a/src/pfp/config.cpp:1: error: bad value (native) for -march= switch
make[2]: *** [CMakeFiles/pfp.dir/src/pfp/config.o] Error 1
make[1]: *** [CMakeFiles/pfp.dir/all] Error 2
make: *** [all] Error 2
I use the universal binary for cmake
version 2.8.2 for Darwin to generate the Makefiles.
test
doesn't build. This should fix it:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,7 +60,7 @@ ELSE(APPLE)
TARGET_LINK_LIBRARIES(pfpd pfp boost_filesystem boost_thread boost_regex boost_system icuio icuuc)
TARGET_LINK_LIBRARIES(pfpc pfp boost_filesystem boost_thread boost_regex boost_system icuio icuuc)
TARGET_LINK_LIBRARIES(pfpc_token pfp boost_filesystem boost_thread boost_regex boost_system icuio icuuc)
- TARGET_LINK_LIBRARIES(test pfp boost_thread boost_unit_test_framework boost_regex icuio icuuc)
+ TARGET_LINK_LIBRARIES(test pfp boost_filesystem boost_thread boost_unit_test_framework boost_regex boost_system icuio icuuc)
ENDIF(APPLE)
INSTALL(TARGETS pfpd DESTINATION bin)
Also, I can't seem to install pfp to anywhere but /usr. When I set -DCMAKE_INSTALL_PREFIX
, I get:
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: ""
-- Installing: /usr/bin/pfpd
CMake Error at cmake_install.cmake:42 (FILE):
file INSTALL cannot copy file "/tmp/pfp2/pfpd" to "/usr/bin/pfpd".
make: *** [install] Error 1
I am trying to build on MacOs 10.10
I installed boost using homebrew.
Using make I get the following error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DNDEBUG -Dpfp_EXPORTS -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -fPIC -I/Users/stefan/Code/Brain/pfp/include -I/usr/include/python2.6 -Wall -O3 -o CMakeFiles/pfp.dir/src/pfp/tokenizer.yy.o -c /Users/stefan/Code/Brain/pfp/src/pfp/tokenizer.yy.cpp
In file included from ../etc/tokenizer.flex:5:
/Users/stefan/Code/Brain/pfp/include/pfp/tokenizer.h:7:10: fatal error: 'boost/optional.hpp' file not found
^
1 error generated.
I am not sure, why boost/optional.hpp is not part of the homebrew packet.
What is needed form this packet?
Is there a binary MacOS distribution somewhere with python bindings?
Although one can specify a token limit, the parser sometimes runs into problems with longer sentences:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pfp
>>> pfp.Parser(200).parse('The report is consistent of two parts in scrutiny level, with one part analysing from the point of view by our survey and views from the user (survey launched marked Heading 2), and with another part analysing from perspective by technical aspect through Achieving Excellence Design Evaluation Toolkit (AEDET Evolution) which is a tool for evaluating the quality of design in healthcare buildings and A Staff and Patient Calibration Toolkit (ASPECT) which is a tool for evaluating the staff and patient environment in healthcare buildings (Heading 3).')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: game over, man!
For instance:
He is my #1 fan.
Will return:
(ROOT
(S
(NP (PRP He))
(VP (VBZ is) (NP (PRP$ my) (ADJP (# ) (CD 1)) (NN fan)))
(. .)))
Instead of:
(ROOT
(S
(NP (PRP He))
(VP (VBZ is) (NP (PRP$ my) (ADJP (# #) (CD 1)) (NN fan)))
(. .)))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.