Getting off the ground with Ubercode

You have questions about Ubercode? Look here for your answers. You didnt find what you where looking for? Be the first to ask the question!

Getting off the ground with Ubercode

Postby forkinpm on Mon Feb 15, 2010 10:04 am

Hallo!
I have today installed the Ubercode product and am impressed with what I have found on running the first demo example programs.
To help me decide on how to proceed, I would like to ask for some help on tasks. which I will try to program.
They are based on processing text files of sentences (strings).
The tasks are the following (all to be command line execeuted when the have been successfully compiled):
1. Count the number of words in a sentence and print the number to the open window.
The file to be opened will either have only one sentence or the file will be opened and the sentence marked with mouseover.
2. Break the sentence into two clauses based on a "|" marking the line break.
3. Break each clause into phrases using commas as eol breakpoints.
In both of these tasks I will have prepared the text with the markers.
Is Ubercode a language to be used for such tasks?
Can such tasks be programmed by non-trained persons.
I am not a programmer, but a writer
Are there any archives of samples where I might find examples to explain the programming processes, or even offer me simple programs whicich I can modify to meet my goal needs.
I hope that I get some useful guidance and I thank any of you who can offer me any help.
Regards, forkinpm.
forkinpm
New Member
 
Posts: 6
Joined: Mon Feb 15, 2010 8:18 am

Re: Getting off the ground with Ubercode

Postby onykage on Mon Feb 15, 2010 4:47 pm

im sure anyone can pick up UC, its simple to use and pretty straight forward, altho some of the concepts used in programming require some experience to make it all work out otherwise you will end up quite frustrated.

I'm not sure if UC will work on the command line, its more of a GUI based language. UC is designed to make windows based GUI programming simple. The only reason i can see you would want something to work in the command line is if you were trying to build a plug-in or automate a process. In which case, UC may not be for you. How ever, if you want to make a stand alone tool that you can use a companion to another program to test and look for these kinds of variables, then yes UC is exactly what you want to learn as your first Language.

As far as will UC do what you want it to do, sure, I cant see why UC couldn't do those; provided that you wrote or used the correct algorithms to make it all happen. But, i will say this, some of what your wanting to do, doesn't exist. for example, having the program to be smart enough to identify a clause, thats gonna be quite a trick. Its one thing to break a sentence down into words, or a paragraph down into sentences, or even look for sentence fragments, and run ons. It is entirely something different to look for grammar specific concepts that can only be derived by knowing the words meaning and being able to evaluate its usage in the current sentence. That my friend is something no programming language has yet to do. And its not because the language cant do it, no no, its because no one has designed an algorithm that is capable of doing such a task.

You said your not a programmer so Im gonna stretch my neck out of my shell abit and try to explain some of these concepts to maybe speed you on your way to your goal. For starters an algorithm is merely a mathematical evaluation of a data structure. A data structure is exactly what it sounds like, data you pass to a program to logically evaluate.

So lets say for example, you want to start small and look for "spelling errors", and calculate a "grade" based on the error count. then we would have something like this.

Code: Select all
//please keep in mind that this is sparsely sudo code, this is just an example of steps you would take to accomplish this task.
public callback function spellcheck(in  EventId:integer ControlObj:control Key:integer out Cancel:boolean)
type
tVector
[*:*]  :  array [*:*] of string[*]
var
words : tVector [1:*]
wlist : tVector [1:*]
: integer(0:MAXINT)
: integer(0:MAXINT)
: integer(0:MAXINT)
: boolean
miscount
(0:MAXINT)
grade(0:MAXINT)

code
grade 
<- 100

//first we need to load the wordlist
wordlist <- "%PRGRAMROOT%/wordlist.txt"

//next we need to load the document
doc2check <- getText(me.myTextArea)

//next lets break our wordlist
for i from 1 to Length(wordlist)
    k <- strFind(wordlist, "commaChar", i, TRUE)
    if k /= 0 then
        wlist 
<- {strcopy(wordlist,j,k)}
    end if
    j 
<- j + K
end for

//next lets break the text area into an array
for i from 1 to Length(doc2check)
    k <- strFind(doc2check, "spaceChar", i, TRUE)
    if k /= 0 then
        words 
<- {strcopy(doc2check,j,k)}
    end if
    j 
<- j + K
end for

//next lets crossheck spelling
for i from 1 to Length(words)
    l <- FALSE
    for each word in wlist
        if words
{i} = word then
            l 
