Ejemplo n.º 1
0
def makeInfobox(details, counts):
    district = transtelugu(details[0].strip(), 0)
    city = transtelugu(details[2].strip(), 0) + ", " + district
    students = str(numToTelugu(int(counts[2]) + int(counts[3])))
    teachers = str(numToTelugu(int(counts[5]) + int(counts[6])))
    lo, hi = getGrades(details[5].strip())
    medium = transtelugu(details[7].strip(), 0)

    title = getTitle(details[4].strip())

    # Make "state" variable
    # Add school type
    infobox = '''\n
{{Infobox school
| name = ''' + title + ''' 
| city =''' + city + '''
| district = ''' + district + '''
| state = ఆంధ్రప్రదేశ్
| country = భారతదేశము
| grades = ''' + str(lo) + '-' + str(hi) + '''
| medium = ''' + medium + '''
| students = ''' + students + '''
| faculty =''' + teachers + '''
}}\n\n
	'''
    return title, infobox
Ejemplo n.º 2
0
def write(data, df, Id):
    article = ""
    # Respective row details from pdf and excel data
    details, counts = getInfo(data, df, Id)

    #Sentence for name, village, district and block
    intro = getIntro(details)

    #Management
    management = transtelugu(details[6].strip(), 0)
    opts = [
        management + "నిర్వహణలో ఈ పాఠశాల ఉన్నది. ",
        "ఇది " + management + "నిర్వహణలో పని చేస్తుంది. "
    ]

    descLine = getDesc(details)
    oLine = random.choice(opts)

    #Classes
    lo, hi = getGrades(details[5].strip())
    cLine = getClass(lo, hi)

    #School Medium
    medium = transtelugu(details[7].strip(), 0)
    opts = [
        medium + "మాధ్యమం లో " + random.choice(["పాఠాలు ", "పాఠములు "]) +
        "బోధిస్తారు. ", "ఇక్కడ " + medium + "మాధ్యమం లో " +
        random.choice(["పాఠాలు ", "పాఠములు "]) + "బోధిస్తారు. "
    ]
    mLine = random.choice(opts)

    #School Type & student's counts
    studentStats = getStudentStats(counts)

    #Teachers counts + Reference Line
    teacherStats = getTeacherStats(counts)

    #Source
    #source ="ఈ వివరములు 2011-12 విద్యా సంవత్సరమునకు సంబంధించినవి. ఇవి నేషనల్ యూనివర్శిటీ ఆఫ్ ఎడ్యుకేషనల్ ప్లానింగ్ అండ్ అడ్మినిస్ట్రేషన్ (NUEPA) జరిపిన సర్వే ఆధారముగా ఇవ్వబడినవి. "
    source = "ఈ వివరములు నేషనల్ యూనివర్శిటీ ఆఫ్ ఎడ్యుకేషనల్ ప్లానింగ్ అండ్ అడ్మినిస్ట్రేషన్ ([https://www.indiaeducation.net/apexbodies/nuepa/ NUEPA]) జరిపిన సర్వే ఆధారముగా 2011-12 విద్యా సంవత్సరమునకు సంబంధించినవి."

    #Reference
    ref = "<ref>{{cite web |title =School Directory |url =http://udise.in/school_directory.htm |website = udise.in }}</ref>. "

    # Article Structure
    title, article = makeInfobox(details, counts)

    article = article + descLine + intro + oLine + cLine + mLine
    article = article + "\n\n" + studentStats + teacherStats + ref
    article = article + source

    article = article + "\n\n==మూలాలు==\n {{Reflist}}\n\n[[Category:School]]"

    return title, article
Ejemplo n.º 3
0
def getSchName(name):
    data = {}
    data['enName'] = name

    name = re.sub('^MPPS|^MPUPS|^ZPPS|^ZPHS|^KGBV', '', name)
    teName = transtelugu(name, 1)
    data['teName'] = teName

    return data
