# Path: conceptnet/corpus/models.py
# class ScoredModel(object):
# class Language(models.Model):
# class Sentence(models.Model, ScoredModel):
# class TaggedSentence(models.Model):
# class DependencyParse(models.Model):
# class Frequency(models.Model):
#     class Meta:
#     def get_rating(self, user):
#     def set_rating(self, user, val, activity=None):
#     def update_score(self):
# def denormalize_votes(sender, instance, created=False, **kwargs):
# def get_lang(lang_code):
#     def __str__(self):
#     def get(id):
#     def nl(self):
#     def __unicode__(self):
#     def update_consistency(self):
#     def tagged_words(self):
#     def __unicode__(self):
#     def from_string(sentence_id, depstring):
#     def __unicode__(self):
#     def __unicode__(self):
#     _PARSE_RE = re.compile(r"(.+)\((.*)-(\d+)'*, (.*)-(\d+)'*\)")


from django.db import models
from django.db.models import Q
from conceptnet.corpus.models import Language, Sentence, User, ScoredModel, Frequency
from events.models import Event, Activity
from voting.models import Vote, SCORES
from django.contrib.contenttypes import generic
from csc_utils.cache import cached
from datetime import datetime
from urllib import quote as urlquote
        from django.db.models import F
import re
    A vote on an Assertion by a User.

    This is temporarily a view of the big Votes table:

    CREATE VIEW temp_assertion_votes AS
      SELECT id, user_id, object_id AS assertion_id, vote
        FROM votes WHERE content_type_id=68;
    """
    user         = models.ForeignKey(User)
    assertion    = models.ForeignKey(Assertion)
    vote         = models.SmallIntegerField(choices=SCORES)

    class Meta:
        db_table = 'temp_assertion_votes'
'''

class RawAssertion(TimestampedModel, ScoredModel):
    """
    A RawAssertion represents the connection between an :class:`Assertion` and
    natural language. Where an Assertion describes a :class:`Relation` between
    two :class:`Concepts`, a RawAssertion describes a sentence :class:`Frame`
    that connects the :class:`SurfaceForms` of those concepts.
    
    A RawAssertion also represents how a particular :class:`Sentence` can
    be interpreted to make an Assertion. :attr:`surface1` and :attr:`surface2`
    generally come from chunks of a sentence that someone entered into Open
    Mind.
    """
    sentence = models.ForeignKey(Sentence, null=True)
    assertion = models.ForeignKey(Assertion, null=True)

# Path: conceptnet/corpus/models.py
# class ScoredModel(object):
# class Language(models.Model):
# class Sentence(models.Model, ScoredModel):
# class TaggedSentence(models.Model):
# class DependencyParse(models.Model):
# class Frequency(models.Model):
#     class Meta:
#     def get_rating(self, user):
#     def set_rating(self, user, val, activity=None):
#     def update_score(self):
# def denormalize_votes(sender, instance, created=False, **kwargs):
# def get_lang(lang_code):
#     def __str__(self):
#     def get(id):
#     def nl(self):
#     def __unicode__(self):
#     def update_consistency(self):
#     def tagged_words(self):
#     def __unicode__(self):
#     def from_string(sentence_id, depstring):
#     def __unicode__(self):
#     def __unicode__(self):
#     _PARSE_RE = re.compile(r"(.+)\((.*)-(\d+)'*, (.*)-(\d+)'*\)")


# Path: conceptnet/models.py
from django.db import models
from django.db.models import Q
from conceptnet.corpus.models import Language, Sentence, User, ScoredModel, Frequency
from events.models import Event, Activity
from voting.models import Vote, SCORES
from django.contrib.contenttypes import generic
from csc_utils.cache import cached
from datetime import datetime
from urllib import quote as urlquote
        from django.db.models import F
import re

    A vote on an Assertion by a User.

    This is temporarily a view of the big Votes table:

    CREATE VIEW temp_assertion_votes AS
      SELECT id, user_id, object_id AS assertion_id, vote
        FROM votes WHERE content_type_id=68;
    """
    user         = models.ForeignKey(User)
    assertion    = models.ForeignKey(Assertion)
    vote         = models.SmallIntegerField(choices=SCORES)

    class Meta:
        db_table = 'temp_assertion_votes'
'''

class RawAssertion(TimestampedModel, ScoredModel):
    """
    A RawAssertion represents the connection between an :class:`Assertion` and
    natural language. Where an Assertion describes a :class:`Relation` between
    two :class:`Concepts`, a RawAssertion describes a sentence :class:`Frame`
    that connects the :class:`SurfaceForms` of those concepts.
    
    A RawAssertion also represents how a particular :class:`Sentence` can
    be interpreted to make an Assertion. :attr:`surface1` and :attr:`surface2`
    generally come from chunks of a sentence that someone entered into Open
    Mind.
    """
    sentence = models.ForeignKey(Sentence, null=True)
    assertion = models.ForeignKey(Assertion, null=True)

    creator = models.ForeignKey(User)