<- TRUE
        else if word 
= wlist{Ubound(wlist)} and l is FALSE then
            miscount 
<- miscount + 1
        end if
    end for
end for

//next lets assume you want to subtract 1 point from a grade for each mis-spelling
grade <- grade - miscount
if grade 
< 0 then
    grade 
<- 0
end if

call msgbox
("your grade is", grade)

end function
 


Now as I said above, this code snippit probably will not work out of the box, I mainly tossed it in here to give you an example of the complexity of what your after. I am not in any way trying to scare you away from what your doing, I am how ever just informing you that what you want to do is quite possible but will be a grueling task.

Please note*
if you accomplish this task, you can retire, because every word processing org in the world will pay big bucks to use your invention =).

I wish you the best of luck, and We will be more then happy to assist you in anyway we can along your journey.
Cheers.
onykage
Admin
 
Posts: 180
Joined: Sat Jan 03, 2009 8:28 pm
Location: Armpit USA
Programming languages: php, java, python, ubercode, easyuo, peril, cobal, pascal, ruby

Re: Getting off the ground with Ubercode

Postby ubercode on Mon Feb 15, 2010 6:16 pm

Hi forkinpm

First of all welcome to the Ubercode forum! Thanks for registering and I hope you get lots of use and benefit from Ubercode.

Anyway to answer your questions, onykage is spot on about Ubercode being a GUI based language (Graphical user interface). You can run Ubercode programs from the command line if you want, but it sounds as if your program needs to display its results, so it will need a window to do this. You can start off with a GUI and add code to read the command line later on, so start with the easiest option :) Moving on to your questions:

Count the number of words in a sentence and print the number to the open window. There are two ways of doing this: (1) is to use functions StrWordCount to find the total number of words and StrWord to get each word in turn. (2) Also you can use the loop Onykage showed in the previous post. Both methods assume words are separated by spaces.

The file to be opened will either have only one sentence or the file will be opened and the sentence marked with mouseover. Use function OpenFileDialog to prompt for a file, and read the file into an edit window. There is an example program in the Developer Environement (File - Open Examples - Files1) which does this.

Break the sentence into two clauses based on a "|" marking the line break, Break each clause into phrases using commas as eol breakpoints. I'm unclear here - are you going to manually edit the text and put in the markers? If so there is no problem. There is another function StrSplit which chops up a string using any marker you want ("|", "," etc).

Is Ubercode a language to be used for such tasks? Can such tasks be programmed by non-trained persons? Yes and Yes - and there is a lot of help available for you. (1) Use File - Open Examples in the Developer Environment to look at lists of sample programs. You can use these as the starting point for your own programs. (2) There is a help system for looking up commands. Whenever anyone mentions a command you can check these in the help.

Kind regards,
Will Rayer
ubercode
Site Owner
 
Posts: 223
Joined: Sun Jan 04, 2009 3:46 pm
Location: UK Channel Islands

Re: Getting off the ground with Ubercode

Postby forkinpm on Tue Feb 16, 2010 7:09 pm

Hallo!

Let this post be an interim response to the two replies I received from "onycage" and "willirayer".
I have said an interim response because tomorrow I will send a more detailed reply.
In any even I thank you both for open and clear responses to the core themes you both have found
in my original post.
I am generally not very impressed by the concept of forums.
In this case however as the Germans would say "Hat up" and the English "I doff my cap".
I will send tomorrow a more worthwhile response.
Kind regards and a pleasant "Fasching evening", forkinpm.
forkinpm
New Member
 
Posts: 6
Joined: Mon Feb 15, 2010 8:18 am

Re: Getting off the ground with Ubercode

Postby forkinpm on Wed Feb 17, 2010 12:16 pm

Hallo!

Ways to identify sentence text structures for a translation model.

