copperwater / sentencecraft Goto Github PK
View Code? Open in Web Editor NEWComplete each others' sentences. Don't Finish What You Start.
License: Other
Complete each others' sentences. Don't Finish What You Start.
License: Other
When returning from any @app function, you can provide a second parameter to the return statement that represents the error code, as in return "Success", 200
. I have done this for a couple success messages, but every such return statement should have an appropriate HTTP code, including all the errors.
Currently to mitigate the problem of complete lexeme collections being sorted by object ID (and thus sorting them in order of creation), we delete and re-insert them upon completion. This is terrible design and it should be an update. Thus, we should add a timestamp to track the last change made to a sentence, to be set when it is created and changed when it is appended to. Then we can just add that as the default sort for view.
when the keyboard is present, async task seem to not be able to add to the snack bar. That or it's being covered by the keyboard.
The backend will send data about sentences in a json format. Will have to parse it. Android seems to have its own json parser so we can use that. Example on how this can be done here:http://www.tutorialspoint.com/android/android_json_parser.htm
Add Sentence.py and SentenceCollection.py with the appropriate modules, expand the database to include a new "paragraphs" collection, and modify app.py so that it can handle requests for both types of lexemes.
Create a mockup of the view sentences page.
Just like the backend can't assume that the frontend clients will give it proper and valid requests, the frontends can't assume that the backend isn't compromised. The Web frontend in particular needs to make sure that tags, especially <script> tags, that come through the API can't be parsed as part of the DOM. This can be done by ensuring that all data from the server that will be displayed to the user is correctly escaped.
The mobile apps don't really need to worry about this.
The settings page for the application should be able to configure the ip address and port of the server to connect to
The iOS app needs to be able to parse user input into JSON format and be able to parse JSON input into something users are able to understand.
The iOS app needs to be able to communicate with the backend: meaning sending and receiving requests from the backend.
app.py is our backend and listens on port 5000. Our android application should send requests to that place. http://stackoverflow.com/questions/3505930/make-an-http-request-with-android provides a possible way to make an http request
Dunno why. This is most likely coming through the web app but backend validation should be set up. Alternatively, the backend could be redesigned so that if something isn't tagged, it just won't have a tag field (instead of tags: []).
This is to prevent someone from DDOSing the server by having a bot constantly spam /incomplete and never release any of the sentences. I don't know how hard this would be to make it work with Flask, though.
After #5 is done, add behavior to make an AJAX request that will make the correct API call and create and populate the (possibly different) page structure as a callback.
This should not happen. There should be no tags parameter in the POST request at all if no tags are being submitted. But the backend should also prevent this from happening, which it isn't.
Since the append behavior requires a key anyway, and that key is uniquely associated with a certain lexeme collection with a certain type. If we stored the type along with the key, we could remove the type parameter from this API behavior.
Parse data from server
Dynamically add that data to the table.
There are several try...except statements in the backend code that do not specify the type of error that should be caught by the except statement. This is a bad practice in Python. We need to figure out which exception type is intended to be caught by the block (probably ValueError for all of them but I can't be sure) and narrow the except statement to catch only that type.
There needs to be a check in both the start and append behaviors for this.
Implement Javascript to change the format of the main page content when the mode buttons are clicked. The lexeme switching buttons don't need to do anything yet.
For IOS and Android, they are not allowed to send HTTP requests w/ spaces in them and this require encoding but the API will not recognize this encoding and thus will not return the correct data but will return a 503 instead.
This is causing some problems with the Android app, when the keyboard likes to insert a space after the user is done typing. There's no reason to regard outer whitespace as part of the input, so it should be removed.
Generating keys immediately created on start on sentence. Should be generated per add request. Ideally keys should expire after a timeout.
There is currently an empty Unit Tests folder in the iOS project; that needs to be populated with some unit tests.
Click Add Tag (in view or start) -> focus switches to the newly created tag box
Click Remove Tag (in start only) -> focus switches back to the main entry field
Switch modes -> focus switches to the main entry field
No idea why this is happening. I look at the view mockup, click in the middle of one of the sentences, and a cursor appears where I clicked. This text is not editable, so there should not be a cursor there.
I am observing this in Firefox 45.0 on Ubuntu.
Currently once a lexeme collection is checked out there is no way to intentionally drop it and tell the server that there will be no continuation coming from the client. A fifth API behavior should be added that will do the functions (same as those used in the continue behavior) of releasing the key from a lexeme collection. This would be used when someone gets an incomplete sentence and then decides to switch modes or lexemes.
Once the API supports it, new issues can be created for the various frontends.
Make the mockup for Web sentence starting behavior
parse user input
send that to the server
receive user input
parse and send that to server
Make the API behavior to start sentences (with either one or several words, we can decide), validate the words, and insert the resulting incomplete sentence into the database.
Currently, the start and append behaviors require a type to be specified and error out if it is not. These should default to Word if it is unspecified, the same as the other two behaviors.
I think that the backend should maintain a map (dictionary) of LexemeCollection keys to LexemeCollections, signifying all the current "active" LexemeCollections that have been requested and are waiting on contimuation/completion. When someone makes an /incomplete-sentence request, it will get pulled out, the class will be created, and it will be inserted into the map. When someone makes a submission request, it will take the key and use it to look up that LexemeCollection, and store it back in the database. The backend will periodically poll this list and remove collections that have been there for a certain amount of time (the timeout).
This might actually remove the need for keys to be a part of the class.
There is no way to convert data extracted from the database into a WordCollection representation. We need to implement this.
Each LexemeCollection needs to store its object ID from the database, so it can re-access its record when some other database operation needs to be performed with it (like checking it out).
The android application currently does not use unit test. Use http://developer.android.com/training/testing/unit-testing/index.html for unit test so that we don't run into any regression issues
This function needs to exist as the main way we will convert LexemeCollection data to a format presentable in the JSON API.
I'm not really sure why this happens since the field is hidden on load in the clear_fields function. It works when switching panels.
Don't allow the frontends to be able to access the full list of lexemes. The admins should be able to configure the maximum number of trailing lexemes that show up at the end of a sentence (like 3 or 5).
It should stay in the same mode as it was before the user switched lexemes.
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.