7 kyu
NLP-Series #1 - Inverted Index
194 of 342ProcrasTech
Loading description...
Fundamentals
Parsing
Regular Expressions
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Python: Random tests are vulnerable to input modification
Like others, i don't understand what I need to do. xD
Another one of those guesswork katas..........
Description does not mention what kind of character range constitutes the
term
Does not mention how to filter based on
caseSensitive
flag (tho the name itself is self-relevant but that should not be an excuse for not having an explanation)Does not mention how to filter based on
exactMatch
(What should the perceding and leading characters be?? Does the term being at the front or end of the words or both to be considered as an exact match??Description should be language-agnostic
The title has nothing to do with the task, in fact brings more misunderstanding and fuss ~~
This has no way near 7kyu, considered the fact that it uses advanced regex operations && compared to a lot of 6kyu katas which just do string replacement or transfomation
Hence, discussion to send back to beta / retirement has been initiated!
I love this kata. There are several ways to improve it, though. I think the instruction need to be more detailed. How can I can edit the instructions?
Hey, sorry for being absent. I was busy moving to another city. I do not know how or if i can give you edit rights. What would be your suggested instructions? Greetings and stay safe
Hi,
I already forget how to improve it. I am thinking about Term Frequency – Inverse Document Frequency (TF/IDF) when I saw this kata. Let me redo this kata and get back to you. I don't know about edit right. I don't even know how to create my own kata yet... :D
Reraised above ~~
Python translation 🐍
Please review and approve.
Done and done. Thank you :)
Passing an
Array
ofString
s but expecting a comma-separated string to be returned seems inconsistent. And, plain and simple, an inappropriate use of datatypes.Can I make a case for expecting an
Array
ofNumber
s to be returned while we're still in Beta?Maybe the author doesn't know about
Test.assertSimilar
andTest.assertDeepEquals
so he doesn't know how to properly compare arrays? (Do you really think this is anissue
and not asuggestion
?)I agree with Johan. Returning an array is simpler, more logical and is not as ugly as a comma-separated string without spaces v_v
It was up for immediate approval, that's why I made it an issue. It should be a suggestion, but then someone would grab a point and we would no longer be in Beta.
I can't argue against that. There was a reason to return a string that vanished once i kinda figured out how the test framework works (never used one before). Also, i thought publishing would push the kata in the draft stage (3rd day on Codewars, learning the ropes)
Edit: Changed return datatype to array. Waiting for outside confirmation ;)
Ah no, saving creates a Draft, publishing creates a Beta. Which is entirely the correct thing to do. :] Getting ( enough ) upvotes and solutions then, at some point, creates an approvable kata, and somebody with enough points can then approve it. Unresolved issues prevent being approvable ( well, until you have a lot of solutions and upvotes ). That's more or less how that works, in a nutshell. Resolving an issue is just a check mark under a post, you don't need to actually solve the problem. ( Most of the time, you should, of course. :P ) Also, raising an issue should not be considered a personal attack on author / translator / kata.
I understand you've discovered
Test.assertDeepEquals
. Good. :] It's practically the only test you really need ( it can function asassertEquals
as well ), besides, much less often,assertApproxEquals
andexpectError
.Looking good. Closing. :]
ETA: and approving.
Haha, now im giddy. Honestly, i didn't think anybody would care about my kata. This community is amazing hitherto!
The description is lacking. It should explain what we are asked to do, not just say "inverted index is very cool, go find out yourself what it is".
I've updated the description. Is that better?
Uhh, I can't really see any changes. The problem is you don't specify what "inverted index" is. As I understood this is basically a
1-based
indexing of strings which correspond to some pattern, but you don't explain it properly anywhere.Instead of having an index that links to terms a document contains (because massive), create an index for each term linking to the documents where that term occurs.
index: document -> term1,term2,term3
inv index: term -> document1,document2,document3
Sry, i struggle wording this
Have a look at this
I'll try to come up with a better description when i get home
I understood what it meant and just solved it. I also changed the description to be more clear.
Perfect. Thanks!
While using
expect
, if some cases failed, no one will know the expected value.assertEquals
should be used.Actually there are no need to test these separately
Because
sorted in ascending order seperated by a comma
is already required in the desc.assertEquals
should and only be used.I'll try to get on top of that. Thanks But first ... Coffee
Using only assertEquals now. Removed unneccessary tests.
randomNumber
is not a getter but a methodFixed that. Is it customary for authors to mark issues as resolved or is that up to the community?
You can do it yourself, but only when you have 100% confidence.
So you can, but you really shouldn't. :P
Better to always get outside confirmation.