The ability to identify the hierarchical structure of text sentences, if the process is not preprogrammed, is conditioned by the following:
1. The tutorial available to the user
2. The simplicity of and logical definition of the steps in the process
3. The rules defined to guide the user in the process steps and
4. The examples contained in the tutorial material.
I have prepared comprehensive material to allow the process steps to be easily conducted.
To pre-program the process steps, both the above material and a notation databse of the structure of sentences is required.
This notation database I have defined and am beginning to "play" with it to determine its usability spectrum.
The notation database has a second role in the process and that is to share with the English to German dictionary the support for, translating English phrases into their German equivalents.
Together, the notation scheme and the dictionary are the core of what I refer to as a syntactical bridge between the two languages.
One key example of that bridge is the fact that English does not use declensions and has almost no word-ending changes. These are the essence of the German grammar and syntax.
The dictionary with the notation database allow the translation of English phrases into their correct German euivalents; the subject phrase is translated into the nominative in German, the directz object into the accusative, the indirect object into the dative and lastly the possessive object into the genitive.
To fully appreciate those statements one has to be a user of both languages.
To say that no on-line dictionary available for the desktop is capabale of doing the same should indicate the importance of the statement.
My solution is to use the manual method as an interim method until I have made all of the decisions on the database for the dictionary and the notation and of course on which programming language to use.
The post is complex and only easy to underrstand if one is conversant with linguistics.
For anyone willing to help me or is interested in helping me with the programming task then I can make much of the material available to help him or her in the helping process. Also of interest is the material I have produced on why and how to evaluate programming languages to decide on one to use.
Kind regards, forkinpm.
forkinpm
New Member
 
Posts: 6
Joined: Mon Feb 15, 2010 8:18 am

Re: Getting off the ground with Ubercode

Postby forkinpm on Wed Feb 17, 2010 12:19 pm

Using exe with cmd-line as an extension to a workspace.

Hallo!

In an effort to explain my interest in using executables via the cmd-line, I wish to lay amphasis on the need to understand a user's workspace for the tasks he performs and wishes to program.
More decisions on the part of users to learn programming would be taken, if SW providers understood this need and reviewed their products in terms of users needing to operate within a workspace.
As I have said, I am a writer who has built a model, to translate "manually" English texts into German. It is almost essential that when I markup my texts to prepare for translation, that I use the same workspace and editor that I used in the writing process.
This leads to the following alternatives in the programming solution:
1. Use executables called from the text editor or
2. Write programs as functional extensions to the editor
3. Write each of the steps as a batch file and chain them together as was the case with DOS batch file procesing. That is easier said than done.
4. Write a collection of programs using a newly programmed window frame.
5. Use an automation tools such as autohotkey or the like.
In all cases the decsions are based on what the programming language product has to offer. Most of the product decisions are impossible to realise for an untrained person.
I hope that what I have written is understandable.
Kind regards, forkinpm.
forkinpm
New Member
 
Posts: 6
Joined: Mon Feb 15, 2010 8:18 am

Re: Getting off the ground with Ubercode

Postby forkinpm on Wed Feb 17, 2010 12:23 pm

Sentence text structures for an English language learner.

Hallo!

This post is the third to answer the questions posed in the two replies to my first two posts yesterday.
This topic is very closely related to the post I made on using sentence structures for the translation model.
It is said that three quarters of the content on the Internet is in English. This is true but it needs to be stated that a large proportion of what is written is in such a poor form of English that it is not understandable.
The writers of poorly formed documents are often unaware that they offer material which does the opposite of what was hoped for.
These same learners of English are also generally those writing the documentation for the products offered.
For these reasons I wish to use the same notation model I referred to in the first post, in conjunction with a tool to help users of and writers of English, to learn how to correct their mistakes.
The notation model will require an additional capability and that is to support the cross-referencing of notations in scripts across clause and also across sentences.
When I am closer to completion of this definition, I will add further posts on the subject. Kind regards, forkinpm.
forkinpm
New Member
 
Posts: 6
Joined: Mon Feb 15, 2010 8:18 am

Re: Getting off the ground with Ubercode

Postby ubercode on Wed Feb 17, 2010 6:07 pm

Dear Forkinpm - You ask a lot of good questions! I will answer as best I can:

For anyone willing to help me or is interested in helping me with the programming task then I can make much of the material available to help him or her in the helping process.


I speak English (I am English) and I know a little French and German, but I'm not able to translate anything much from English into German. So I can help you with programming questions, but not with translation techniques! Feel free to ask for help with programming tasks - Ubercode is a general purpose language and has many commands for working with strings and text files. So it should be able to do what you want.

Also of interest is the material I have produced on why and how to evaluate programming languages to decide on one to use.


Again if you want to compare languages, I am happy to give you lists of features in different languages. In addition there are probably websites that compare different computer languages.

It is almost essential that when I markup my texts to prepare for translation, that I use the same workspace and editor that I used in the writing process.


