Download SourceCode/Models/Lexicon/RootAndPatterns/UnvoweledPattern.py from kachaf/qutuf: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/spaces/kachaf/qutuf/resolve/main/SourceCode/Models/Lexicon/RootAndPatterns/UnvoweledPattern.py
- Command line
-
hf download hf://spaces/kachaf/qutuf/SourceCode/Models/Lexicon/RootAndPatterns/UnvoweledPattern.py
-
curl -L -o UnvoweledPattern.py https://huggingface.co/spaces/kachaf/qutuf/resolve/main/SourceCode/Models/Lexicon/RootAndPatterns/UnvoweledPattern.py
1.17 kB
| ''' | |
| Created on ٢٩/٠٤/٢٠١٠ | |
| @Created by: Muhammad Altabba | |
| ''' | |
| class UnvoweledPattern(object): | |
| """ | |
| # PyUML: Do not remove this line! # XMI_ID:_qz4WCI35Ed-gg8GOK1TmhA | |
| """ | |
| ''' | |
| Unvoweled Pattern | |
| ''' | |
| String = ''; | |
| Rules = []; | |
| IDs = []; | |
| def __init__(self, string, rules, ids): | |
| ''' | |
| Constructor | |
| ''' | |
| self.String = string; | |
| self.Rules = rules; | |
| self.IDs = ids; | |
| pass | |
| def GetRootsStringsAndRules(self, string): | |
| if (string == None): | |
| string = self.String; | |
| rootStrings = []; | |
| rootRules = []; | |
| for j in range(len(self.Rules)): | |
| rootRule = ''; | |
| rootString = ''; | |
| for k in range(len(self.Rules[j])): | |
| rootRule += self.Rules[j][k]; | |
| if self.Rules[j][k].isdigit(): | |
| rootString += string[int(self.Rules[j][k]) - 1]; | |
| else: | |
| rootString += self.Rules[j][k]; | |
| rootStrings.append(rootString); | |
| rootRules.append(rootRule); | |
| return [rootStrings, rootRules]; | |