can a top-down parser detect ungrammaticality an input string? [closed] - parsing

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I read that its possible to do this ,
Will it require backtracking?
What would be the sketch from recovering from the parsing errors .

The way a top down parser can detect the ungrammaticality, i.e. the invalidity of an input string is, for example:
if you have the non-terminal A on the top of your stack for instance, and the next token in your input string is the symbol b,
then go to your parse table and go to the row for A, and the column for b, and if there is an empty cell, then the input string is invalid.
A method to recover would be to entry panic mode, where you skip tokens in the input string until you find one in the synchronising set, and then pop A off the stack and continue.
several ways of choosing the synchronising set, it could be follow(A) for example

Related

how to remove irrelevant features in document classification from Weka? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
in Weka, text classification have a lot of features after applying feature selection how to remove irrelevant features in process tab quickly not one by one since in text classification the number of feature is high and it needs time to remove one by one.
Use the Remove filter for removing ranges of attributes in the Preprocess panel.
But instead of just post-processing the data, you could also change the default parameters of the StringToWordVector filter to produce more meaningful output:
change the minimum term frequency (option: -M, property: minTermFreq)
use a stopwords handler (option: -stopwords-handler, property: stopwordsHandler) like WordsFromFile.

Why do we check if empty before we move? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I see a lot of codes like this:
if WA > SPACES
move WA to WA2
end-if
What are the advantages that this is checked? Is it more efficient to check if it is empty than to just move it anyways?
Additional information:
WA and WA2 can be simple structures (without fillers) but also just simple attributes. They are not redifined and typed as chars or structures of chars. They can be either low-values (semantically NULL) or have alphanumeric content.
Nobody can tell you what the actual reason is except for the people who coded it, but here is a very probable reason:
Usually this is accompanied with an ELSE that would cover what happens if the value is less than spaces, but in this case I would assume that what every happens to this data later is relying on that field NOT being LOW-VALUES or some funky non-displayable control character.
If I had to guess, I would assume that WA2 is initialized to spaces. So doing this check before the move ensures that nothing lower than spaces would be moved to that variable. Remember, less than spaces does not mean empty, it just means that hex values of that string are less than X'40' (so for example is the string was full of low values, it would be all X'00'. So I would guess that its more about ensuring that the data is valid than efficiency.

is one hot encoding is free of the dummy trap [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
there is a thing called dummy trap in one hot encoder that is when we encode the categorical column with 3 categories lest say a,b,and c then with one hot encoder we get 3 categories like or columns a, b ,and c but when we use get_dummies we get 2 columns instead a, and b then it is save from dummy trap. is one hot encoding exposed to dummy trap or it takes care of it . am i right? which one is save of dummy trap? or is it ok to use both with our removing columns, iam using the dataset for many algorithms.
looking for help . thanks in advance.
OneHotEncoder cannot process string values directly. If your nominal features are strings, then you need to first map them into integers.
pandas.get_dummies is kind of the opposite. By default, it only converts string columns into one-hot representation, unless columns are specified.

card swipe status and identification information [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How I can get card swipe status and identification information from card data when card is swiped.
I'm using Velocity Card Reader and want to integrate Velocity payment SDK.
For Authorize(P2PE) APIs of Velocity Required Following parameters
KSN
Encrypted Track2 data
Swipe status
Identification Information
I know how to get KSN and track2 data but don't known how to get remaining two parameters.
Example hex card data :
02ee00801f4221008383252a343239332a2a2a2a2a2a2a2a323532355e56414c5545442043555354
4f4d4552202020202020202020202f5e323530322a2a2a2a2a2a2a2a2a2a2a2a2a2a3f2a3b343239
332a2a2a2a2a2a2a2a323532353d323530322a2a2a2a2a2a2a2a2a3f2a913dc86ebf7541cc5c7518
8613f1e859c5204c3c4944a58b7e14bd1d323d415d00417a06ee63b64fe8e16e449057fb23be8fa9
e7baea4039d2944ea42b6fcf219ba0516af3005f9629adc5255602968e93b4360e1311cc76f66865
d6b4dfe1dd211573ad801d494efb7345af93138fdd35323554383939373939789001000000004000
f403d903
Thanks
That's hex-encoded data. Using an online conversion tool, you can see the raw data is:
îB!%*4293********2525^VALUED CUSTOMER /^2502**************?
*;4293********2525=2502*********?*=Èn¿uAÌ\uñèYÅ L<ID¥~½2=A]Azîc¶Oèán
DWû#¾©çºê#9ÒN¤+oÏ! Qjó_)­Å%V´6ÌvöheÖ´ßáÝ!s­INûsE¯Ý525T899799x#ôÙ
Really though, you'd need to refer to the documentation for whatever you're using to swipe the card. It looks like it's fixed-width data given the large amount of whitespace after VALUED CUSTOMER, but that's a complete guess on my part.
If you want to parse this string from hex into the readable (ish) string above, there's a relevant answer here on Stack Overflow.

Prove that the following grammar is ambiguous [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
S-> A|B|AB
A-> aA, B-> bB, A->€, B->€
€ is the empty string.
Find a string and show that it has two
a-) parse trees
b-) leftmost derivations
c-) rightmost derivations
We're not gonna do your homework.
Build the parse tree using leftmost and rightmost derivations. If you can find any ambiguity, it is ambigious.
S-> A|B|AB is the key part. Try using both A, B and AB.

Resources