Parsing is the process of analysing a string of symbols, either in natural language or in computer languages, conforming to the rules of a formal grammar.

learn more… | top users | synonyms (1)

7
votes
0answers
42 views

HTML Parser (using SAX)

Got bored writing a review on an HTML parser and decided I wanted to try. So I threw this together to see I could parse an Amazon page. ...
3
votes
2answers
61 views

HTML parsing algorithm for extracting <a> tags

My intention is to create a complete HTML parser, so far I made a basic algorithm that iterates trough text and extracts everything in an "a" tag. It works on everything I tried, but I want a review ...
3
votes
0answers
50 views

CSV file parser and compare

This may seem like a lot of stuff? I just need help with 2 small parts the code works, however I have provided the rest of the info in case some one can help. USING PYTHON 3.4 Code below is ...
1
vote
2answers
45 views

Phone number/email regex verifier

Is there anything I can do better here? I tried looking for ways to simplify this with comprehension but could not figure out how and was told it is better to explicitly use ...
6
votes
3answers
587 views

Determine if a file is either in JSON or XML format

The purpose of this function is to determine if report_input_file is either in JSON format or XML format, this is what I came up with, just want to know if this is ...
3
votes
0answers
46 views

Facet for simple math expressions

I've built simple math expression facet which ignores any character except numbers and operators listed below: plus, minus, multiply, divide, degree, left bracket, right bracket, assignment I'm ...
1
vote
0answers
50 views

Moving a div inside p by to the body element

I get malformed HTML input with divs inside other HTML elements like the ...
2
votes
1answer
42 views

Processing a string containing product variants

I have a variable containing a string in this format "Size-XS|Size-XL|Color-Red|Color-Green". When i process it the final result is "Variations: Size: XS, XL, Color: Green, Red. The code for this is ...
-2
votes
0answers
13 views

My pandas parellelization is not working, please advise [migrated]

I have written the below code to parallelize my pandas script, but it seems to be not working, can you advise what went wrong. To give an idea My code is taking data from the data frame grouped by "...
6
votes
2answers
64 views

Simple ini file parser

