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
<provider | |
android:name="android.support.v4.content.FileProvider" | |
android:authorities="${applicationId}.provider" | |
android:exported="false" | |
android:grantUriPermissions="true"> | |
<meta-data | |
android:name="android.support.FILE_PROVIDER_PATHS" | |
android:resource="@xml/provider_paths"/> | |
</provider> |
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
<div class='post-share-buttons'> | |
<iframe allowTransparency='true' expr:src='"https://www.facebook.com/plugins/like.php?href=" + data:post.canonicalUrl + "&layout=box_count&show_faces=false&width=100&action=like&font=arial&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:55px; height:62px;'/> | |
<iframe allowTransparency='true' expr:src='"https://www.facebook.com/plugins/share_button.php?href=" + data:post.canonicalUrl + "&layout=box_count&show_faces=false&width=100&action=like&font=arial&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:55px; height:62px;'/> | |
<br /> | |
<b:include data='post' name='shareButtons'/> | |
</div> |
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
from nltk.corpus import wordnet | |
class thaiwordnet: | |
def __init__(self): | |
self._wordnet = wordnet | |
def synsets(self, word, pos=None, lang="tha"): | |
return self._wordnet.synsets(lemma=word,pos=pos,lang=lang) | |
def synset(self,name_synsets): | |
return self._wordnet.synset(name_synsets) | |
def all_lemma_names(self,pos=None, lang="tha"): | |
return self._wordnet.all_lemma_names(pos=pos, lang=lang) |
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
import face_recognition | |
picture_of_Steve_Jobs = face_recognition.load_image_file("Steve_Jobs_Headshot_2010-CROP.jpg") # ไฟล์ต้นแบบ | |
face_encoding = face_recognition.face_encodings(picture_of_Steve_Jobs)[0] # เข้ารหัสหน้าตา | |
unknown_picture = face_recognition.load_image_file("0x600.jpg") # ไฟล์ที่ต้องการตรวจสอบ | |
unknown_face_encoding = face_recognition.face_encodings(unknown_picture)[0] # เข้ารหัสหน้าตา | |
results = face_recognition.compare_faces([face_encoding], unknown_face_encoding) # ทำการเปรียบเทียบด้วย Face Recognition | |
if results[0] == True: | |
print("It's a picture of Steve Jobs!") | |
else: | |
print("It's not a Steve Jobs!") |
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
>>> from spacy.lang.th import Thai | |
>>> nlp = Thai() | |
>>> text="คุณรักผมไหม" | |
>>> a = nlp(text) | |
>>> a | |
คุณรักผมไหม | |
>>> list(a) | |
[คุณ, รัก, ผม, ไหม] |
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
คน | |
เล่น | |
แกม | |
ตา | |
จน |
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
>>> import spacy | |
>>> th_nlp = spacy.load('th') | |
>>> text="คุณรักผมไหม" | |
>>> a= th_nlp(text) | |
>>> a | |
คุณรักผมไหม | |
>>> list(a) | |
[คุณ, รัก, ผม, ไหม] |
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
# -*- coding: utf-8 -*- | |
"""Print most frequent N-grams in given file. | |
Usage: python ngrams.py filename | |
Problem description: Build a tool which receives a corpus of text, | |
analyses it and reports the top 10 most frequent bigrams, trigrams, | |
four-grams (i.e. most frequently occurring two, three and four word | |
consecutive combinations). |
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
import libscrc | |
def text_qr(account,one_time=True,country="TH",money="",currency="THB"): | |
""" | |
text_qr(account,one_time=True,country="TH",money="",currency="THB") | |
account is phone number or identification number. | |
one_time : if you use once than it's True. | |
country : TH | |
money : money (if have) | |
currency : THB | |
""" |
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
# -*- coding: utf-8 -*- | |
""" | |
โค้ดทดสอบก่อนถูกนำไปรวมกับ PyThaiNLP | |
ใช้ Apache License 2.0 | |
เขียนโดย นาย วรรณพงษ์ ภัททิยไพบูลย์ | |
""" | |
import re | |
""" | |
หลักการทำงาน | |
----------- |