Ejemplo n.º 4
0
def getIntro(details):
    code = str(details[3]).strip()
    village = transtelugu(details[2].strip(), 0)
    district = transtelugu(details[0].strip(), 0)
    block = transtelugu(details[1].strip(), 0)

    introOpts = [
        "ఈ పాఠశాల " + village + "గ్రామంలో ఉన్నది. ఈ గ్రామం " + district +
        "జిల్లాలో " + block + "పరిధి నందు ఉన్నది. ",
        "ఈ పాఠశాల " + village + "గ్రామంలో ఉన్నది. " + district +
        "జిల్లా నందు " + block + "పరిధిలో ఈ గ్రామం ఉన్నది. ",
        district + "జిల్లాలో " + block + "పరిధిలో " + village +
        "గ్రామం నందు ఈ పాఠశాల ఉన్నది. ", "ఈ పాఠశాల " + district + "జిల్లాలో " +
        block + "పరిధిలో గల " + village + "గ్రామము నందు ఉన్నది. "
    ]

    intro = random.choice(introOpts)
    intro = intro + "ఈ పాఠశాల యొక్క ఏకీకృత జిల్లా సమాచార విద్యా వ్యవస్థ ([http://udise.in/ U-DISE]) కోడ్ " + code + ". "

    return intro
Ejemplo n.º 5
0
def getTitle(name):
    phrase = ""

    if "KGBV" in name:
        phrase = "కస్తూర్బా గాంధీ బాలికా విద్యాలయ (KGBV) "
    elif "MPPS" in name:
        phrase = "మండల ప్రజా పరిషత్ ప్రాథమిక పాఠశాల (MPPS) "
    elif "MPUPS" in name:
        phrase = "మండల ప్రజా పరిషత్ ప్రాథమికోన్నత పాఠశాల (MPUPS) "
    elif "ZPPS" in name:
        phrase = "జిల్లా పరిషత్ ప్రాథమిక పాఠశాల (ZPPS) "
    elif "ZPHS" in name:
        phrase = "జిల్లా పరిషత్ ఉన్నత పాఠశాల (ZPHS) "

    name = re.sub('^MPPS|^MPUPS|^ZPPS|^ZPHS|^KGBV', '', name)

    title = phrase + transtelugu(name, 1)

    return title
Ejemplo n.º 6
0
def getData(details, title):
    names = getSchName(details[4].strip())
    enMgnt = details[6].strip()
    teMgnt = transtelugu(details[6].strip(), 0)

    village = transtelugu(details[2].strip(), 0)
    district = transtelugu(details[0].strip(), 0)
    block = transtelugu(details[1].strip(), 0)
    code = str(details[3]).strip()

    loInt, hiInt = getGrades(details[5].strip())
    lo = class_nums[loInt]
    hi = class_nums[hiInt]
    medium = transtelugu(details[7].strip(), 0)

    sType = details[9].lower()
    bInt, gInt = details[11], details[12]
    bCount = numToTelugu(details[11])
    gCount = numToTelugu(details[12])
    endBCount = numToTelugu(details[11], 0)
    endGCount = numToTelugu(details[12], 0)
    totalStudents = numToTelugu(details[13])

    fInt = int(details[15])
    mInt = int(details[14])
    fCount = numToTelugu(details[15])
    mCount = numToTelugu(details[14])
    totalTeachers = numToTelugu(fInt + mInt)

    data = {
        "title": title,
        "enName": names['enName'],
        "village": village,
        "district": district,
        "block": block,
        "state": "ఆంధ్రప్రదేశ్",
        "country": "భారతదేశము",
        "code": code,
        "medium": medium,
        "enMgnt": enMgnt,
        "teMgnt": teMgnt,
        "lo": lo,  #the transliteration of lower class in telugu
        "loInt": loInt,
        "hi": hi,  ##the transliteration of higher class in telugu
        "hiInt": hiInt,
        'sType': sType,
        'totalStudents': totalStudents,
        'bInt': bInt,
        'gInt': gInt,
        'bCount': bCount,
        'endBCount': endBCount,
        'gCount': gCount,
        'endGCount': endGCount,
        'mInt': mInt,
        'mCount': mCount,
        'fInt': fInt,
        'fCount': fCount,
        'totalTeachers': totalTeachers
    }

    return data