forked from Vasanth2005kk/VGLUG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccef799
commit 78a9926
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
பல நூற்றாண்டுகளாக செய்யுள் வடிவமே தமிழ் இலக்கியங்களிலும், தத்துவங்களிலும் பயன்படுத்தப்பட்டது. உரை வடிவம் இலக்கணங்களுக்கும், செய்யுள் விளக்கம் கூறவதற்கும், சாசனங்கள் (record) பதிவு செய்வதற்கும் பயன்படுத்தப்பட்டது. 20ஆம் நூற்றாண்டிலேயே உரை வடிவம் வளர்ச்சி செய்யுள் பெற்று, மக்களின் பல்வேறுபட்ட தேவைகளுக்கும் பயன்படுகின்றது. கட்டுரையே உரைநடை வெளிப்பாட்டின் முக்கிய வடிவம் end. | ||
|
||
பல நூற்றாண்டுகளாக செய்யுள் வடிவமே தமிழ் இலக்கியங்களிலும், தத்துவங்களிலும் பயன்படுத்தப்பட்டது. உரை வடிவம் இலக்கணங்களுக்கும், செய்யுள் விளக்கம் கூறவதற்கும், சாசனங்கள் (record) பதிவு செய்வதற்கும் பயன்படுத்தப்பட்டது. 20ஆம் நூற்றாண்டிலேயே உரை வடிவம் வளர்ச்சி செய்யுள் பெற்று, மக்களின் பல்வேறுபட்ட தேவைகளுக்கும் பயன்படுகின்றது. கட்டுரையே உரைநடை வெளிப்பாட்டின் முக்கிய வடிவம் end. | ||
|
||
பல நூற்றாண்டுகளாக செய்யுள் வடிவமே தமிழ் இலக்கியங்களிலும், தத்துவங்களிலும் பயன்படுத்தப்பட்டது. உரை வடிவம் இலக்கணங்களுக்கும், செய்யுள் விளக்கம் கூறவதற்கும், சாசனங்கள் (record) பதிவு செய்வதற்கும் பயன்படுத்தப்பட்டது. 20ஆம் நூற்றாண்டிலேயே உரை வடிவம் வளர்ச்சி செய்யுள் பெற்று, மக்களின் பல்வேறுபட்ட தேவைகளுக்கும் பயன்படுகின்றது. கட்டுரையே உரைநடை வெளிப்பாட்டின் முக்கிய வடிவம் end. | ||
பல நூற்றாண்டுகளாக செய்யுள் வடிவமே தமிழ் இலக்கியங்களிலும், தத்துவங்களிலும் பயன்படுத்தப்பட்டது. உரை வடிவம் இலக்கணங்களுக்கும், செய்யுள் விளக்கம் கூறவதற்கும், சாசனங்கள் (record) பதிவு செய்வதற்கும் பயன்படுத்தப்பட்டது. 20ஆம் நூற்றாண்டிலேயே உரை வடிவம் வளர்ச்சி செய்யுள் பெற்று, மக்களின் பல்வேறுபட்ட தேவைகளுக்கும் பயன்படுகின்றது. கட்டுரையே உரைநடை வெளிப்பாட்டின் முக்கிய வடிவம் end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# word position and replace the words in this program | ||
# this normal | ||
|
||
tamil_wordes=""" | ||
பல நூற்றாண்டுகளாக செய்யுள் வடிவமே தமிழ் இலக்கியங்களிலும், தத்துவங்களிலும் பயன்படுத்தப்பட்டது. உரை வடிவம் இலக்கணங்களுக்கும், செய்யுள் விளக்கம் கூறவதற்கும், சாசனங்கள் (record) பதிவு செய்வதற்கும் பயன்படுத்தப்பட்டது. 20ஆம் நூற்றாண்டிலேயே உரை வடிவம் வளர்ச்சி செய்யுள் பெற்று, மக்களின் பல்வேறுபட்ட தேவைகளுக்கும் பயன்படுகின்றது. கட்டுரையே உரைநடை வெளிப்பாட்டின் முக்கிய வடிவம் ஆகும். | ||
""".strip().split() | ||
|
||
input_word="செய்யுள்" | ||
repace_word="வசந்த்" | ||
|
||
index_position=0 | ||
position_numbers=[] | ||
|
||
for i in tamil_wordes: | ||
index_position+=1 | ||
if i == input_word: | ||
position_numbers.append(index_position) | ||
|
||
for word_positions in position_numbers: | ||
tamil_wordes.pop(word_positions-1) | ||
tamil_wordes.insert(word_positions-1,repace_word) | ||
|
||
print(" ".join(tamil_wordes)) | ||
|
||
|
||
# or | ||
|
||
tamil_wordes=""" | ||
பல நூற்றாண்டுகளாக செய்யுள் வடிவமே தமிழ் இலக்கியங்களிலும், தத்துவங்களிலும் பயன்படுத்தப்பட்டது. உரை வடிவம் இலக்கணங்களுக்கும், செய்யுள் விளக்கம் கூறவதற்கும், சாசனங்கள் (record) பதிவு செய்வதற்கும் பயன்படுத்தப்பட்டது. 20ஆம் நூற்றாண்டிலேயே உரை வடிவம் வளர்ச்சி செய்யுள் பெற்று, மக்களின் பல்வேறுபட்ட தேவைகளுக்கும் பயன்படுகின்றது. கட்டுரையே உரைநடை வெளிப்பாட்டின் முக்கிய வடிவம் ஆகும். | ||
""" | ||
|
||
input_word="செய்யுள்" | ||
repace_word="வசந்த்" | ||
|
||
replace_word_string=tamil_wordes.replace(input_word,repace_word) | ||
print(replace_word_string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# position checking | ||
|
||
def position_checking(input_word): | ||
|
||
f=open('tamil.txt','r+') | ||
|
||
text_file=f.readlines() | ||
text_file_length=len(text_file) | ||
|
||
json_formate={} | ||
textline_and_position_values=[] | ||
position_number=0 | ||
|
||
for index in range(text_file_length): | ||
positions=[] | ||
positions.append(f" line {index+1} positions ") | ||
|
||
for words in text_file[index].split(): | ||
position_number +=1 | ||
if words == input_word: | ||
positions.append(position_number) | ||
position_number=0 | ||
|
||
if len(positions) != 1: | ||
json_formate.update({positions[0]:positions[1::]}) | ||
|
||
return json_formate | ||
|
||
# answer=position_checking(input_word='செய்யுள்') | ||
# print(answer) | ||
|
||
|
||
# text file replace the values | ||
|
||
def file_replce_word(file_name,word,replace_word): | ||
reading_file_output=[] | ||
|
||
with open(file_name,"r") as reading_file: | ||
reading_file_output.append(reading_file.read().strip()) | ||
|
||
|
||
with open(file_name,"w") as write_file: | ||
|
||
for i in reading_file_output: | ||
replace_word_string=i.replace(word,replace_word) | ||
write_file.write(replace_word_string) | ||
|
||
|
||
file_name="tamil.txt" | ||
word="ஆகும்" | ||
replace_word="end" | ||
|
||
file_replce_word( | ||
file_name=file_name, | ||
word=word, | ||
replace_word=replace_word) |