The below is a C++ parser for a reasonably simple INI grammar (although my understanding is that there isn't an official spec as such). My grammar is roughly: ...
9
votes
2answers
451 views

Break a full name into a dictionary of its parts

It seems like I'm repeating myself here. Is there a standard way to deal with code like this? ...
2
votes
1answer
39 views

Efficiently calculating differences between file using diff file

I'm using SVNKit to get diff information between two revisions. I'm using the diff utility to generate a diff file, however I still need to parse it into numbers. I implemented a solution, but it is ...
0
votes
1answer
39 views

JavaScript to parse json that can be, string, object and array

I have to parse a json object that can be a string, array, array of strings and array of object. I realised that it's not good from the beginning that one object can be many types, but I can't change ...
2
votes
1answer
49 views

Optimizing Java HTML parser

I wrote a program that goes through a webpage and returns matches of regex. I used it on my letterboxd.com account to go through all of my movies (over 900 entries) and then find genres field for each ...
3
votes
1answer
52 views

Haskell Parsec parser of Verilog-style number literals

I've set myself the task to write a function that parses Verilog-style number literals. In Verilog, numbers are written like this: 8'b10101100, ...
6
votes
3answers
65 views

Bash script to extract HTML comment into a Markdown file

I learned Bash a million years ago. I just wrote this simple script used to get the first lot of HTML comments from a file, and spit it out in order to create a ...
3
votes
3answers
62 views

Parse 2D matrix, 2 versions

I'm writing a little C program that computes matrices (for learning purpose). The matrix is fed through arguments in the following form : "{{43,543.324,34},{43,432,87}}" The user doesn't give the ...
1
vote
0answers
25 views

Parsing latitude and longitude, using Try[T] to ignore errors

I wrote this question asking about how to implement my error handling while still maintaining functional code and based on 200_success's very interesting note on the spaces, I decided to ...
3
votes
0answers
10 views

Decompose string into parenthesed blocks in OCaml

The purpose of the OCaml code below is to decompose (or "parse") a string into parenthesed (or possibly non-parenthesed) blocks. ...
3
votes
2answers
46 views

Convert a String with comma separated latitudes and longitudes to a Seq[Coordinate]

I have a function that receives a String like the following: "-10.0 -10.0,10.0 10.0,0.0 0.0" And needs to translate that into ...
1
vote
2answers
43 views

Postman collection parser which injects collection to Jira/xray addon

I'we created an interface that communicates with Postman collection and Jira api more precise the Xray addon for jira. I would much appreciate if you could give me notes on how to improve this code. ...
7
votes
1answer
75 views

Using argparse module within cmd interface

I've created an application that uses a cmd interface. It has multiple levels, and the number of available commands and their complexity is growing. As such, I need to generalise argument parsing - of ...
6
votes
0answers
49 views

Parser for a custom scene definition format for a raytracer

For a raytracer I’ve been writing with a classmate, we use a custom scene definition format that allows specifying shapes, composite shapes, materials, lights, cameras and transform and render ...
13
votes
1answer
79 views

#TODO Remove duplication in XML parsing

I have to modify the number of points in this XML in order to test the performance of another program of mine. Here is an example of the XML I have to modify. performance.xml: ...
2
votes
2answers
109 views

Effective way to handle multiple time string to timestamp

I have 4 cases of time string as follow: s = "July 5, 2016, 12:04 a.m." s = "July 5, 2016, 7 a.m." s = "July 5, 2016, midnight." s = "July 5, 2016, noon." I want to convert string to timestamps....
7
votes
1answer
65 views

Fraction or integer parser

Question How can the following implementation of fractionParse be made less ugly? (Preserving unreduced numerators and denominators is supposed to be a feature---...
4
votes
2answers
79 views

Mathematical input parser

I made a simple math expressions solver that using a "for" loop iterates over all the characters and stores the numbers and signs in std::vector. It give support for unlimited parentheses and does ...
2
votes
1answer
148 views

PHP web crawler

I'm working on a "nice" crawler that start with one URL, and find the other URLs to process each page, a kind of "Google" crawler, to index pages. I worked hard on this crawler to respect many points ...
5
votes
2answers
46 views

Splitting a CAN bus log in .asc format

I've written a quick script for a coworker to split a large CAN log into smaller chunks. (If you're not familiar with CAN, it's a communication protocol used by the ECUs in many cars.) I know where ...
1
vote
1answer
61 views

Math expression parser in JavaScript

I've written the second iteration of my math expression parser, utilising what I learned from the first attempt to make a more reliable, maintainable piece of code. If anybody wants to see the first ...
1
vote
1answer
33 views

Vim command parser

I have a parser which consumes an ordered list of tokens (based on Vim's command grammar) and returns either: an error object, or an object that can be directly ...
2
votes
1answer
44 views

Parsing and executing a simple shell script

I'm writing a simple shell and want to parse and execute a simple shell script. ...
1
vote
1answer
88 views

Type converter framework (v2)

This is the second version of my type converter framework. The the previous one can be found here: Type creator service & framework In this version I mostly implemented what @Dmitry Nogin ...
3
votes
2answers
64 views

Type creator service & framework

I needed a mechanism for creating types dynamicaly from strings and bytes etc. I tried really hard to use the .net's TypeConverter system as it seemed to be the ...
4
votes
1answer
26 views

Parsing Gaussian09 frequency calculations, reformatting depending on desired output

Quite similar to my earlier review this script parses a frequency calculation and reformats the found values to either fit into one row for easier importing into a spreadsheet software or a formatted ...
2
votes
0answers
157 views

Binary protocol variability V3.0

Summary: Parsing an incoming stream of events from a binary communication protocol, if we have some variations in devices to support and would not like to have one huge switch to include everything. ...
3
votes
2answers
51 views

Netstring parser in common lisp

Below is a netstring parser I wrote in Common Lisp. The docstring contains the usage and return. ...
6
votes
1answer
40 views

Quoted string parser

I have written a string parser that is designed to split a string by spaces, excluding spaces wrapped in strings. Here is some example inputs and outputs: ...
2
votes
2answers
15 views

Resolve dependencies from output of PBS queueing system

I have written a script, that reformats the output of qstat -f1 of the PBS queueing system. Unfortunately this project is by far too big to post here complete, also ...
4
votes
2answers
40 views

Parsing Gaussian 09 output for energy statement on one or more files and reformat it to a table

I am a computational chemist working with the program Gaussian 09. After I manually check the output(s) I want to create a summary for easier processing of the obtained values. Also avoid opening all ...
5
votes
2answers
143 views

Simple Tokenizer + Parser

Requirements A function is needed, that is able to parse a list of symbols with the following rules: Symbols may be associated with numbers or not. Numbers are defined by a comma separed list ...
1
vote
0answers
33 views

Shortcode parser in Javascript

I've written a naive shortcode parser in JS that parses shortcodes akin to those found in Wordpress. The intention is for this to be used in realtime on the client in order to preview edits on the ...
3
votes
1answer
24 views

Mathematical equation syntax tree

I'm writing these pieces of code to parse expressions in the context of a dice rolling application for DnD. It's pretty much my first try using TypeScript and I'm ...
0
votes
0answers
7 views

Most performant filtering method for nested XML using Google Apps Script

Assuming a theoretical XML hierarchical file exported from an analysis tool thus: ...
7
votes
3answers
212 views

ini file parser in C++

Please review my ini file parser (and potentially some general config file formats). The data structure used is a section, see below. Does that seem a good approach? I was wondering about the name. ...
2
votes
2answers
71 views

Enum for converting between field naming conventions

Based on this question and this answer, I decided to try the enum approach to do some more conversions I need in my application. This time I required to convert between the different field naming ...
3
votes
2answers
125 views

Parsing a string with named sections and a key-value pair on each line

I have a response String as shown below which I need to parse it and store it my class. Format is shown below: task name followed by this dotted line -------------...
1
vote
1answer
83 views

FIRST and FOLLOW sets calculator in Haskell

I found myself wanting to brush up on some notions about parsers and grammars and, at the same time, to exercise my Haskell - I am a Haskell newbie; moreover, I haven't touched the language at all in ...
2
votes
2answers
55 views

Shell command-line interpreter with pipeline parsing

Like many others I've been writing a shell command-line interpreter that can do a pretty decent pipeline parsing, first it splits the command at pipeline char (|), then it splits the substring at ...
2
votes
1answer
50 views

Pen-and-Paper Dice Roller Tool

A friend asked me to write a pen-and-paper dice roller, so I put this together. I'm still pretty new to Java Swing, so I was hoping I could have some advice on how I handled the layouts and everything,...