You can use Ubercode to create an editor or a workspace - there are example programs that show this. You can create a custom editor that runs executables, this will add programs to the editor. Also you can use Ubercode to write command line programs. You would read in parameters from the command line, and use these parameters to control the program and determine what to do. Parts of Ubercode use this technique.

Finally, I suggest you start by choosing a simple task and making this work. Eg you may have some text in a file, you want to know how to read this into a string in memory and how to find the clauses in the string. Just pick a simple task and focus on this - or there is a danger of getting too bogged down in detail!

Hope this helps
Kind regards, Will Rayer
ubercode
Site Owner
 
Posts: 223
Joined: Sun Jan 04, 2009 3:46 pm
Location: UK Channel Islands

Re: Getting off the ground with Ubercode

Postby forkinpm on Thu Feb 18, 2010 9:05 am

Last reply to this theme from Will Rayer

Hallo!

and thank you for your last response.
As I am writing my posts daily, I am reading through the material supplied with the language.
My impressions are principally positive that:
1. Whoever is responsible for the documentation has a quality goal higher than competitors. but
2. The language would benefit from moving in the direction of natural langauge.
The use of words, terms and phrases that are outside the scope of the vocabulary an intelligent user uses, is the most significanf factor militating against the use of programming languages by professional but not it-trained users.
The material I have gathered and written on this theme I will provide you with when I have got the first programming project behind me.
Now I would like to take you up on your suggestion of creating a form of editor for the translation task and ask you for some suggested sample programs covering:
1. Creating or opening a two pane ediitor in which
2. A program can call and open a file in pane 1 and
3. A series of programs can be called sequentially for execution from pane 2 as "translation model tasks" such as
3.1. Reading a sentence from pane 1 and marking it with a single | for segmenting into clauses
3.2. Running a program to take the | marker in 3.1. and replace it with an EOL char.
The sentence is now represented in pane 2 by two lines each with a separate clause (main Clause and Predicate)
3.3. In each of these Clauses phrase ends are now artificially and manually marked by commas.
3.4. A variant of the program in 3.2 is now executed to replace the commas with EOL characters.
In terms of preparation for the translation the main work is done for an interim version.
Do such programs, performing any of the above tasks exist, or are there programs which exist and could be modified to perform the above tasks.
If my questionning becomes too time consuming for you, please tell me.
There will come a point in time in which I would wish to communicate with you off-line rather than post for others to read.
I am still moving down an untested path particularly with my dictionary and the notation database.
Would you give me an offline email address to which I can communicate.
May I just ask one other question in this post? Do you have, in your plans a goal to add the ability to link to LISP, Prolog or CLIPS? I need a rules or inference based logic capability.
I look forward to your response. Kind regards and thanks again, forkinpm.
forkinpm
New Member
 
Posts: 6
Joined: Mon Feb 15, 2010 8:18 am

Re: Getting off the ground with Ubercode

Postby ubercode on Thu Feb 18, 2010 5:58 pm

Hello

There is an example program "sdi" which does part of what you need. In the developer environment, use File - Open Examples and scroll down to the SDI example and open it and run it. When SDI runs it allows you to choose a file and displays it in a single pane (edit window). You can experiment with this and load up small text files and manually add | characters. SDI can be extended to add extra panes (windows), and the extra windows can have buttons, text entry areas etc.

I am not fully clear about your "translation model tasks" pane. The tasks you describe (replacing | with EOL, replacing "," with EOL) can be done very simply with a single line of code (strchg) so you may not need a separate EXE file for these tasks. Or do you already have separate EXE files to run?

If you had existing EXE files that carried out complex tasks, the second pane could have an area where you type in the name of the EXE file and the parameters, then click 'Run' or something like that.

Regarding links to LISP / Prolog, this could be done by running the LISP / Prolog program as a separate EXE file.

I hope this helps you get started!

Kind regards, Will Rayer
ubercode
Site Owner
 
Posts: 223
Joined: Sun Jan 04, 2009 3:46 pm
Location: UK Channel Islands

Re: Getting off the ground with Ubercode

Postby onykage on Fri Mar 19, 2010 1:57 pm

forkinpm:

If you are german and it will better help you post your questions in german, as it may help you better get your ideas accross.
onykage
Admin
 
Posts: 180
Joined: Sat Jan 03, 2009 8:28 pm
Location: Armpit USA
Programming languages: php, java, python, ubercode, easyuo, peril, cobal, pascal, ruby


Return to Ubercode Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron