parsing

Boost::Spirit struggle with parsing a String

China☆狼群 提交于 2021-02-10 06:11:38
问题 I'm trying to Parse a String with Boost::Spirit, but i just cannot get it to work. I have no experience with Boost::Spirit since today. The string is composed of commands separated by an ';'. The commands are "INC someInteger" "BOMB firstInteger secondInteger" "MOVE firstInteger secondInteger thirdInteger" "MSG someString" "WAIT" I Managed to get this far: #include <boost/spirit/include/qi.hpp> #include <boost/phoenix/phoenix.hpp> using namespace boost::spirit; int main() { std::string

Boost::Spirit struggle with parsing a String

倖福魔咒の 提交于 2021-02-10 06:11:04
问题 I'm trying to Parse a String with Boost::Spirit, but i just cannot get it to work. I have no experience with Boost::Spirit since today. The string is composed of commands separated by an ';'. The commands are "INC someInteger" "BOMB firstInteger secondInteger" "MOVE firstInteger secondInteger thirdInteger" "MSG someString" "WAIT" I Managed to get this far: #include <boost/spirit/include/qi.hpp> #include <boost/phoenix/phoenix.hpp> using namespace boost::spirit; int main() { std::string

Boost Spirit x3 conditional (ternary) operator parser

我只是一个虾纸丫 提交于 2021-02-10 05:37:34
问题 I need to build an abstract syntax tree from mathematical expression that I later need to link domain specific objects together as a calculation tree. I found the expression parser library https://github.com/hmenke/boost_matheval as an excellent starting point. In my use case I need to have support for ternary conditional expressions condition ? true_exp : false_exp . As of now the parser is able to parse expressions such as 1 + (2 + abs(x)) or min(x,1+y) . However I would need to have syntax

SRGS - GRXML parsing via text input in java

半城伤御伤魂 提交于 2021-02-10 05:30:46
问题 I have an existing IVR voice application which uses SRGS .grxml grammar files. In the IVR our speech recognizer (Nuance) uses these grammars to take spoken input and return some values based on the particular grammar specified. I'm trying to find a java based tool which would use these same grammar files but allow me to send plain text in to be parsed according to the rules of the grammar. I've seen sphinx4 and they have a recognizer but it only uses microphone input from what I can tell. I'm

Creating a boost::spirit::x3 parser for quoted strings with escape sequence handling

a 夏天 提交于 2021-02-10 05:27:32
问题 I need to create a parser for quoted strings for my custom language that will also properly handle escape sequences, which includes allowing escaped quotes within the string. This is my current string parser: x3::lexeme[quote > *(x3::char_ - quote) > quote] where quote is just a constant expression for '"' . It does no escape sequence handling whatsoever. I know about boost::spirit::classic::lex_escape_ch_p , but I've no idea how to use that with the boost::spirit::x3 tools (or in general).

Separate address elements from 1 cell in Excel

≯℡__Kan透↙ 提交于 2021-02-10 05:27:16
问题 I have thousands of addresses in this format: 123 Happy St. Kansas City, MO 64521 9812 Main Street Minneapolis, MN 62154 12 Virgina Ave, Apt 8, Dallas, TX 54334 I want to extract the address, city, state, zip into individual cells (without using VB if possible). I've tried a couple variations of other methods posted, but I can't quite get desired results. 回答1: Analyze your problem! you want to split your address string at the comma you then want to split the right fragment from (1) at the

Separate address elements from 1 cell in Excel

偶尔善良 提交于 2021-02-10 05:26:14
问题 I have thousands of addresses in this format: 123 Happy St. Kansas City, MO 64521 9812 Main Street Minneapolis, MN 62154 12 Virgina Ave, Apt 8, Dallas, TX 54334 I want to extract the address, city, state, zip into individual cells (without using VB if possible). I've tried a couple variations of other methods posted, but I can't quite get desired results. 回答1: Analyze your problem! you want to split your address string at the comma you then want to split the right fragment from (1) at the

Separate address elements from 1 cell in Excel

我的未来我决定 提交于 2021-02-10 05:26:12
问题 I have thousands of addresses in this format: 123 Happy St. Kansas City, MO 64521 9812 Main Street Minneapolis, MN 62154 12 Virgina Ave, Apt 8, Dallas, TX 54334 I want to extract the address, city, state, zip into individual cells (without using VB if possible). I've tried a couple variations of other methods posted, but I can't quite get desired results. 回答1: Analyze your problem! you want to split your address string at the comma you then want to split the right fragment from (1) at the

Troubles parsing DateTime from string

倖福魔咒の 提交于 2021-02-09 11:12:49
问题 I am currently trying to parse a string that is obtained from an xml that is downloaded from the web every few minutes. The string looks like this: Thu Jul 12 08:39:56 GMT+0100 2012 At first I just did a string.split and took out everything after the time ( GMT+0100 2012 ) and inserted 2012 after the date. This worked great until the date changed to: Thu Jul 12 08:39:56 GMT+0000 2012 So I would like to dynamically pasre the GMT+ whatever as they send me that string in c#. Any advice would be

Troubles parsing DateTime from string

久未见 提交于 2021-02-09 11:12:28
问题 I am currently trying to parse a string that is obtained from an xml that is downloaded from the web every few minutes. The string looks like this: Thu Jul 12 08:39:56 GMT+0100 2012 At first I just did a string.split and took out everything after the time ( GMT+0100 2012 ) and inserted 2012 after the date. This worked great until the date changed to: Thu Jul 12 08:39:56 GMT+0000 2012 So I would like to dynamically pasre the GMT+ whatever as they send me that string in c#. Any advice would be