I am working on a project similar to github, but instead of programming it has to do with language learning. The backend I am using is Django.
How the process will work:
User A submits a post -> other users can see submitted post -> user B decides he wants to correct user A's post -> user B clicks on user A's post -> user A's post is then broken up into individual sentences where each sentence is on a new line -> user B decides which sentence needs fixing -> once done, the changes are highlighted in green while deletions are striked out.
It would be similar to something like this:
My current model is set up as so:
class Post(models.Model):
user = models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = models.TextField()
...
class Corrections(models.Model):
user = models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
post = models.ForeignKey(Post, on_delete=models.CASCADE)
text = models.TextField(null=True)
...
Sentence splitting
I believe I should split these using regex to capture the "." then split()?
Problem
Since django cannot natively do this, I figure I would need a js library to accomplish this. I have no experience with js, so if possible can you outline the steps needed to accomplish this? How difficult would something like this be for a beginner? would using a framework for this be a good idea? Is there a library I can use to accomplish this (i tried searching, but no hits)?
Thank you for your time.